RadCartesianChart: Reduce the number of markers without simplifying data

2 Answers 20 Views
ChartView
minh
Top achievements
Rank 2
Iron
Iron
Iron
minh asked on 24 May 2022, 02:26 AM | edited on 24 May 2022, 02:30 AM

Hi Telerikers,

I would like to reduce the number of makers (basically I would display the makers only in the first, last, max and min values) . However, I don't want to simplify the data because that make change on the shape of line.

Would you please help me a solution to modify the display of makers? 

Many thanks for your help

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 26 May 2022, 11:33 AM

Hello Minh,

There is no built-in support for this specific behavior, but you can easily achieve it by using custom style. You can use the DefaultVisualStyleSelector property of the associated chart series. The selector will be called for each data point in the series. In the SelectStyle method, you can check if the current data point is first, last, max or min and then return a Style for it. Otherwise, you can return null.

You can find an example showing the selector here: https://github.com/telerik/xaml-sdk/tree/master/ChartView/WPF/DefaultVisualStyleSelector

I hope that helps.

Regards,
Martin Ivanov
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.

0
minh
Top achievements
Rank 2
Iron
Iron
Iron
answered on 27 May 2022, 03:03 AM

Hi Martin,

It's always you the champion! Your solution works like a charm! Many thanks for your help.

However, I have another question (sorry, I have many questions :D): I would to do the same thing but this time in Telerik Reporting (Telerik reporing is using to print out the graphics in our system), would you have a solution for that? In fact, it seams that there is' no Style Selector in chart graphic in Telerik reporting. I'm currently using CartesianCoordinateSystem with LineSeries.

 

Many thanks for your help again.

P/S: Please advise me if I should raise my current question in Telerik Reporting in another post.

Martin Ivanov
Telerik team
commented on 27 May 2022, 11:47 AM

You are way too kind. I am glad to hear that the suggested resources helped.

About the Reporting chart, this feature is completely different than the chart control for WPF. This is why you won't find the same API there. What I would recommend you is to post your question in the Telerik Reporting forum

minh
Top achievements
Rank 2
Iron
Iron
Iron
commented on 30 May 2022, 02:06 AM

Hi Martin,

 

Many thanks for your advise.

 

Have a nice day,

Minh Tuan

Tags
ChartView
Asked by
minh
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin Ivanov
Telerik team
minh
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or