|
Re: Setting scatter chart x and y axis titles dynamically [message #368944 is a reply to message #368943] |
Wed, 08 July 2009 15:36 |
Eclipse User |
|
|
|
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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03100 seconds