Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI Bar Chart Labels Rotation

I have a Kendo UI (Telerik) bar chart with long label names. When I set the label rotation to anything outside of 0,180,90,360 the labels slant but they use the center of the text as the slant point instead of the start of the text. This causes all the labels to be off by a full bar.

http://snag.gy/m2XxJ.jpg

Is there a way to get the chart to use the start of the label as the rotation point instead of the center?

like image 774
David McSpadden Avatar asked Jul 15 '14 00:07

David McSpadden


1 Answers

The only way I've gotten the labels to line up properly when using rotation, is to also set the padding.

Sample categoryAxis

categoryAxis: { field: 'name', labels: { rotation: -60, padding: { right: 10 }}}

JSbin sample http://jsbin.com/zoloc/1/edit

Kendo Documentation http://docs.telerik.com/kendo-ui/api/dataviz/chart#configuration-categoryAxis.labels.padding

like image 86
Robin Giltner Avatar answered Sep 18 '22 17:09

Robin Giltner