Fix horizontalBar deprecation warnings (#6603)

Fix horizontalBar deprecation warnings
This commit is contained in:
Ben McCann 2019-10-26 09:48:48 -07:00 committed by Evert Timberg
parent ea100d400e
commit 21da5be3c6
2 changed files with 12 additions and 5 deletions

View File

@ -18,8 +18,6 @@ defaults._set('horizontalBar', {
yAxes: [{
type: 'category',
position: 'left',
categoryPercentage: 0.8,
barPercentage: 0.9,
offset: true,
gridLines: {
offsetGridLines: true
@ -39,6 +37,15 @@ defaults._set('horizontalBar', {
}
});
defaults._set('global', {
datasets: {
horizontalBar: {
categoryPercentage: 0.8,
barPercentage: 0.9
}
}
});
module.exports = BarController.extend({
/**
* @private
@ -54,4 +61,3 @@ module.exports = BarController.extend({
return this.getMeta().yAxisID;
}
});

View File

@ -1593,8 +1593,9 @@ describe('Chart.controllers.bar', function() {
var meta = chart.getDatasetMeta(0);
var yScale = chart.scales[meta.yAxisID];
var categoryPercentage = yScale.options.categoryPercentage;
var barPercentage = yScale.options.barPercentage;
var config = meta.controller._config;
var categoryPercentage = config.categoryPercentage;
var barPercentage = config.barPercentage;
var stacked = yScale.options.stacked;
var totalBarHeight = 0;