SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0
0

hi,
does SciChart provides any mechanism to serialize a chart along with the data plotted?
My requirement is that I should be able to save the chart as a file and restore it back.

Please advise.

Thanks,
Vibin

Version
4.2
  • You must to post comments
0
0

Hi Vibin,

Sorry we’re not handling\supporting serialization of DataSerieses, what i can suggest you is:

  • extend the renderable series you need(or even whole sciChartSurface) and override there WriteXml() and ReadXml() methods

    public class SciChartSurfaceExt : SciChartSurface
    {
    public override void WriteXml(XmlWriter writer)
    {
    base.WriteXml(writer);

        var rSerieses = RenderableSeries;
    
        foreach (var rSeries in rSerieses)
        {
            var seria = (FastLineRenderableSeries) rSeries;
            if (seria != null)
            {
                var ds = seria.DataSeries as XyDataSeries<double, double>; ;
                if (ds != null)
                {
                    //do what you need;
                   // ds.XValues and ds.YValues 
                }
            }
        }
    }
    

    }

something like this, and here “//do what you need” you can try to serialize it by yourself and deserialization part also

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.