Make offsetGridLines consistent and add new offset scale option (#4545)

Add a new `offset` option to scales to add extra space at edges and remove the `includeOffset` argument from `getPixelForValue()` and `getPixelForTick()`. The bar controller now automatically calculates the bar width to avoid overlaps. When `offsetGridLines` is true, grid lines move to the left by one half of the tick interval, and labels don't move.
This commit is contained in:
Akihiko Kusanagi
2017-08-14 16:09:33 +08:00
committed by Simon Brunel
parent 7e6b46253d
commit 7dc71d009b
18 changed files with 415 additions and 119 deletions

View File

@@ -312,15 +312,6 @@ module.exports = function(Chart) {
}
}, me);
if (types.length > 1) {
for (var i = 1; i < types.length; i++) {
if (types[i] !== types[i - 1]) {
me.isCombo = true;
break;
}
}
}
return newControllers;
},