Home
DevShare Downloads
Making the scales of a dual-axis chart the same
pricher
When generating a dual-axis chart, the scale of each axis is determined by the low and high values of the series contributing to each axis. Although this behaviour makes sense, in some cases it is desirable to have the same scale for both axes even though the values may differ in range.<br />
<br />
It is possible to change the scale of each axis independently using the chart wizard; however, if we don't know in advance the range of values that can be charted, this is not sufficient.<br />
<br />
A bit of Java scripting using the chart API can resolve the problem. In this example, we override the beforeGeneration method of the chart onRender event. First, we get the low and high values for the two series. Secondly, we round up to the top value. Finally, we apply set the min and max values of the scale to each axis.<br />
<br />
Thanks to Scott Rosenbaum for providing the original Java Event Handler example.<br />
<br />
P.
Find more posts tagged with
Comments
There are no comments yet