SmartLabelsMode Range Minimum/Maximum Y axis values?

1 Answer 129 Views
ChartView
Daniel
Top achievements
Rank 1
Daniel asked on 24 Jun 2021, 08:22 AM

I'll attach an actual image from the ChartView for better understanding (TelerikChart5)

We have an Y-axes with SmartLabelsMode="SmartStepAndRange" and stacking active. As you can see in the image the highest column does not surpass the 30 Million mark and still the Smart Range is put at 40 Million.

The lowest column does not surpass  negative 5 Million and the smart range is still put at negative 10 Million.

Why is this and how can we get smart the smart range to work closer to our actual max/min values or should we calculate our min/max ourself and set them with a binding?

I'll also attach a second image with manually set Y-axes values to minimum -5 Million and maximum 30 Million to see that this would actually fit much better (TelerikChart6).

1 Answer, 1 is accepted

Sort by
1
Accepted
Martin Ivanov
Telerik team
answered on 28 Jun 2021, 10:31 AM

Hello Daniel,

The axis smart labels mode is not responsible for the axis' range calculations. Instead it just tries to calculate such step, so that no labels on the axis overlap one another. The high maximum (40.000.000) appears, because of the built-in auto-range calculations of the axis. Basically, when you plot data on the chart, the axis gets the minimum and maximum values and then extends the axis range based on an arbitrary percentage and several other factors.

To change this behavior and achieve your requirement, you can manually calculate the range and set the Minimum and/or Maximum properties of the axis.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ChartView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or