|
Re: Conditional Labels for Value (Y) series [message #635123 is a reply to message #635100] |
Mon, 25 October 2010 16:55 |
|
Add a beforeDrawDataPoint script like:
function beforeDrawDataPointLabel( dph, label, icsc )
{
if( dph.getPercentileOrthogonalValue() < 0.25 ){
label.setVisible(false);
}else{
label.setVisible(true);
}
}
0.25 is 25% on the label.
Jason
On 10/25/2010 11:57 AM, Garey Smiley wrote:
> 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 #947390 is a reply to message #946577] |
Wed, 17 October 2012 03:40 |
|
You could always bump the labels to the left or right. You could even alternate the bump.
crcnt=0;
function beforeDrawDataPointLabel( dph, label, icsc )
{
if( crcnt == 0 ){
currl = label.getInsets().getLeft();
label.getInsets().setLeft(currl-8);
}
if( crcnt == 1 ){
currl = label.getInsets().getLeft();
label.getInsets().setLeft(currl+8);
}
crcnt++;
if(crcnt > 1 )crcnt=0;
}
Jason
|
|
|
|
Re: Conditional Labels for Value (Y) series [message #955665 is a reply to message #955146] |
Wed, 24 October 2012 00: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.
Michael
Developer Evangelist, Silanis
|
|
|
Re: Conditional Labels for Value (Y) series [message #956180 is a reply to message #955665] |
Wed, 24 October 2012 09: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 09:59] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03411 seconds