Table of Contents

Class XlsChartDataPoint

Namespace
Spire.Xls.Core.Spreadsheet.Charts
Assembly
Spire.XLS.dll
public class XlsChartDataPoint : XlsObject, IDisposable, IChartDataPoint, IExcelApplication
Inheritance
XlsChartDataPoint
Implements
Derived
Inherited Members

Properties

DataFormat

Gets / sets data format. The following code illustrates how to access DataFormat and set ChartMarkerType.star to IChartSerieDataFormat.MarkerStyle:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Line;//Set serie formatIChartSerieDataFormat format = chart.Series[0].DataFormat;//Set marker styleformat.MarkerStyle = ChartMarkerType.Star;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartSerieDataFormat DataFormat { get; }

Property Value

IChartSerieDataFormat

DataLabels

Returns data labels object for the data point. Read-only. The following code illustrates how to access the IChartDataLabels for a particular IChartDataPoint:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Get the chart serieIChartSerie serie = chart.Series[0];//Set data labels value visibilityserie.DataPoints.DefaultDataPoint.DataLabels.HasValue = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartDataLabels DataLabels { get; }

Property Value

IChartDataLabels

HasDataLabels

public bool HasDataLabels { get; }

Property Value

bool

Index

Gets or sets index of the point in the points collection.

public int Index { get; }

Property Value

int

IsDefault

Indicates whether this data point is default data point. Read-only. The following code illustrates how to access the IChartDataLabels for a particular IChartDataPoint:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set serie formatIChartDataPoints dataPoints = chart.Series[0].DataPoints;//Check default DatapointConsole.WriteLine(dataPoints.DefaultDataPoint.IsDefault);Console.WriteLine(dataPoints[0].IsDefault);
public bool IsDefault { get; }

Property Value

bool

SetAsTotal

True if the data point is considered as Subtotals or Totals. otherwise False.

public bool SetAsTotal { get; set; }

Property Value

bool

Remarks

Applies only to Waterfall charts.

Methods

ClearDataFormats(XlsChartSerieDataFormat)

[Obsolete("the method is not implemented")]
public void ClearDataFormats(XlsChartSerieDataFormat format)

Parameters

format XlsChartSerieDataFormat

CloneDataFormat(XlsChartSerieDataFormat)

[Obsolete("the method is not implemented")]
public void CloneDataFormat(XlsChartSerieDataFormat serieFormat)

Parameters

serieFormat XlsChartSerieDataFormat