From: Evert Timberg Date: Thu, 17 Dec 2015 14:31:01 +0000 (-0500) Subject: Update check to new system + fix tests X-Git-Tag: 2.0.0-beta2~18^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F1788%2Fhead;p=thirdparty%2FChart.js.git Update check to new system + fix tests --- diff --git a/src/controllers/controller.bar.js b/src/controllers/controller.bar.js index da09ddf3f..72e1fb9b7 100644 --- a/src/controllers/controller.bar.js +++ b/src/controllers/controller.bar.js @@ -217,8 +217,7 @@ var barIndex = 0; for (var j = 0; j < datasetIndex; ++j) { - if (helpers.isDatasetVisible(this.chart.data.datasets[j]) && - (this.chart.data.datasets[j].type === 'bar' || (this.chart.data.datasets[j].type === undefined && this.chart.config.type === 'bar'))) { + if (helpers.isDatasetVisible(this.chart.data.datasets[j]) && this.chart.data.datasets[j].bar) { ++barIndex; } } diff --git a/test/controller.bar.tests.js b/test/controller.bar.tests.js index f01d9a301..97d39f71e 100644 --- a/test/controller.bar.tests.js +++ b/test/controller.bar.tests.js @@ -52,11 +52,10 @@ describe('Bar controller tests', function() { var chart = { data: { datasets: [{ - type: 'line' }, { - type: 'bar' + bar: true }, { - // no type, defaults to bar + bar: true }] }, config: { @@ -82,13 +81,13 @@ describe('Bar controller tests', function() { var chart = { data: { datasets: [{ - + bar: true, }, { + bar: true, hidden: true }, { - type: 'line' }, { - + bar: true, }] }, config: { @@ -148,7 +147,8 @@ describe('Bar controller tests', function() { data: [1, 2], label: 'dataset1', xAxisID: 'firstXScaleID', - yAxisID: 'firstYScaleID' + yAxisID: 'firstYScaleID', + bar: true }, { data: [10, 15, 0, -4], label: 'dataset2'