This is a migrated thread and some comments may be shown as answers.

RadChart feedback and help needed

1 Answer 40 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Andre asked on 09 May 2011, 10:21 PM
Hi Telerikers,

We're evaluating RadChart for quite some time and we got some issues I would like to share.
Our application has very complicated requirements and I will try to explain them.

1 - The user can add and remove series at runtime, mixing bar and line charts.
I created a dependency property of SeriesMapping, a data template selector for it and problem solved.

2 - The chart adds additional axisY automatically according to the unit of the dataseries. Ex: AxisY1 for kWh and a new AxisY when the user adds a temperature dataseries.
I created a dependency property of AxisY, a data template for it and problem solved.

3 - The AxisX is always DateTime and the user can mix 5, 10, 15 minutes, hourly, daily and monthly dataseries.
When using XValue, the AxisX shows wrong values for dates. Ex: 1/1/2011 10:07 for a 5 minute interval dataseries. The correct datetime should be 10:05 or 10:10 and not a non existent value.
Another problem is RadChart doesn't support monthly dataseries with XValue.

I fixed that using XCategory instead of XValue, but than I got two problems:

P3.1 - If the user first chooses a 10min interval dataserie and after that a 5min interval one, the chart gets all messed up.
That happens because the AxisX is using categories (strings) and it doesn't know that the values have an order. Ex:
- 10min serie: 10, 20 , 30...
- 5min serie: 5, 10, 15...
- Final AxisX: 10, 20, 30, 5, 15 (the last two values, since they don't exist in the beginning, are added in the end

I have fixed that creating a mechanism that creates an invisible dataserie (an ordered combination of all binded dataseries) that is always binded as the first one (internally, the user can't see that). Problem solved (although some performance penalty).

P3.2 - The AxisX breaks if you have too many values when using categories.
The sampling doesn't work for XCategories, so when I have too many values, it shows only the first date.

We solved that creating our own sampling mechanism that can deal with XCategories without any problem.
The problem is the only place I could hook the sampling method was the "OnDataBound" and I believe this event happens too late.

The sampling works fine (also with zoom) and I can plot charts with hundreds of thousands of datapoints. The downside is a really bad performance. Probably because the chart is doing a lot of calculations before getting to the OnDataBound method so maybe that's the wrong approach.

I thought about sampling the data before binding it to the chart, but then I'd lose the zoom feature, very important for us.

So how to solve that?

And last, I've noted some behaviors like:
- when you add/remove an item or bind/rebind the ItemsSource, all chart is rebound.
- when you add/remove an item or bind/rebind the SeriesMappings, all chart is rebound.
- so adding N series causes N! bindings and recalculations!
Is that really necessary? I mean, some calculation is need to accommodate new changes, but is seems  the method "rebind()" is being overused and causing unnecessary processing.
- also, all chart calculations are done in the UI thread, causing the whole application to "freeze" while the chart is adding new series. Maybe a background thread for the hard work could help a bit.

Thank you for your time and any help is highly appreciated,

André Carlucci

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 12 May 2011, 04:00 PM
Hello Andre,

1. We are aware of the approach you mentioned and we published your source code as Code Library so that it is now public for everyone who wants to see it.

2. I'm glad that you fulfilled your requirement on your own.

As to your problem 3.1: you can use our Sorting feature which sorts the data and displays it either in ascending or descending order.

3.2: Unfortunately you are right about the Sampling feature used together with the XCategory -- when sampling is enforced, certain information is lost (individual values of YValue, XCategory, etc) as several datapoints are aggregated into one. And while RadChart allows you to choose how the YValue of the resulting datapoint is calculated, it is not possible to provide the same functionality for XCategory as each category is individual and meaningful (the control cannot guess what is the average between let's say "Apples" and "Bananas").
Instead of creating custom Sampling feature, why don't you just disable the sampling mechanism by setting SamplingThreshold property to 0?

If you insist on having your own sampling mechanism then have you seen our Performance tips and tricks article in the online documentation? How does these tips and tricks work for your scenario?

As for the behaviors you mentioned - even though many of them are known to us, I forwarded your post to our developers so that they will consider it for our future releases. Thank you for the feedback.

All the best,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question