Combined Bar and Line chart with different numbers of data points

Share RGraph:   Share or Like RGraph on Facebook!

« 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:

www.rgraph.net/demos#line



Richard
Posted by Craig Prosser on 29th May 2013
That is excellent! Thank you for the resolution.

Add a reply




« Back to message list