Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Getting Primary Y-Axis to Match Secondary Y-Axis
Migrateduser
<p>Hello all,</p><p> </p><p>I am working with BIRT 3.7.2 and have a query that returns the following fields.</p><p> </p><p>Average Max Quantity, Average Max Weight, Max Quantity, Max Weight, and Date</p><p> </p><p>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.</p><p> </p><p>Thanks,</p><p>Adam Brousseau</p><p> </p><p>importPackage( Packages.org.eclipse.birt.chart.model.data.impl );</p><p>var cht = reportContext.getDesignHandle().findElement("Chart1");
var chart = cht.getReportItem().getProperty("chart.instance");</p><p>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);</p>
Find more posts tagged with
Comments
There are no comments yet