| Conditional Labels for Value (Y) series [message #635100] |
Mon, 25 October 2010 11:57  |
Garey Smiley Messages: 4 Registered: July 2009 |
Junior Member |
|
|
|
I'm trying to figure out how to have conditional labels for "Value (Y) series" in a Percent Stacked bar chart. I have lots of values in the bar and only want to label those items that are more than X percent.
|
|
|
|
|
|
|
|
| Re: Conditional Labels for Value (Y) series [message #955665 is a reply to message #955146] |
Tue, 23 October 2012 20:19   |
|
Did you try using the above code? Or if that inset was not enough, increasing the variance by a few. Like, use 12 instead of 8. In the image, it doesn't appear that you're using this code at all. If you want to hide the label if it's below a certain value, you can do this:
function beforeDrawDataPointLabel( dph, label, icsc )
{
if(dph.getOrthogonalValue() < minValueYouWantToShow){
label.setVisible(false);
}
}
Hope this helps.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
| Re: Conditional Labels for Value (Y) series [message #956180 is a reply to message #955665] |
Wed, 24 October 2012 05:53   |
Saurabh Puri Messages: 10 Registered: February 2012 |
Junior Member |
|
|
Hi,
I tried using the code but the problem is not solved even if i increase the variance.
Variance will make the values to shift more towards left but the overlap of labels for one stack still happens. Can i alternate the label bumps of the same stack??
Also, because my data values varies, can one compare some way the relative value (like percentages) to disable/enable label display.
function beforeDrawDataPointLabel( dph, label, icsc )
{
if(value<some_percent){
label.setVisible(false);
}
}
Thanks in Advance
Saurabh
[Updated on: Wed, 24 October 2012 05:59] Report message to a moderator
|
|
|
| Re: Conditional Labels for Value (Y) series [message #958123 is a reply to message #956180] |
Thu, 25 October 2012 15:32  |
|
The inset code is made to alternate which direction the label goes. The crcnt should alternate between 0 and 1, as you encounter each label. This is why one of the statements is currl - 8 and one is currl + 8.
As for the hiding a section of a bar based on its percentage of the stacked bar, you'd probably be dealing with a little bit more complicated script. The percentage value you can get from dph would be the percentage of a bar section across the optional grouping, which is spread across the different bars. It doesn't tell you the percentage of the current section of the stack it's in. That may just be my chart sample I'm working with though. The way I see it, you'd have to use the afterDataSetFilled script to figure out the total for each bar, then in the dataPointLabel script, you'd figure the percentage based on the bar's value. I could be wrong though. Hope this helps.
Regards,
Michael Williams
BIRT Exchange
Michael's BIRT Blog
|
|
|
Powered by
FUDForum. Page generated in 0.01805 seconds