You can achieve the desired by manually defining the value axis majorUnit, min, and max. Then force the Chart to generate ticks that include 25, 50, and 75 by explicitly setting the axis scale in the labels.visual function and change the label text:
valueAxis: {
min: 0, // Minimum value on the value axismax: 100, // Maximum value on the value axismajorUnit: 25, // Axis ticks will appear at every 25 units: 0, 25, 50, 75, 100labels: {
visual: function (e) {
var targets = [25, 50, 75, 100]; // Values at which we want to show custom labelsvar tolerance = 0.01; // Tolerance to account for floating-point precision// Loop through each target valuefor (var i = 0; i < targets.length; i++) {
// Check if current label value is close to any of the target valuesif (Math.abs(e.value - targets[i]) < tolerance) {
// Customize label for value 25if (e.text == 25) {
returnnew kendo.drawing.Text("Limited", e.rect.origin, {
fill: { color: "black" },
font: "12px Arial"
});
}
// Customize label for value 50if (e.text == 50) {
returnnew kendo.drawing.Text("Fair", e.rect.origin, {
fill: { color: "black" },
font: "12px Arial"
});
}
// Customize label for value 75if (e.text == 75) {
returnnew kendo.drawing.Text("Good", e.rect.origin, {
fill: { color: "black" },
font: "12px Arial"
});
}
// Customize label for value 100if (e.text == 100) {
returnnew kendo.drawing.Text("Excelent", e.rect.origin, {
fill: { color: "black" },
font: "12px Arial"
});
}
}
}
returnnull; // Skip rendering labels for all other values
}
}
}