Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Use scripting to modify chart title and legend
anir
Hi,
I have a chart which I am building from a data cube. This data cube has one group (dimension having sub-dimensions) as year->quarter->month. Now when I place the month in the category axis of the chart, it comes as digits in the chart axis display. I am trying to print this month along with the year in the chart axis as Dec_2008, Jan_2009 etc. And I am unable to do this.
My dimension is created from a Date filed (basically splitting it to get year, quarter and month information as subgroups).
If this sounds confusing, please leave a comment, and I will try to make the problem statment better.
I am using birt 2.5.1.
Thanks,
Find more posts tagged with
Comments
JasonW
Can you not use a script similar to this:
function beforeDrawAxisLabel( axis, label, context )
{
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
//LINEAR_LITERAL
//LOGARITHMIC_LITERAL
//TEXT_LITERAL
//DATE_TIME_LITERAL
if (axis.getType() == AxisType.TEXT_LITERAL)
{
value = label.getCaption().getValue();
if( value == 1 ){
label.getCaption().setValue("January");
}....
}
}
Jason
Vegas
Have you tried to work on the date formats?
Put an example so we could see the problem and try to find the solution.