Chart multiple lines

Hello again. I am trying to read data from csv file and represent them in chart. I took one example from here and modified it . It works fine but only with one line. Can someone help me add additional three lines.
Code is bellow

payload is next "[{"series":["1.Izmena","2.Izmena"],"data":[[{"x":"2023-03-08","y":300.45,"y2":155.7},{"x":"2023-03-09","y":300.45,"y2":155.7},{"x":"2023-03-10","y":300.45,"y2":155.7},{"x":"2023-03-11","y":300.45,"y2":155.7},{"x":"2023-03-12","y":300.45,"y2":155.7},{"x":"2023-03-13","y":300.45,"y2":155.7}]],"labels":["01"]}]"

Each line on a chart has to be sent as an array of x: , y: objects. You have this

"data":[
[
{"x":"2023-03-08","y":300.45,"y2":155.7},{"x":"2023-03-09","y":300.45,"y2":155.7},{"x":"2023-03-10","y":300.45,"y2":155.7},
{"x":"2023-03-11","y":300.45,"y2":155.7},{"x":"2023-03-12","y":300.45,"y2":155.7},{"x":"2023-03-13","y":300.45,"y2":155.7}
]
]

It should be

"data":[
[
{"x":"2023-03-08","y":300.45},{"x":"2023-03-09","y":300.45},{"x":"2023-03-10","y":300.45},
{"x":"2023-03-11","y":300.45},{"x":"2023-03-12","y":300.45},{"x":"2023-03-13","y":300.45}
],
[
{"x":"2023-03-08","y":155.7},{"x":"2023-03-09","y":155.7},{"x":"2023-03-10","y":155.7},
{"x":"2023-03-11","y":155.7},{"x":"2023-03-12","y":155.7},{"x":"2023-03-13","y":155.7}
]
]

...jbudd thank you for your tip. Bellow modified program for two lines.

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