Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Setting scatter chart x and y axis titles dynamically
Setting scatter chart x and y axis titles dynamically [message #368943] Wed, 08 July 2009 07:40 Go to next message
Assaf  is currently offline Assaf Friend
Messages: 15
Registered: July 2009
Junior Member
Hi,

I use Birt runtime viewer and so can't change anything on the server side.

What I need is for the titles ov the X and Y axis to be givin a dynamic
value
with an expression builder (so I can access the session or context
variables to set the labels dynamically).

Is there a way to do so (I don't see any expression builder) ?

Thanks.
Re: Setting scatter chart x and y axis titles dynamically [message #368944 is a reply to message #368943] Wed, 08 July 2009 15:36 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Can you use the beforeDrawAxisTitle script?

function beforeDrawAxisTitle(axis, title, scriptContext)
{
importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
if (axis.getType() == AxisType.LINEAR_LITERAL)
{
title.getCaption( ).setValue( "Y-Axis Title By JavaScript");
title.getCaption( ).getColor( ).set( 32, 168, 255 );
}
}

You could also use the beforeGeneration like:
function beforeGeneration(chart, icsc)
{
cxtitle =
icsc.getExternalContext().getScriptable().getParameterValue( "chartTitle");
xAxis = chart.getBaseAxes()[0];
xAxis.getTitle().getCaption().setValue( cxtitle );


}
The above example sets the title based on a report parameter. This line
icsc.getExternalContext().getScriptable() gets the reportContext, which
can be used to get report parameters, persisted global variables and
session values.

Jason

Assaf wrote:
> Hi,
>
> I use Birt runtime viewer and so can't change anything on the server side.
>
> What I need is for the titles ov the X and Y axis to be givin a dynamic
> value
> with an expression builder (so I can access the session or context
> variables to set the labels dynamically).
>
> Is there a way to do so (I don't see any expression builder) ?
>
> Thanks.
>
Previous Topic:obtaining AutoText properties programmatically?
Next Topic:Bug when using joined data set?
Goto Forum:
  


Current Time: Fri Apr 26 19:03:22 GMT 2024

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

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

Back to the top