[RGRAPH SUPPORT] How would I implement multi-channel line charts?

How would I implement multi-channel line charts?

Post a reply
Posted by Vladimir at 08:33 on 19th August 2021
Hi, how can you implement multi-channel line graphs in rgraph, where each channel is represented by a separate graph (a sine wave), but all channels are displayed in a single coordinate system on the X axis(timestamps) and on the Y axis these are separate graphs. An example picture https://ibb.co/6DwW1bb

Posted by Richard at 13:26 on 19th August 2021
If by "multi-channel" you mean multiple datasets then yes you can do that with RGraph.

Here's some demos from the download archive ( https://www.rgraph.net/download.html#stable ) that show Line charts with multiple datasets.


Simply, whereas normally you would give your data as an array:


To show multiple datasets you'd change that to give an array of arrays.

[ [4,8,6,3,5,4,2], [8,7,9,6,4,8,8] ]

Posted by Vladimir at 05:10 on 20th August 2021
Thank you Richard for the excellent examples. They are really good, but they will not work in my task. I would like to divide the graphs into different coordinate planes. as it is shown in the picture by the link in my question. Thank you again for your attention to my question.

Posted by Richard at 10:16 on 20th August 2021
I see. Well if you're using the Scatter chart there's a backgroundVbars option that you could use to do that.


The Line chart won't really work in this case because the Line chart doesn't have an X axis scale (each point is just spread equally across the chart) - so use the Scatter chart (so effectively you'd have an X/Y chart where you give the X and Y values of each point) with the line option specified:


Post a reply

What's your name?
What do you want to say?