Combined Bar and Line chart with different numbers of data points

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Craig Prosser on 29th May 2013
In all the examples that I can find of a combined bar and line chart, there are the same number of data points for the line data and the bar data. I have a requirement where this is not the case. Consider a chart of annual sales data where a bar chart shows the monthly sales values for a year, while a line chart superimposed over it shows the sales for each week of that same year. The combined chart would enable a viewer to see how sales had gone within each month as well as for each month. I cannot see how this can be achieved. Is there a way? Is there a way to manually draw the line chart once the bar chart has been drawn, or can I somehow make use of dual x-axes?

Thanks for the excellent product.

Posted by RGraph support on 29th May 2013
Hi there,

Here's an example of such a chart - but with 48 points on the line - 4 per month. If you increase that to 52 - things won't line up precisely:

dev.rgraph.net/fiddle/view/c0bd754dac85f84de11bda4dc288d8ac


Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Craig Prosser on 29th May 2013
That is excellent! Thank you for the resolution.

Add a reply




« Back to message list