Chart js legend template

👍:0

You can access the data from the chart elements collection. For example, for a pie chart you could do

myPieChart.segments.forEach(function (segment) {
    console.log(segment.value)
})

Likewise each chart type has a collection. Look for the update() method under the Prototype methods section for the chart type in http://www.chartjs.org/docs

Leave a comment