-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip ticks by callback value as documented (#8914)
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module.exports = { | ||
description: 'https://github.com/chartjs/Chart.js/issues/8892', | ||
config: { | ||
type: 'line', | ||
data: { | ||
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], | ||
datasets: [ | ||
{ | ||
data: [12, 19, 3, 5, 2, 3], | ||
}, | ||
{ | ||
data: [7, 11, 5, 8, 3, 7], | ||
} | ||
] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
callback: function(val, index) { | ||
if (index === 1) { | ||
return undefined; | ||
} | ||
if (index === 3) { | ||
return null; | ||
} | ||
return this.getLabelForValue(val); | ||
} | ||
} | ||
}, | ||
y: { | ||
ticks: { | ||
callback: function(val, index) { | ||
return index % 2 === 0 ? '' + val : null; | ||
} | ||
} | ||
} | ||
}, | ||
} | ||
}, | ||
options: { | ||
spriteText: true | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.