mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 04:39:06 +02:00
Hide labels when the user returns null from the userCallback. This is the same as the category scale
This commit is contained in:
parent
c1f0a39982
commit
eb657bce36
@ -453,6 +453,11 @@
|
|||||||
// Grid lines are vertical
|
// Grid lines are vertical
|
||||||
var xValue = this.getPixelForValue(tick);
|
var xValue = this.getPixelForValue(tick);
|
||||||
|
|
||||||
|
if (this.labels[index] === null) {
|
||||||
|
// If the user specifically hid the label by returning null from the label function, do so
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (tick === 0 || (!hasZero && index === 0)) {
|
if (tick === 0 || (!hasZero && index === 0)) {
|
||||||
// Draw the 0 point specially or the left if there is no 0
|
// Draw the 0 point specially or the left if there is no 0
|
||||||
this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
|
this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
|
||||||
|
Loading…
Reference in New Issue
Block a user