Table of Contents

Interface IChartDataTable

Namespace
Spire.Xls.Core
Assembly
Spire.XLS.dll

Represents the chart data table.

public interface IChartDataTable : IFont, IExcelApplication, IOptimizedUpdate
Inherited Members

Properties

BackgroundMode

ChartBackgroundMode BackgroundMode { get; set; }

Property Value

ChartBackgroundMode

HasBorders

True if data table has borders. The following code illustrates how to outline borders of IChartDataTable object:

//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];

//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:F2"];

//Set chart type
chart.ChartType = ExcelChartType.ColumnClustered;

//Enabling the data table
chart.HasDataTable = true;

//Get data table of the chart
IChartDataTable dataTable = chart.DataTable;

//Set false to remove the borders in data table
dataTable.HasBorders = false;

//Save to file
workbook.SaveToFile("Chart.xlsx");
bool HasBorders { get; set; }

Property Value

bool

HasHorzBorder

True if data table has horizontal border. The following code illustrates how to remove horizontal border for IChartDataTable object:

//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];

//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:F2"];

//Set chart type
chart.ChartType = ExcelChartType.ColumnClustered;

//Enabling the data table
chart.HasDataTable = true;

//Get data table of the chart
IChartDataTable dataTable = chart.DataTable;

//Set false to remove the horizontal border in data table
dataTable.HasHorzBorder = false;

//Save to file
workbook.SaveToFile("Chart.xlsx");
bool HasHorzBorder { get; set; }

Property Value

bool

HasVertBorder

True if data table has vertical border. The following code illustrates how to remove vertical border for IChartDataTable object:

//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];

//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:F2"];

//Set chart type
chart.ChartType = ExcelChartType.ColumnClustered;

//Enabling the data table
chart.HasDataTable = true;

//Get data table of the chart
IChartDataTable dataTable = chart.DataTable;

//Set false to remove the vertical border in data table
dataTable.HasVertBorder = false;

//Save to file
workbook.SaveToFile("Chart.xlsx");
bool HasVertBorder { get; set; }

Property Value

bool

ShowSeriesKeys

True if there is series keys in the data table. The following code illustrates how to show series keys in the IChartDataTable object:

//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];

//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:F2"];

//Set chart type
chart.ChartType = ExcelChartType.ColumnClustered;

//Enabling the data table
chart.HasDataTable = true;

//Get data table of the chart
IChartDataTable dataTable = chart.DataTable;

//Set true to show series keys in the data table
dataTable.ShowSeriesKeys = true;

//Save to file
workbook.SaveToFile("Chart.xlsx");
bool ShowSeriesKeys { get; set; }

Property Value

bool