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.

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.

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:

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.

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.