# How can I have multiple scales for a grouped Bar chart?

« Back to message list

Posted by Vlad on 19th May 2014
Hi all,

Are multiple scales supported for grouped bar chart? I have three series of numeric values and each of them has different value range ([0; 1], [0; 100], [0; 500000]). So when I put the data to grouped bar chart it computes ymin and ymax for all data combined and shows only one group with highest values. But I have three different groups and each of them must be scaled differently so they all can be visible.

I tried to use CombinedChart to have three separate scales. It kinda works but it doesn't really draw well multiple bar charts.

All provided examples use the same value range for each bar series.

Thanks,
Posted by Richard on 19th May 2014
You could probably do multiple scales for the Bar chart - but it would be better IMO to use a Line chart (certainly easier). There's an example of such a chart in the demos:

www.rgraph.net/demos/line-multiple-y-axes.html

Richard
Posted by Richard on 19th May 2014
Actually now I think about it some more a grouped Bar chart where each of the three bars wouldn't be so hard - very similar to the line:

bar1 = RGraph.Bar('cvs', [[0,0,4],[0,0,8],[0,0,5]])
.set('noaxes', true)
.draw()

bar2 = RGraph.Bar('cvs', [[0,206,0],[0,148,0],[0,102,0]])
.set('noaxes', true)
.draw()

bar3 = RGraph.Bar('cvs', [[508,0,0],[485,0,0],[605,0,0]])
.draw()

You might need to do some further config - like colors.

Richard
Posted by Richard on 19th May 2014
An example of a Bar chart with multiple axes:

www.rgraph.net/fiddle/view.html/a-bar-chart-with-multiple-scales

Richard