-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
Expected behavior
By default when creating radar chart the tick's zero value is not displayed.
However when the scale's min value is changed it's shown again. When user set a tick's callback, the zero should be handled and displayed just like any other value.
r: {
min: -0.3,
max: 1,
ticks: {
autoSkip: false,
stepSize: 0.1,
// callback to display only few values
callback: function (value) {
if (value === 0.9) return "very strong";
if (value === 0.7) return "strong";
if (value === 0.4) return "moderate";
if (value === 0.2) return "weak";
if (value === 0) return "no"; // this should be displayed just like any other value
},
},
},
Current behavior
When tick's callback is set the zero value will not be shown. The only possible (and dirty) workaround is to return all the values like so:
callback: function (value) {
if (value === 0.9) return "very strong";
if (value === 0.7) return "strong";
if (value === 0.4) return "moderate";
if (value === 0.2) return "weak";
if (value === 0) return "no";
return ""; // dirty workaround showing all the values
},
Reproducible sample
https://codepen.io/kowal66b/pen/vYvJryv
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
I want show only limited amount of ticks with zero value as well
chart.js version
4.4.0
Browser name and version
No response