I have a chart where data on the X axis is Time based, and on the Y axis is speed based, what is the best way of being able to scale the Speed (Y Axis) to show different units eg kmh, mph, m/s.
Is there a Y axis data scaling property I could set?
Cheers
Toby
1 Answer, 1 is accepted
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Aug 2023, 09:58 AM
Hi, Toby,
RadChartView provides a convenient way to format the axis' labels according to any custom requirements. The following help article demonstrates a sample approach how to do it with a format provider:
I have tried it out but this solution gives me very ugly values for the axis. For example my Y Axis data is in m/s, to convert to kmh I multiply by 3.6 in the custom format provider. So a value of 2 m/s now shows 7.2 kmh, a value of 4 m/s is now shown as 14.4 kmh. It would be much better to re-render the chart such that the Y Axis has grid lines of, for example, 5 kmh/ 10 kmh etc with labels to suit.
I presume the only slution would be to save the data in my form containing the chart and when changing data units, delete the chart series,recalcluate and then re-add them...
Could I request that an ordinal linear series )or other object) have a scaling value, which defaults to 0 but can be modified to perform this functionality?
If the values are numeric, a LinearAxis is expected to be created by default and the respective values are shown with the specified MajorStep. Any conversion of the values like m/s to km/s should be done either in advance before populating the chart with data or use the previously mentioned format provider.