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)
dynamically control Chart label
edan
Can we control how and what is displayed in the chart label? For events such as MouseOver, we can raise an event and do what ever we want. This is not available for the Load event. How can we attach a script for the Load event? Is there another mechanism by which we can change the label on a chart?
My requirements are like:
Standards label: Data Column value with prefix etc.
My requirements: Label should be visible based on the data column value. Plus, I need use different Prefix based on the data column value.
Find more posts tagged with
Comments
johnw
You can do this. Take a look at this reply I gave someone:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/19734-display-total-on-stacked-bar-graph/'>http://www.birt-exchange.org/org/forum/index.php/topic/19734-display-total-on-stacked-bar-graph/</a><br
/>
<br />
In it, I am setting a Chart Axis label to the sum of two series in a stacked bar chart. The idea would apply to any chart label though.<br />
<br />
John<br />
<br />
<blockquote class='ipsBlockquote' data-author="'edan'" data-cid="65742" data-time="1276893745" data-date="18 June 2010 - 01:42 PM"><p>
Can we control how and what is displayed in the chart label? For events such as MouseOver, we can raise an event and do what ever we want. This is not available for the Load event. How can we attach a script for the Load event? Is there another mechanism by which we can change the label on a chart?<br />
<br />
My requirements are like:<br />
Standards label: Data Column value with prefix etc.<br />
My requirements: Label should be visible based on the data column value. Plus, I need use different Prefix based on the data column value.<br /></p></blockquote>
edan
Thanks. I am invoking the below script during the onRender event of the chart to take care of my requirements:
//To update label on the chart. Do not show label, if value is 0.
function beforeDrawDataPointLabel (dph, label, icsc)
{
var labelText = label.getCaption().getValue();
if (labelText == "0 days")
{
label.setVisible(false);
}
if (labelText.contains("LINE"))
{
label.setVisible(false);
}
}