0
votes

I am showing custom tooltip with percent values in Angular NVD3 pie chart. plunker link

     `https://plnkr.co/edit/Tv544U?p=preview`

tooltip shows correct values in percent. But if I deselect any legend, chart is redrawn excluding that item. I want to recalculate percent values for the items which are displayed in chart. i.e. slice 'one' shows 16% and two shows 7% in beginning. If I click two in legend, slice 'two' will be gone and chart is redrawn. Still pie 'one' shows 16%. I want it to recalculate.

1

1 Answers

0
votes

I found a solution of my question above. There is a property 'showTooltipPercent' to display percent in tooltip in nvd3 pie chart. need to set this to true inside chart object for Angular NVD3. But this property only works for default tooltip.

I was using custom tooltip. After setting above property, I get percent value in event argument in my custom tooltip function. I utilized this value while showing percent value in tooltip instead of calculating percent manually.

plunker is updated.