Dear team,
Please have a look at the y-axis of the screenshot attached.
Do we have an option to correct it and show some round figure values instead of decimals
7 Answers, 1 is accepted
Thank you for contacting us.
To show round numbers on the axis you should set its major tick interval. Consider the code below:
yAxis.majorTickInterval = @3;
I hope this helps.
Regards,
Adrian
Telerik
when i use this piece of code it is showing below error:
Value of type TKChartAxis has no member 'majorTickInterval'
screenshot attached
Hello, Megharaj,
TKChartAxis is the base class for all axes in TKChart. You should cast your axis to TKChartNumericAxis and the set its majorTickInterval property. Consider the code:
(yAxis as! TKChartNumericAxis).majorTickInterval = 3
Regards, Adrian
Telerik
actually my issue was that it was showing decimal point values on the y axis;
this answer didnt solve the purpose.
if i use minimumtickinterval / maximum tickinterval it will not stop showing the decimal values on the yaxis.
if i use mintickinterval of 3 it can show 4.5 on y axis.
i am lookin for right answer ASAP. its been so long since in raise this issue with screenshot
You need to set majorTickInterval not minimum nor maximum interval. Major tick interval in numeric axis is calculated starting from the minimum value of the axis. If you have a numeric axis and its minimum value is not a decimal and the majortTickInterval is also a whole number then you shouldn't see decimal labels unless you zoom the axis. Since I am not able to reproduce this issue here, may be there is something specific in your project. Could you prepare a sample project that can be compiled and where this can be reproduced so I can investigate it further.
Regards,
Adrian
Telerik
This is not a side effect, this is the expected behavior. When you have an axis with range 300 and you set major tick interval of 3 you will get 100 labels. Your first screenshot shows an axis with range 12 that is why in my response I suggested to use major tick interval of 3, however you can set a different value for axes that have different range.
Regards,
Adrian
Telerik