]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update check to new system + fix tests 1788/head
authorEvert Timberg <evert.timberg@gmail.com>
Thu, 17 Dec 2015 14:31:01 +0000 (09:31 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Thu, 17 Dec 2015 14:31:01 +0000 (09:31 -0500)
src/controllers/controller.bar.js
test/controller.bar.tests.js

index da09ddf3f47eeb81d391229796a13129c32f0a52..72e1fb9b70da47b1b9de4d878888f9fdab1494fe 100644 (file)
                        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;
                                }
                        }
index f01d9a301828b4f65b761158efde1710146353af..97d39f71e0f430fb77d25cdbbfbfc7fcbf0fdbc6 100644 (file)
@@ -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'