Profile Picture

Chart Serialization - what does it do?

Posted By Pedram . 12 Years Ago
Author
Message
Pedram .
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 7, Visits: 1
I was able to resolve the issue.

you must do a ChartControl.Refresh() before saving the file if you are making any changes right before the save.

Pedram .
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 7, Visits: 1
Has this been updated yet?

If not could you please explain or give a brief example how to exclude the NDoubleDataSeriesXmlSurrogate.

because the below code did erase the data, but doesn't actually remove the points.
When saving, the file is still relatively large (20mb) and takes a long time to load again.
I want to remove the data from each series, but not the actual Series as they exist on the chart.

*****
foreach (NSeries Series in Chart.Series)
{
SaveSeries.Add((NSeries)Series.Clone());
Series.ClearDataPoints();
}

ChartControl.Serializer.SaveControlStateToFile(FileName, PersistencyFormat.Binary, new NDataSerializationFilter());
******

Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Pedram,

This behaves the same as with whole chart serialization - when you save the Appearance you loose the data. When you modify the second chart data you'll notice that it appears with the appearance settings of the first chart, so it is working as intended. BTW in newer versions of the control you can specifiy the apperance as stylesheet which is applied on a document.



Best Regards,
Nevron Support Team



Pedram .
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 7, Visits: 1
Further reading shows that what I am trying to serialize is in fact the specific chart in the next example Chart Objects.


However in this example when loading Appearance from the first chart, causes the whole second chart to go blank, and the new appearance only applies to new data. I'm not sure if this is a bug or as intended. Should not the data be manipulated (or deleted) in this case?

Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Pedram,

In the chart examples, Serialization->Control State, when saving with CustomXML and choosing Appearance as the filter, it would be expected that only the appearance would be saved. So then modifying the chart data and appearance and then loading the saved appearance file should only modify the appearance of the chart. However, both Data and Appearance are modified when the loading the appearance custom xml.

It turned out to be a problem in the serialization filter (which you can easily fix by adding the NDoubleDataSeriesXmlSurrogate type to the list of non serialized types). We'll publish a SP with this update.

Further, serializing the data only and loading it modifies the appearance as well as the data.

This is by design - the control simply uses the default fill / border etc. styles to fill the data - it will not merge the loadeded state with the previous one - this is why the appearance changes.

Hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team



Pedram .
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 7, Visits: 1
I'm trying to implement and understand what the expected result is from using custom xml's and saving them with serialization filters.

In the chart examples, Serialization->Control State, when saving with CustomXML and choosing Appearance as the filter, it would be expected that only the appearance would be saved. So then modifying the chart data and appearance and then loading the saved appearance file should only modify the appearance of the chart. However, both Data and Appearance are modified when the loading the appearance custom xml.

Further, serializing the data only and loading it modifies the appearance as well as the data.

Can someone please comment on this?



Similar Topics


Reading This Topic