About
RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 15 years old) and has a wealth of features making it an ideal choice to show charts on your website.

More »

 

Download
Get the latest version of RGraph (version 6.17) from the download page. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

More »

 

License
RGraph can be used for free under the GPL or if that doesn't suit your situation there's an inexpensive (£99) commercial license available.

More »

How would I implement multi-channel Line charts?


Posted by Vladimir at 08:33 on Thursday 19th August 2021 [link]
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 [LINK REMOVED]

Posted by Richard at 13:26 on Thursday 19th August 2021 [link]
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.

demos/line-tooltips-formatted-table.html
demos/line-tooltips-dataset.html
demos/line-stacked-filled.html
demos/line-spline-multiple-lines.html
demos/line-spline-filled.html
demos/line-offset-x-axis.html
demos/line-nvd.html
demos/line-front-page.html
demos/line-adjustable.html
demos/line-adjustable-limited.html

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

[4,8,6,5,3,5,6]

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 Friday 20th August 2021 [link]
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 Friday 20th August 2021 [link]
I see. Well if you're using the Scatter chart there's a backgroundVbars option that you could use to do that.

https://www.rgraph.net/canvas/scatter.html#background-properties

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:

https://www.rgraph.net/canvas/scatter.html#line-properties

[Replies are now closed]