RadChartView - Y Axis Data Scaling

1 Answer 90 Views
ChartView
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Toby asked on 28 Jul 2023, 10:36 AM

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

Sort by
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:

https://docs.telerik.com/devtools/winforms/controls/chartview/customization/custom-labels-text 

I believe that it would be a perfect fit for the scenario you need to cover. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Toby
Top achievements
Rank 3
Iron
Iron
Iron
commented on 01 Aug 2023, 12:47 PM

Thank you for your suggestion.

 

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?

Dess | Tech Support Engineer, Principal
Telerik team
commented on 04 Aug 2023, 07:25 AM

Hi, Toby,

RadChartView can show grid lines. It is just necessary to set the ShowGrid property to true: https://docs.telerik.com/devtools/winforms/controls/chartview/features/chart-grid 

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. 

Tags
ChartView
Asked by
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or