From: Evert Timberg Date: Thu, 28 Apr 2016 11:18:05 +0000 (-0400) Subject: Update sample for new meta system X-Git-Tag: 2.1.0~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f68545c288fc38ac5b1cd5a69c2903705ac4ff1b;p=thirdparty%2FChart.js.git Update sample for new meta system --- diff --git a/samples/data_label_combo-bar-line.html b/samples/data_label_combo-bar-line.html index bb49cfcd4..a5e1e8d37 100644 --- a/samples/data_label_combo-bar-line.html +++ b/samples/data_label_combo-bar-line.html @@ -65,14 +65,16 @@ }, animation: { onComplete: function () { - var ctx = this.chart.ctx; + var chartInstance = this.chart; + var ctx = chartInstance.ctx; ctx.textAlign = "center"; - Chart.helpers.each(this.data.datasets.forEach(function (dataset) { - Chart.helpers.each(dataset.metaData.forEach(function (bar, index) { + Chart.helpers.each(this.data.datasets.forEach(function (dataset, i) { + var meta = chartInstance.controller.getDatasetMeta(i); + Chart.helpers.each(meta.data.forEach(function (bar, index) { ctx.fillText(dataset.data[index], bar._model.x, bar._model.y - 10); - }),this) - }),this); + }),this) + }),this); } } }