Skip to main content



      Home
Home » Archived » BIRT » How to get a axis object in JavaScript?
How to get a axis object in JavaScript? [message #194717] Wed, 11 October 2006 11:21 Go to next message
Eclipse UserFriend
Originally posted by: m.luo.cosmit.de

Hello,
There are 2 y-axis(y-axis-1, y-axis-2) in my chart. Now I want to configure
some feature for y-axis-1 with Script in method beforeGeneration(chart,
context){}. But i don't know, how to get the "axis object" that I want (here
is y-axis-1)?

Thanks and Regards,
Luo
Re: How to get a axis object in JavaScript? [message #195008 is a reply to message #194717] Thu, 12 October 2006 10:11 Go to previous messageGo to next message
Eclipse UserFriend
Here is a script I used to scale the primary y axis based on a value within
the report.

function beforeGeneration( chart, context ){

importPackage(Packages.org.eclipse.birt.chart.model.attribut e);

importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);

chrmax =
context.getExternalContext().getScriptable().getGlobalVariab le( "cmax");

xaxis = chart.getPrimaryBaseAxes( )[0];

yaxis = chart.getPrimaryOrthogonalAxis( xaxis );

yaxis.getScale().setStep(200000);

yaxis.getScale().setMax( NumberDataElementImpl.create( chrmax ));

}


Jason

"Luo" <m.luo@cosmit.de> wrote in message
news:egj26s$vqg$1@utils.eclipse.org...
> Hello,
> There are 2 y-axis(y-axis-1, y-axis-2) in my chart. Now I want to
> configure some feature for y-axis-1 with Script in method
> beforeGeneration(chart, context){}. But i don't know, how to get the "axis
> object" that I want (here is y-axis-1)?
>
> Thanks and Regards,
> Luo
>
Re: How to get a axis object in JavaScript? [message #195392 is a reply to message #194717] Fri, 13 October 2006 11:12 Go to previous message
Eclipse UserFriend
Originally posted by: m.luo.cosmit.de

Hello Jason,
Thanks a lot.

Luo
Previous Topic:Birt exception when preparing SQL statement
Next Topic:how birt handles styles
Goto Forum:
  


Current Time: Fri Jul 18 04:23:59 EDT 2025

Powered by FUDForum. Page generated in 0.07810 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top