7 Answers, 1 is accepted
Hi Kevin,
Thank you for using RadControls foe Windows 8!
The RadChart control provides functionality for using dynamic series. You can first take a look at these articles from our online documentation:
- How to Generate a Dynamic Series Using a Collection of Collections
- How to Generate a Dynamic Seires Using a Collection of ViewModels
I have also attached a runnable sample application that demonstrates how you can add series dynamically to the chart using MVVM. The Source property of the ChartSeriesProvider can be bound to a property from the view model that holds the collection of collections/view models.
Please, do not hesitate to contact us if you have further questions.
Regards,Rositsa Topchiyska
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I was not sure if I should post this as a separate question, but it builds on this one.
My question: Is it also possible to databind multiple axes this way? My chart is created purely with databinding, having a DateTimeContinuousAxis for X and separate Y-axes for separate series.
Regards,
Erik
Thank you for the question.
Unfortunately, the RadCartesianChart control does not provide functionality to add axes similarly to the way you add dynamic series. Multiple axes can be added only by static series.
Let us know if you have other questions.
Regards,
Rositsa Topchiyska
Telerik
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).
Ok. Is it possible to use dynamic series, and add the axes from code-behind afterwards? Or is it not possible at all to use multiple axes with dynamic data?
Regards,
Erik
I have prepared a sample project that demonstrates how you can add axes to the chart dynamically with the series. You have to implement your own series descriptor that in your case inherits from the CategoricalSeriesDescriptor and override its the CreateInstanceCore() method to set the VerticalAxis property of the concrete chart series.
I hope this is useful. Please, let us know if you have further questions.
Regards,
Rositsa Topchiyska
Telerik
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).
Thanks, that was a smooth solution! However, when I zoom in the chart, the vertical-axis values dissapear, only the title i set is shown. Can I hook into an event and force redraw somehow?
FYI: I ran into problems when adding the CustomChartSeriesDescriptor-class to my class-library-project, and found a solution here: http://www.telerik.com/forums/could-not-load-assembly-telerik-windows-controls-navigation#JTG1FF9iYkKdhuPNP4K-cQ from WPF-component from 2009.
I guess it relates to my problem with PRISM here: http://www.telerik.com/forums/permalink/U4iMyMKScEeRVk33oDmTiQ
I appreciate your support, thanks!
Regards,
Erik
Thank you for contacting us.
The chart is forced to update its layout with the RadCartesianChart.InvalidateUI() method, but I do not think this will solve the problem. In the attached project from my previous answer the axes work as expected when zooming an panning. Could you please modify the project in order to reproduce the issue.
I look forward to your reply.
Regards,
Rositsa Topchiyska
Telerik
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).