chartjs-plugin-doughnutlabel
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -106,3 +106,3 @@ (function (global, factory) { | ||
options.labels.forEach(function(label) { | ||
var text = typeof(label.text) === 'function' ? label.text() : label.text; | ||
var text = typeof(label.text) === 'function' ? label.text(chart) : label.text; | ||
var innerLabel = { | ||
@@ -109,0 +109,0 @@ text: text, |
{ | ||
"name": "chartjs-plugin-doughnutlabel", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Chart.js plugin for doughnut chart to display lines of text in the center", | ||
@@ -5,0 +5,0 @@ "main": "dist/chartjs-plugin-doughnutlabel.js", |
@@ -65,3 +65,3 @@ # Chart.js Doughnut plugin to allow for lines of text in the middle | ||
var getTotal = function() { | ||
var getTotal = function(myDoughnutChart) { | ||
var sum = myDoughnutChart.config.data.datasets[0].data.reduce((a, b) => a + b, 0); | ||
@@ -68,0 +68,0 @@ return `Total: ${sum}`; |
@@ -15,4 +15,4 @@ 'use strict'; | ||
var getTotal = function() { | ||
var sum = myChart3.config.data.datasets[0].data.reduce((a, b) => a + b, 0); | ||
var getTotal = function(myChart) { | ||
var sum = myChart.config.data.datasets[0].data.reduce((a, b) => a + b, 0); | ||
return `Total: ${sum}`; | ||
@@ -19,0 +19,0 @@ } |
@@ -18,3 +18,3 @@ 'use strict'; | ||
options.labels.forEach(function(label) { | ||
var text = typeof(label.text) === 'function' ? label.text() : label.text; | ||
var text = typeof(label.text) === 'function' ? label.text(chart) : label.text; | ||
var innerLabel = { | ||
@@ -21,0 +21,0 @@ text: text, |
Sorry, the diff of this file is not supported yet
60159