I'm currently loading 4 bar charts on the page, but they don't line up perfectly due to categoryAxis (Y Axis) labels are different length. How do I control the categoryAxis width so the charts will all line up? I've attached a screenshot to show what I mean.
Aaron
1 Answer, 1 is accepted
0
Iliana Dyankova
Telerik team
answered on 14 Dec 2013, 01:36 PM
Hello Aaron,
I am afraid what you would like to achieve is not supported - there is no a built-in option for setting categoryAxis.labels width. As a possible workaround I can suggest using categoryAxis.labels.template and trim the labels after specific width:
$("#chart").kendoChart({
//....
categoryAxis: {
//....
labels: {
template: "#= shortLabels(value)#"
}
}
});
function shortLabels(value) {
if (value.length > 3) {
value = value.substring(0, 5);
return value;
}
}
Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!