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

How to serialize/deserialize RadCartesianChart?

1 Answer 59 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 06 Jun 2018, 02:50 PM

Is there a way to serialize/deserialize a RadCartesianChart instance? I saw methods to export to an image, but that is not what I want.

I have an application that creates/shows instances of RadCartesianChart. I want to render the same chart in a separate application and let users interact with it. Are there any other approaches that can be recommended to handle this problem?

 

Kind Regards,

Albert

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 11 Jun 2018, 12:26 PM
Hello Albert,

The chart doesn't have a built-in serialization mechanism. To achieve your requirement you can try the PersistenceFramework. It allows you to save the current state of the UI. However, keep in mind that the idea of the framework is to save only the UI, but not the data. To save the data I would recommend you to use a database reached via a web service which you can use to load it between the charts. Or you can store the data in a file that can be transferred between the computers. In any case this would require some custom code to be written.

Alternatively, you can write your own serialization mechanism. Or try the .NET built-it serialization mechanisms, but I wouldn't expect very good results with saving UI components like the chart.

You can check a sample saving/restoring data from a file implementation in most of the chartview demos. For example, you can see the Bubble example. Read how to get the demos in the Installing WPF demos article.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ChartView
Asked by
Albert
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or