Class ChartModel
The ChartModel object acts as the central repository of data associated with and displayed by a ChartControl. There are three parts to the ChartModel. The first part is the ChartSeriesCollection instance that is held in the model. This collection holds all the ChartSeries instances that are registered with and displayed by the Chart. The Chart Model also holds a ChartBaseStylesMap instance. This collection maintains a collection of base styles that are registered with it. These base styles can be accessed and changed using this collection. Any changes made to base styles will automatically affect all style objects that depend on these base styles. Also, in the model is a ChartColorModel instance that provides access to several default color palettes for use by the ChartControl.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Chart
Assembly: Syncfusion.Chart.Base.dll
Syntax
public class ChartModel
Constructors
ChartModel()
Initializes a new instance of the ChartModel class.
Declaration
public ChartModel()
Properties
ColorModel
Returns the ChartColorModel associated with this model.
Declaration
public ChartColorModel ColorModel { get; }
Property Value
| Type | Description |
|---|---|
| ChartColorModel | The color model. |
IndexedValues
Gets the indexed values.
Declaration
public ChartIndexedValues IndexedValues { get; }
Property Value
| Type | Description |
|---|---|
| ChartIndexedValues | The indexed values. |
Series
Collection of ChartSeries objects. Each series represents an underlying IChartSeriesModel.
Declaration
public ChartSeriesCollection Series { get; }
Property Value
| Type | Description |
|---|---|
| ChartSeriesCollection | The series. |
Methods
CheckSeriesCompatibility(ChartArea, Boolean)
Checks the series compatibility.
Declaration
public bool CheckSeriesCompatibility(ChartArea chartArea, bool invertedSeriesIsCompatible)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartArea | chartArea | The chart area. |
| System.Boolean | invertedSeriesIsCompatible | If set to |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns whether inverted series is compatible or not. |
Dispose()
Method to dispose ChartModel objects.
Declaration
public void Dispose()
GetStylesMap()
Returns the ChartBaseStylesMap associated with this model.
Declaration
public ChartBaseStylesMap GetStylesMap()
Returns
| Type | Description |
|---|---|
| ChartBaseStylesMap | Return ChartBaseStylesMap. |
NewSeries()
Overloaded. Factory method for the creation of new series.
Declaration
[Obsolete("Use ChartSeries constructor.")]
public ChartSeries NewSeries()
Returns
| Type | Description |
|---|---|
| ChartSeries | Returns ChartSeries. |
NewSeries(String)
Factory method for the creation of new series.
Declaration
[Obsolete("Use ChartSeries constructor.")]
public ChartSeries NewSeries(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Unique name for the new series that is to be created. |
Returns
| Type | Description |
|---|---|
| ChartSeries | ChartSeriesReturns ChartSeries |
NewSeries(String, ChartSeriesType)
Factory method for the creation of new series.
Declaration
[Obsolete("Use ChartSeries constructor.")]
public ChartSeries NewSeries(string name, ChartSeriesType type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Unique name for the new series that is to be created. |
| ChartSeriesType | type | The type of the series that is to be created. |
Returns
| Type | Description |
|---|---|
| ChartSeries | ChartSeriesReturns ChartSeries. |
Refresh(ChartArea)
Updates the Line series while button click and refresh the model.
Declaration
public void Refresh(ChartArea area)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartArea | area | The area. |
SetChart(IChartAreaHost)
Sets the chart.
Declaration
public void SetChart(IChartAreaHost chartHost)
Parameters
| Type | Name | Description |
|---|---|---|
| IChartAreaHost | chartHost | The chart host. |
UpdateArea(ChartArea)
Updates the axes of chart area.
Declaration
public void UpdateArea(ChartArea area)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartArea | area | The area. |