Getting Primary Y-Axis to Match Secondary Y-Axis [message #1086808] |
Wed, 14 August 2013 15:02  |
Eclipse User |
|
|
|
Hello all,
I am working with BIRT 3.7.2 and have a query that returns the following fields.
Average Max Quantity, Average Max Weight, Max Quantity, Max Weight, and Date
The user is able to select from either quantity or weight and I have a chart with two y-axis to display the average as a bar and the maximum as a line. The reason for this is to allow potential outlyers be identified by the user. I was looking for some help to script setting both y-axis values to the same values. For example if the secondary y-axis goes from 0 to 100 then I want that to reflect on the primary y-axis as well. This way I am not displaying two y-axis with labels. As I will not know what the values are ahead of time scripting is my only option. Below is some scripting that I have found that doesn't work, though I believe this is a similar attempt to what I am working towards. Any help would be most appreciative.
Thanks,
Adam Brousseau
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
var cht = reportContext.getDesignHandle().findElement("Chart1");
var chart = cht.getReportItem().getProperty("chart.instance");
xAxis = chart.getBaseAxes()[0];
yAxis1 = chart.getOrthogonalAxes( xAxis, true)[0];
yAxis2 = chart.getOrthogonalAxes( xAxis, true)[1];
yscale1 = yAxis1.getScale();
yscale2 = yAxis2.getScale();
yscale2_min = yscale2.getMin();
yscale2_max = yscale2.getMax();
yscale1.setMin(yscale2_min);
yscale1.setMax(yscale2_max);
yscale2 = yscale1;
yAxis2.setScale(yscale1);
|
|
|
|
Powered by
FUDForum. Page generated in 0.06433 seconds