ChartSerializer.Content 属性


获取或设置要序列化的图表内容的类型。Gets or sets the type of chart content to be serialized.

 property System::Web::UI::DataVisualization::Charting::SerializationContents Content { System::Web::UI::DataVisualization::Charting::SerializationContents get(); void set(System::Web::UI::DataVisualization::Charting::SerializationContents value); };
public System.Web.UI.DataVisualization.Charting.SerializationContents Content { get; set; }
member this.Content : System.Web.UI.DataVisualization.Charting.SerializationContents with get, set
Public Property Content As SerializationContents



一个 SerializationContents 枚举值,该值表示将在加载、保存或重置操作期间执行序列化的图表内容。A SerializationContents enumeration value that represents the chart content that will be serialized during a load, save or reset operation. 默认情况下,将保留所有非默认图表属性,包括数据。By default, all non-default chart properties, including data, are persisted.


默认情况下,当调用任何和方法时,将序列化所有图表属性 Save LoadBy default, all chart properties will be serialized when any of the Save and Load methods are called. 若要更好地控制序列化的内容,请使用 Content 属性。To provide more control over what is serialized, use the Content property. 请注意, SerializableContentNonSerializableContent 属性也可以与属性一起使用 ContentNote that the SerializableContent and NonSerializableContent properties can also be used along with the Content property.


Content属性确定要序列化的图表特征(如 "外观")的类型,实际上在内部实现为 SerializableContent 属性。The Content property determines types of chart characteristics, such as "appearance", to be serialized, and is actually implemented internally as the SerializableContent property. 这意味着, Content 如果已连接,则设置属性并设置 SerializableContent 属性将导致 Content 重写属性值 SerializableContentThis means that setting the Content property and then setting the SerializableContent property will result in the Content property value being overridden, unless SerializableContent is concatenated. 有关此过程的示例,请参阅下面的示例代码。See the sample code below for an example of this procedure.

如果设置 Content 属性,则所有 ChartAreaSeries 对象名称都将自动进行序列化; 这意味着,与图表区和序列有关的序列化数据将在加载时应用于现有对象。If you set the Content property, all ChartArea and Series objects names will automatically be serialized; this means that serialized data that pertains to chart areas and series will be applied to existing objects when loaded.

设置此属性将影响所有加载、保存和重置操作。Setting this property affects all load, save and reset operations.