diff --git a/src/_charts/chart.bar.js b/src/_charts/chart.bar.js index 9154fb544..24d2abb2b 100644 --- a/src/_charts/chart.bar.js +++ b/src/_charts/chart.bar.js @@ -5,7 +5,8 @@ Chart = root.Chart, helpers = Chart.helpers; - var defaultConfig = { + + Chart.defaults.bar = { hover: { mode: "label" }, @@ -27,49 +28,48 @@ }, }; + // Chart.Type.extend({ + // name: "Bar", + // defaults: defaultConfig, + // initialize: function() { + // this.elementController = new Chart.RectangularElementController(this); + // this.canvasController = new Chart.RectangularCanvasController(this, this.elementController); - Chart.Type.extend({ - name: "Bar", - defaults: defaultConfig, - initialize: function() { - this.elementController = new Chart.RectangularElementController(this); - this.canvasController = new Chart.RectangularCanvasController(this, this.elementController); + // //Create a new bar for each piece of data + // helpers.each(this.data.datasets, function(dataset, datasetIndex) { + // helpers.each(dataset.data, function(dataPoint, index) { + // this.elementController.addRectangle(dataset, datasetIndex, index); + // }, this); - //Create a new bar for each piece of data - helpers.each(this.data.datasets, function(dataset, datasetIndex) { - helpers.each(dataset.data, function(dataPoint, index) { - this.elementController.addRectangle(dataset, datasetIndex, index); - }, this); + // // The bar chart only supports a single x axis because the x axis is always a category axis + // dataset.xAxisID = this.options.scales.xAxes[0].id; - // The bar chart only supports a single x axis because the x axis is always a category axis - dataset.xAxisID = this.options.scales.xAxes[0].id; + // if (!dataset.yAxisID) { + // dataset.yAxisID = this.options.scales.yAxes[0].id; + // } + // }, this); - if (!dataset.yAxisID) { - dataset.yAxisID = this.options.scales.yAxes[0].id; - } - }, this); + // this.canvasController.initialize(); + // }, + // draw: function(ease) { - this.canvasController.initialize(); - }, - draw: function(ease) { + // var easingDecimal = ease || 1; + // this.clear(); - var easingDecimal = ease || 1; - this.clear(); + // // Draw all the scales + // helpers.each(this.scales, function(scale) { + // scale.draw(this.chartArea); + // }, this); - // Draw all the scales - helpers.each(this.scales, function(scale) { - scale.draw(this.chartArea); - }, this); + // //Draw all the bars for each dataset + // this.eachElement(function(bar, index, datasetIndex) { + // bar.transition(easingDecimal).draw(); + // }, this); - //Draw all the bars for each dataset - this.eachElement(function(bar, index, datasetIndex) { - bar.transition(easingDecimal).draw(); - }, this); - - // Finally draw the tooltip - this.tooltip.transition(easingDecimal).draw(); - }, - }); + // // Finally draw the tooltip + // this.tooltip.transition(easingDecimal).draw(); + // }, + // }); }).call(this);