Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Setting secondary y-axis scale as primary
bourn2lead
Hi,
In my report I have a chart which has 2 y-axis series. here my requirement is I need to set the scale of secondary y-axis as primary y-axis. I tried by using the following script but getting error. Is there any one to help me to solve this issue? For more details, please see the attached image.
Below is my script:
function beforeGeneration( chart, icsc )
{
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
xAxis = chart.getBaseAxes()[0];
yAxis1 = chart.getOrthogonalAxes( xAxis, true)[0];
yAxis2 = chart.getOrthogonalAxes( xAxis, true)[1];
yscale1 = yAxis1.getScale();
yscale2 = yAxis2.getScale();
yscale1_min = yscale1.getMin();
yscale1_max = yscale1.getMax();
yscale2.setMin(yscale1_min);
yscale2.setMax(yscale1_max);
yscale2 = yscale1;
yAxis2.setScale(yscale1);
}
Find more posts tagged with
Comments
mwilliams
Hi bourn2lead,
Can you explain the reasoning behind needing to switch this? Is making series 2 the first series not a way to handle what you're wanting. Please explain a little more in detail, if you can. Thanks.