Dundas Chart for ASP.NET
Serializer Property
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > Chart Class : Serializer Property


Gets a ChartSerializer object, which is used for chart serialization.


Chart serializer object.

Syntax

Visual Basic (Declaration)  
Public ReadOnly Property Serializer As ChartSerializer
Visual Basic (Usage) Copy Code
Dim instance As Chart
Dim value As ChartSerializer
 
value = instance.Serializer
C#  
public ChartSerializer Serializer {get;}

Return Value

ChartSerializer object.

Example

The following sample specifies a border skin that uses a frame in the Page_Load event. We also use an image that is tiled by default.

Visual Basic Copy Code
[Visual Basic]

Imports Dundas.Charting.WebControl
...

' Create MemoryStream object
Dim myStream As New MemoryStream()

' Save chart appearance properties that have non-default values., as well as axis labels.
Chart1.Serializer.Content = SerializationContent.Appearance

' We can concatenate the Content property string and the SerializableContent string, since the Content
' property is implemented internally as the SerializableContent property. Since we use the
' SerializableContent property we also need to persist the ChartArea and Series object's names,
' otherwise these serialized properties will be applied to new ChartArea and Series objects
' when the data is loaded.
Chart1.Serializer .SerializableContent += ",DataPoint.AxisLabel,Series.AxisLabels,Series.Name,ChartArea.Name"
Chart1.Serializer .Save(myStream)
...

' Load the serialized data
Chart1.Serializer.Content = SerializationContent.Appearance
Chart1.Serializer .SerializableContent += ",DataPoint.AxisLabel,Series.AxisLabels,Series.Name,ChartArea.Name"
Chart1.Serializer .Load (myStream)
C# Copy Code
using Dundas.Charting.WebControl;
...

// Create MemoryStream object
MemoryStream myStream = new System.IO.MemoryStream();

// Save chart appearance properties that have non-default values, as well as axis labels.
Chart1.Serializer .Content= SerializationContent.Appearance;

// We can concatenate the Content property string and the SerializableContent string, since the Content
//   property is implemented internally as the SerializableContent property. Since we use the
//   SerializableContent property we also need to persist the ChartArea and Series object's names,
//   otherwise these serialized properties will be applied to new ChartArea and Series objects
//    when the data is loaded.
Chart1.Serializer .SerializableContent += ",DataPoint.AxisLabel,Series.AxisLabels,Series.Name,ChartArea.Name";
Chart1.Serializer.Save (myStream);
...

// Load the serialized data.
Chart1.Serializer.Content = SerializationContent.Appearance;
Chart1.Serializer .SerializableContent +=
",DataPoint.AxisLabel,Series.AxisLabels,Series.Name,ChartArea.Name";
Chart1.Serializer .Load(myStream);

Remarks

Use this property at either design-time or run-time to serialize the chart.

For a detailed discussion of the ChartSerializer class refer to the class overview.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.