Search code examples
rgraph

How to draw multiple charts on a single canvas with RGraph?


I'm trying to figure out how to draw multiple RGraph charts on a single canvas. Not overlapped charts, but, say, one chart under another. I'd prefer to do it this way (rather than have multiple canvases on the page) as should far easier to generate a png from a single canvas rather than try to stitch a bunch of pngs together.

Suggestions? Other approaches I may be missing?


Solution

  • There's an example of using one canvas to show multiple Gauge charts in the download archive called: demos/gauge-bank.html and you can download the archive here:

    https://www.rgraph.net/download.html

    And here's a HOWTO showing a canvas again with three Gauge charts, not overlapping this time:

    https://www.rgraph.net/canvas/howto-gauges.html

    In the case of Bar charts or Line charts you would set a big left margin for one chart and a big right margin for the other chart, so each allows space for the other.