Click or drag to resize

IChart ChartType Property

Type of the chart.
Examples
The following code illustrates how to setExcelChartType.PyramidBarStacked to ChartType property:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Add data</para><para>worksheet.Range["A1"].Text = "Jan";
 worksheet.Range["B1"].Text = "Feb";
 worksheet.Range["C1"].Text = "Mar";
 worksheet.Range["A2"].Text = "10";
 worksheet.Range["B2"].Text = "20";
 worksheet.Range["C2"].Text = "30";</para><para>//Create chart and set chart type</para><para>IChart chart = workbook.Charts.Add();</para><para>chart.DataRange = worksheet.Range["A1:C2"];</para><para>chart.ChartType = ExcelChartType.PyramidBarStacked;</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
ExcelChartType ChartType { get; set; }

Property Value

Type: ExcelChartType
See Also