Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Dec 14, 2018
1 parent f2a9e66 commit e8f4ddf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/controllers/controller.bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ module.exports = DatasetController.extend({
var scale = me.getValueScale();
var isHorizontal = scale.isHorizontal();
var datasets = chart.data.datasets;
var value = scale.getRightValue(datasets[datasetIndex].data[index]);
var value = +scale.getRightValue(datasets[datasetIndex].data[index]);
var minBarLength = scale.options.minBarLength;
var stacked = scale.options.stacked;
var stack = meta.stack;
Expand All @@ -327,9 +327,11 @@ module.exports = DatasetController.extend({
imeta.controller.getValueScaleId() === scale.id &&
chart.isDatasetVisible(i)) {

ivalue = scale.getRightValue(datasets[i].data[index]);
ivalue = +scale.getRightValue(datasets[i].data[index]);
if ((value < 0 && ivalue < 0) || (value >= 0 && ivalue > 0)) {
start += ivalue;
} else if (minBarLength && value === 0 && ivalue === 0) {
start = scale.getValueForPixel(scale.getPixelForValue(start) + minBarLength);
}
}
}
Expand Down

0 comments on commit e8f4ddf

Please sign in to comment.