Class ChartModel
Represents the properties of a chart that can be inserted into a worksheet.
Inherited Members
Namespace: Syncfusion.Blazor.Spreadsheet
Assembly: Syncfusion.Blazor.Spreadsheet.dll
Syntax
public class ChartModel
Remarks
This class defines the chart configuration settings used to create and insert a chart programmatically, including chart type, data range, series orientation, and theme.
Constructors
ChartModel()
Declaration
public ChartModel()
Properties
ChartType
Gets or sets the type of chart to be inserted.
Declaration
public string ChartType { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string that specifies the chart type (e.g., |
Remarks
The specified chart type must be a supported type available in the spreadsheet UI. Invalid chart types will be ignored.
Id
Gets or sets the unique identifier of the chart.
Declaration
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string that uniquely identifies the chart within the workbook. |
Remarks
This identifier is used to distinguish the chart from other charts and is required for chart operations such as deletion or modification.
IsSeriesInRows
Gets or sets a value indicating whether chart data series are derived from rows or columns.
Declaration
public bool IsSeriesInRows { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | When set to true, each row represents a separate data series; otherwise, each column represents a separate data series. The default value is false. |
Remarks
This property determines how the data in the specified Range is interpreted when generating the chart series.
Range
Gets or sets the cell range that provides the data for the chart series.
Declaration
public string Range { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string that specifies the worksheet range in A1 notation (e.g., |
Remarks
The specified range should contain the data to be plotted in the chart. If no range is specified, the chart is generated from the currently selected range.
Theme
Gets or sets the theme applied to the chart.
Declaration
public string Theme { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string that specifies the chart theme (e.g., |
Remarks
If the specified theme is unavailable or invalid, the default theme is applied instead.