How to Use The Bolt Graph Functions in my Own HTML Page

How can I use the following code in a HTML Page?
setChartLibrary(‘google-chart’);
setChartTitle(‘Your Graph Title’);
setChartType(‘lineGraph’);
setAxisName(‘X-Axis Name’,‘Y-axis Name’);
plotChart(‘time_stamp’,‘your_variable_name’);

Thanks in Advance!

create a java script file using the functions specified by you and save it as .js file and include it in your html code using tag.
Thank you.

I did so.

<html>
<head>
<script>
setChartLibrary(‘google-chart’);
setChartTitle(‘Your Graph Title’);
setChartType(‘lineGraph’);
setAxisName(‘X-Axis Name’,‘Y-axis Name’);
plotChart(‘time_stamp’,‘your_variable_name’);
</script>
</head>
</html>

But I couldn’t get the desired graphs on my html page. Bolt suggests to write the following code in a .js file and to run that js file directly.

save it in a .html file to run it

Yes, I already did that!

Did you write the code in the bolt cloud forum?

Hiii… @swapnilsen451, this code will run only in the Bolt Cloud page as it uses Google Chart, which can be accesses directly from the internet. Your HTML software can not access the Google Chart.

1 Like

Thank You So Much. Is there a way to do analogRead within the bolt page then?

Yes, in Bolt Page, go to your products tab, click on configure this device. Then assign a variable to A0 pin or 0 in the hardware tab then you can use this variable in the code tab in your html or js code

Ok thank you so much.