mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Merge pull request #2475 from chartjs/fix/2471
Fix time scale grid lines
This commit is contained in:
commit
f3363e1d3a
@ -307,6 +307,7 @@ module.exports = function(Chart) {
|
||||
}
|
||||
},
|
||||
convertTicksToLabels: function() {
|
||||
this.tickMoments = this.ticks;
|
||||
this.ticks = this.ticks.map(this.tickFormatFunction, this);
|
||||
},
|
||||
getPixelForValue: function(value, index, datasetIndex, includeOffset) {
|
||||
@ -332,6 +333,9 @@ module.exports = function(Chart) {
|
||||
}
|
||||
}
|
||||
},
|
||||
getPixelForTick: function(index, includeOffset) {
|
||||
return this.getPixelForValue(this.tickMoments[index], null, null, includeOffset);
|
||||
},
|
||||
getValueForPixel: function(pixel) {
|
||||
var innerDimension = this.isHorizontal() ? this.width - (this.paddingLeft + this.paddingRight) : this.height - (this.paddingTop + this.paddingBottom);
|
||||
var offset = (pixel - (this.isHorizontal() ? this.left + this.paddingLeft : this.top + this.paddingTop)) / innerDimension;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user