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)
Chart axis label dynamic change
sendu
Hi,<br />
<br />
I have to create a chart like I attached(Please note that the revenue mentioned are revenue1,revenue2 like wise). As I know, I can't have two x axis in birt so I am tring to append the 'operator1', 'operator2' to all the respective years.<br />
I can be able to change the label with a same string. how can I identify the label which i have to change (the problem is i have two 2009, two 2010 like) ?<br />
<br />
This is the code I tried :<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>function beforeDrawAxisLabel( axis, label, icsc ){
importPackage(Packages.java.lang);
importPackage(Packages.java.util);
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
if (axis.getType() == AxisType.TEXT_LITERAL){
var oldlbl = label.getCaption().getValue();
label.getCaption().setValue(oldlbl+'\n2009');
axis.setLabel(label);
}
}</pre>
<br />
need your Help <br />
Senduran
Find more posts tagged with
Comments
sendu
Hi,
Still I couldn't find a solution for this !
Anybody please suggest me a way to achieve this
Is there an api or recommended documentation for BIRT script functions (event functions) ?
thank u
mwilliams
I'm not sure that this is possible. This is similar to optional grouping, but I just don't know that you'll be able to get it like this. I could be wrong though. The way I've seen this is how you said in your first post. The adding it to the x-axis field. You could always file an enhancement request for the layout to work this way.