Home
Analytics
Hide Value Series in a Pie Chart if their value is 0
work_ph
Hi I am designing a pie chart in BIRT 2.5 and I am trying to hide the value series with the value 0. However, the category series should all be seen in the legend.
Can anyone help me with that issue?
Thanks in advance!
Find more posts tagged with
Comments
mwilliams
Hi work_ph,
So, since the value is 0, the slice will not actually show, but the label for the slice still will. You're wanting to hide the label then, and allow the legend label to stay?
work_ph
Hi michael!
Exaclty! I want all the labels in the legend to stay although their values might be 0.
But I dont want the value label "0" in the graph as there is nothing to see anyway.
Do you have a solution?
Thanks for your effort!
mwilliams
work_ph,
If you put this code in your chart script, it should remove labels with values of '0'. Hope this helps.
function beforeDrawDataPointLabel( dph, label, icsc )
{
if (dph.getOrthogonalValue() == 0){
label.setVisible(false);
}
}
work_ph
hey mwilliams,
Thanks a lot! It worked fine!
Much appreciated
mwilliams
work_ph,
No problem, glad to help! Let us know whenever you have questions!
Arif shah
<p>Hi William,</p><p> </p><p>If I want the legend and value in graph both to disappear if their value is zero, how can I do that?</p><p> </p><p>Regards</p><p>Arif</p>