Formatting chart axis labels [message #225183] |
Wed, 14 March 2007 15:05  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.29084 seconds