No graph is shown after configuration is deployed

Hello.
I am in the module of google charts and graph.
I changed the code as per the instructions but I can’t see the graph.
Here is the screenshot of it.


and the code
setChartLibrary(‘google-chart’);
setChartType(‘linegraph’);
plotChart(“time_stamp”,“light”);
and one more doubt in the module of project 1 in the video in the plotchart function " " was used,but in this section in the code they used ’ ’ . so, can you please tell me which one is correct?

Make sure you mentioned the same variable name you gave for A0
Also both ’ ’ and " " doesnt matter in js.Both are correct.

@richal.pandey45 Can you please open the Chrome console by pressing CTRL + SHIFT + J and send us the screenshot of it?
Also, share the code that you have written for the graph.

Hi @richal.pandey45,

There is a small typo error in the code . It will be lineGraph, not linegraph

setChartLibrary("google-chart");
setChartType("lineGraph");
plotChart("time_stamp","light")

Check this link https://docs.boltiot.com/docs/line-graph
Both single quotes ( '' )and double quotes ( " " )is correct. It will work with both.

Do let me know in case you need any other information.

1 Like

both " " and ' ' are considered in javascript and they dont give an error the problem here is that the in the “linegraph” ‘g’ will be in capital letters i.e “lineGraph”

1 Like

@richal.pandey45 1) The code which you have given is in JavaScript, which is a case-sensitive language. Therefore, it is lineGraph and not linegraph.
setChartLibrary(‘google-chart’);
setChartType(‘lineGraph’);
plotChart(“time_stamp”,“light”);

  1. There is no difference between (" ") and (’ '), you can use any one of them.

use directly A0 (if u reading analog value ). giving variable as light was also not working for me ,but once i changed it to A0 i got my output.
use
plotChart(“time_stamp”,“A0”);

@richal.pandey45 there seems no fault in your code…but there are some posibilities why your graph is not showing they are…
make sure that your variable name is same…,make sure you have saved your code properly…

First of all, we need to keep in mind that JavaScript is a case-sensitive language. Thus, in the code, lineGraph should be used and not linegraph.
Thus, overall code becomes,

setChartLibrary(‘google-chart’);
setChartType(‘lineGraph’);
plotChart(“time_stamp”,“light”);

Secondly, there is no difference between (" ") and (’ ') and can use any one of them.

for more info, you can also refer to, https://canvasjs.com/html5-javascript-line-chart/

Feel free to ping me any time for queries if you have any.

Thank you.