How to make a chart from arduino sent value

hello,
I have a list [[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,0],[12,0],[13,0],[14,0],[15,0],[16,0],[17,0],[18,0],[19,0],[20,0],[21,0],[22,0],[23,0],[24,0]]

that is sent by the Arduino the data changes it is made to be like this [x,y] i tried making it to a chart based on what i saw in the forums but it gives me errors that it is not a list , i am changing screen to bluetooth screen that has all the chart data so i save in tinydb then i change screen load it in the new screen

String data = "[" + String(1) + "," + String(hour1) + "],"
                "[[" + String(2) + "," + String(hour2) + "],"
                "[" + String(3) + "," + String(hour3) + "],"
                "[" + String(4) + "," + String(hour4) + "],"
                "[" + String(5) + "," + String(hour5) + "],"
                "[" + String(6) + "," + String(hour6) + "],"
                "[" + String(7) + "," + String(hour7) + "],"
                "[" + String(8) + "," + String(hour8) + "],"
                "[" + String(9) + "," + String(hour9) + "],"
                "[" + String(10) + "," + String(hour10) + "],"
                "[" + String(11) + "," + String(hour11) + "],"
                "[" + String(12) + "," + String(hour12) + "],"
                "[" + String(13) + "," + String(hour13) + "],"
                "[" + String(14) + "," + String(hour14) + "],"
                "[" + String(15) + "," + String(hour15) + "],"
                "[" + String(16) + "," + String(hour16) + "],"
                "[" + String(17) + "," + String(hour17) + "],"
                "[" + String(18) + "," + String(hour18) + "],"
                "[" + String(19) + "," + String(hour19) + "],"
                "[" + String(20) + "," + String(hour20) + "],"
                "[" + String(21) + "," + String(hour21) + "],"
                "[" + String(22) + "," + String(hour22) + "],"
                "[" + String(23) + "," + String(hour23) + "],"
                "[" + String(24) + "," + String(hour24) + "]]";
  Serial.print(data);

I want to show the list in charts

thank you

The Web component has blocks to convert your JSON text to lists of lists (tables).

That would eliminate all the text replace work.

so i need to use json.decode?

Sounds good

the json decode takes all my list to [1,0]

EDIT: my bad the first json "[" was set to [1, 0] ,[[2,0] it should be [[1,0],[2,0]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.