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
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