Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Script for chart
Script for chart [message #150119] Sat, 01 April 2006 15:53 Go to next message
Eclipse UserFriend
Originally posted by: pkustack.gmail.com

Birt examples show that there are some callback script function that we can
use to decorate the charts:
function beforeDrawDataPoint( dph, fill, context ){}
function beforeDrawDataPointLabel( dph, label, context ){}
...
What i want to do is access report parameters in these script functions.
For example:
function beforeDrawSeriesTitle(series, label, scriptContext)
{
label.getCaption().setValue(params["title"]);
}
But it seems that this is not working.
I've tried to access reportContext by scriptContext(I don't konw if it is
possible),but still not working.
Could you tell me if it is possible to access report parameter here and if
it is not possible,is there any other way to do reach the parameters?
Thank you very much!
Re: Script for chart [message #150415 is a reply to message #150119] Mon, 03 April 2006 17:46 Go to previous message
David Michonneau is currently offline David MichonneauFriend
Messages: 1145
Registered: July 2009
Senior Member
You can access them through the scriptcontext:

scriptContext.getExternalContext().getScriptable() will give you access to a
IReportContext object, where you can access report parameters. I advise
writing scripts in Java as it is easier to debug than JavaScript.

Thanks,

David

"lihe" <pkustack@gmail.com> wrote in message
news:e0m7m1$953$1@utils.eclipse.org...
> Birt examples show that there are some callback script function that we
> can use to decorate the charts:
> function beforeDrawDataPoint( dph, fill, context ){}
> function beforeDrawDataPointLabel( dph, label, context ){}
> ...
> What i want to do is access report parameters in these script functions.
> For example:
> function beforeDrawSeriesTitle(series, label, scriptContext)
> {
> label.getCaption().setValue(params["title"]);
> }
> But it seems that this is not working.
> I've tried to access reportContext by scriptContext(I don't konw if it is
> possible),but still not working.
> Could you tell me if it is possible to access report parameter here and if
> it is not possible,is there any other way to do reach the parameters?
> Thank you very much!
>
Previous Topic:Error compiling birt chart example
Next Topic:how to use the chart engine outside of birt
Goto Forum:
  


Current Time: Sat Jul 13 20:39:18 GMT 2024

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

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

Back to the top