Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Show the y-axis labels with $prefix.
kotamreddy
Hi:
I hope this is the right forum. I am new to birt api and it is being used on our product. I am trying to fix an issue wherein the y axis which shows currency values does not show $ with the amounts. I do not see any currency format that I can associate with the y series in the API. Can somebody guide me as to how to solve this issue?
BTW, I am using BIRT 2.0.1
Thank you,
Srinivas
Find more posts tagged with
Comments
mwilliams
Hi Srinivas,
Do you actually use the BIRT designer to create your chart for your application? Or do you just have the BIRT engine embedded in your application?
kotamreddy
Hi Michael,
I just have the BIRT engine embedded in the application.
- Srinivas
mwilliams
Srinivas,
I'm working with BIRT 2.3. I used this script in the chart to put the '$' before the values on the y-axis. Not sure of what changes have been made between 2.0.1 and 2.3, but maybe it'll help you out.
function beforeDrawAxisLabel( axis, label, icsc )
{
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
if (axis.getOrientation() == Orientation.VERTICAL_LITERAL)
{
temp = label.getCaption().getValue();
label.getCaption().setValue("$" + temp);
axis.setLabel(label);
}
}
kotamreddy
Hi Michael:
Thank you for the prompt response and script. Unfortunately, we are doing all the chart manipulation in the java code and cannot do any scripts. We are not only displaying the chart online but also saving it as an image to be sent to different file formats.
Thanks again.
- Srinivas
mwilliams
Srinivas,
Regardless of output format, you should still be able to embed the java script in your java code to do the formatting.
However, I did find an example of it done in java. Attached is a .java file with code showing how to format a chart's axis labels. Hopefully this'll help you get what you're looking for.
kotamreddy
Thank you, Michael. That worked like a charm. Now I am getting to know more about the framework.
Thanks again.
- Srinivas