Skip to main content



      Home
Home » Archived » BIRT » Formatting chart axis labels
Formatting chart axis labels [message #225183] Wed, 14 March 2007 15:05 Go to next message
Eclipse UserFriend
Hi, all.

I apologize, but I know somewhere I saw a sample of formatting the axis
labels with a script that changes numbers in thousands to nk (where n is
the number of thousands) and numbers in millions to nM (again where n is
the number of millions). I can't seem to find it now and was wondering
if someone could give me a quick pointer.

Thanks,
Keith McQueen
Re: Formatting chart axis labels [message #225195 is a reply to message #225183] Wed, 14 March 2007 17:11 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Keith McQueen wrote:
> Hi, all.
>
> I apologize, but I know somewhere I saw a sample of formatting the axis
> labels with a script that changes numbers in thousands to nk (where n is
> the number of thousands) and numbers in millions to nM (again where n is
> the number of millions). I can't seem to find it now and was wondering
> if someone could give me a quick pointer.
>
> Thanks,
> Keith McQueen
David may have another example but you could do something like this in
the beforeDrawDataPointLabel

function beforeDrawDataPointLabel( dph, label, context ){
importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
importPackage(Packages.java.lang);

myval = Float.parseFloat(dph.getOrthogonalValue());
if(( myval/100 ) > 1 ) {
label.getCaption().setValue((myval/100) + "h");
}

}

In your case you may want to have your if be a range eg
if(( myval/100 ) > 1 && (myval/100) <= 100) {
label.getCaption().setValue((myval/100) + "h");
}else if(( myval/1000 ) > 1 && (myval/1000) <= 100) {
label.getCaption().setValue((myval/1000) + "t");

}


Jason
Previous Topic:using BIRT libraries
Next Topic:Adding wording for a blank group header.
Goto Forum:
  


Current Time: Mon Jul 14 02:28:09 EDT 2025

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

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

Back to the top