Save the flexchart data in a text file to be able to reload when it is reopened

Posted by: info on 7 May 2018, 3:53 am EST

    • Post Options:
    • Link

    Posted 7 May 2018, 3:53 am EST

    How do you save the data contained in a flexchart, including annotations in a file so you can reload it when you reopen it?

  • Posted 10 May 2018, 1:49 am EST

    Hello,

    This can be done using serialization/deserialization of FlexChart and AnnotationLayer objects. Attached is a sample for your reference. It uses the C1.Win.Chart.Serialization library to serialize the objects to an xml file and then reload from the same file using deserialization. Please let us know if this helps.

    Regards,

    Ankit

    FlexChartSerializationDemo.zip

  • Posted 12 June 2018, 3:18 pm EST

    I had a look for C1.Win.Chart.Serialization library in the documentation but could not find it. is this library part of the WinForms Package?

  • Posted 13 June 2018, 2:13 am EST

    The serialization library was made available as part of the ‘FlexChartSerializer’ sample and hence you won’t be finding it in the documentation. You can find the same alongwith the installed samples at:

    “C:\Users[userName]\Documents\ComponentOne Samples\WinForms\C1FlexChart\CS\FlexChartSerializer”

    Regards,

    Ankit

  • Posted 13 June 2018, 9:32 am EST

    Thanks Just to confirm is this the way to go to duplicate the C1Chart SaveChartToString/LoadChartFromString functionality for a WinForms FlexChart.

  • Posted 14 June 2018, 4:42 am EST

    Hello,

    Yes! Using C1FlexChart, if you wish to save it to a file, this is the way to approach. In addition to saving charts in typical format *.xml, this approach also provides various other formats, for which, you are suggested to refer FlexChartSerializer product sample.

    Let us know if you have any further doubts.

    Thanks,

    Ruchir

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels