Dynamic rotation of x-axis labels

I know I can rotate x-axis labels by setting a custom css for <webix_axis_item_x> but I’d like this to be dynamic, i.e. only when needed. It’s needed only if at least one label’s width exceeds the x-axis’s total width divided by the number of x-axis labels shown. Other than scanning the underlying data itself, is there an elegant way (API method or runtime property) to get this data from the chart component?

Axis template can be defined as a function. So, you can apply calculation for text width, for example getTextSize helper

hi maria, what is the recommended way to query the count of x-axis labels that will be drawn on the chart x-axis (i.e the number of distinct values in the groupBy field)?

Hi,

Is your question about PivotChart ? Do you want to get this count in a label template ?