Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Change Chart Bar Series Label via Script
Change Chart Bar Series Label via Script [message #535752] Tue, 25 May 2010 13:51 Go to next message
No real name is currently offline No real nameFriend
Messages: 18
Registered: April 2010
Junior Member
Hi,

i want to change the Label of each Bar depending on a parameter.
I've tried to manipulate the Label by calling the beforeDrawSeries function.

function beforeDrawSeries( series, isr, icsc )
{
	var currency;
	if(icsc.getExternalContext().getScriptable().getParameterValue("currency") == "EUR")
		currency = " €";
	else
		currency = " $";
	series.getLabel().getCaption().setValue(series.getLabel().getCaption().getValue() + currency);
}


However, there is no effect when previewing the Report. What can I do to make this work?
Re: Change Chart Bar Series Label via Script [message #535762 is a reply to message #535752] Tue, 25 May 2010 14:14 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Try this on the beforeDrawDataPointLabel script ie

function beforeDrawDataPointLabel(dph, label, icsc)
{
var mylab =
icsc.getExternalContext().getScriptable().getGlobalVariable( "reportvariable");
label.getCaption().setValue(mylab);
}

Jason

On 5/25/2010 9:51 AM, tobias.koehler1987@googlemail.com wrote:
> Hi,
>
> i want to change the Label of each Bar depending on a parameter.
> I've tried to manipulate the Label by calling the beforeDrawSeries
> function.
>
> function beforeDrawSeries( series, isr, icsc )
> {
> var currency;
> if(icsc.getExternalContext().getScriptable().getParameterVal ue( "currency")
> == "EUR")
> currency = " €";
> else
> currency = " $";
> series.getLabel().getCaption().setValue(series.getLabel().ge tCaption().getValue()
> + currency);
> }
>
> However, there is no effect when previewing the Report. What can I do to
> make this work?
Previous Topic:image size in Birt 2.5.2
Next Topic:setContextClassLoader() and WebSphere deployment
Goto Forum:
  


Current Time: Fri Apr 26 07:51:54 GMT 2024

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

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

Back to the top