How to create a line chart

Hi how can we create a line chart in bolt cloud which takes data from a python program
I am trying to add a custom sensor to bolt device then take its value in a python program and send it to bolt cloud how can I do this

@hemsharan2050

To plot the graph on Bolt cloud, you need to use the Code tab in Product configuration where you can write your code in HTML or Javascript to directly use the Inputs from Bolt Module.

There is a way around this, where you can use UART communication on the Cloud, and select no. of values you’ll be receiving. On python, you can write the data as Serial Write and make API calls from there to execute the function.

You can take reference from Getting started on Raspberry Pico with Bolt IoT (Windows) - Hackster.io and relate to convert the code to directly send data from the Bolt Module’s input itself.

Let me know if you have any other queries.

Thanks for the information
But I want to use raspberry Pi 4 and I am not using external sensor I will be using raspberry Pi’s inbuilt temperature monitoring system so how to plot that

@hemsharan2050

Do the same as I mentioned, use whatever sensor or inbuilt functions to generate data, that is upto you.

But to send the data to the Cloud you need to make the SerialWrite API call using Python. And on Bolt Cloud, have a product ready to plot the data with UART communication.

Yes I but the inbuilt value dose not have an external pins do what to do

@hemsharan2050

Are you able to store the value in a variable using Python?

Yes I am able to store the data
Can you paste a example code with chart

@hemsharan2050

Can you please confirm whether you are using any Bolt Module for this? Or are you using the Pi as the Bolt in this case?

I am using a raspberry Pi

@hemsharan2050

In that, you won’t be able to send SerialWrite data to the Bolt Cloud.

The plotChart in Bolt Cloud is an inbuilt function to read GPIO pin values, that are defined in the Cloud itself. The Hardware configuration tab takes care of that.

I believe you won’t be able to send custom data to the graph, with the current version.

to create a line chart use set your JavaScript code as follows:
setChartType(‘lineGraph’)
Simple that’s it.