Angular-Charts - Pie Chart,show labels inside each slice of data

Panchaxari Hiremath picture Panchaxari Hiremath · Jul 30, 2015 · Viewed 15.5k times · Source

I am learning stage of angular-chart-js. I am trying to use angular-chart.js to plot a pie chart. But I am unable to find a way for showing labels (not tooltips) on the pie chart, which describe each slice of data.

Here is how I did it:

Answer

potatopeelings picture potatopeelings · Jul 30, 2015

Adapted from https://stackoverflow.com/a/25913101/360067 for angular-chart

Add the following options to your scope

$scope.options = {
    tooltipEvents: [],
    showTooltips: true,
    tooltipCaretSize: 0,
    onAnimationComplete: function () {
        this.showTooltip(this.segments, true);
    },
};

And use that in your directive

<canvas id="pie33" options="options"...

Fiddle (with relevant sections from your code) - http://jsfiddle.net/zuhp8k5f/154/


enter image description here