From 283f1d73872254a987d9a7f78aa0697588056312 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Thu, 17 Dec 2015 09:31:01 -0500 Subject: [PATCH] Update check to new system + fix tests --- src/controllers/controller.bar.js | 3 +-- test/controller.bar.tests.js | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) 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' -- 2.47.2