Table of Contents

Class XlsChartSerieDataFormat

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

Properties

AreaProperties

Returns object, that represents aera properties. Read only. The following code illustrates how to access AreaProperties properties and set color to IChartInterior.ForegroundColorIndex property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set interiorIChartInterior interior = chart.Series[0].Format.AreaProperties;//Set colorinterior.ForegroundColor = Color.Red;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartInterior AreaProperties { get; }

Property Value

IChartInterior

BackGroundColor

Represents background color.

public Color BackGroundColor { get; set; }

Property Value

Color

BackGroundColorObject

Represents background color.

public OColor BackGroundColorObject { get; }

Property Value

OColor

BackGroundKnownColor

Represents background excel color.

public ExcelColors BackGroundKnownColor { get; set; }

Property Value

ExcelColors

BarTopType

Represents the top data format. The following code illustrates how to set ExcelTopFormat.Sharp to BarShapeTop property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Bar3DStacked;//Set Bar shape basechart.Series[0].Format.BarTopType = TopFormatType.Sharp;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public TopFormatType BarTopType { get; set; }

Property Value

TopFormatType

BarType

Represents the base data format. The following code illustrates how to set BaseFormatType.Circle to BarShapeBase:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Bar3DStacked;//Set Bar shape basechart.Series[0].Format.BarType = BaseFormatType.Circle;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public BaseFormatType BarType { get; set; }

Property Value

BaseFormatType

Fill

Represents XlsFill options. Read-only. The following code illustrates the use of Fill property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Column3DClustered;//Gets fill options for the chart elementIShapeFill fillChart = chart.ChartArea.Fill;fillChart.FillType = ShapeFillType.Gradient;fillChart.BackColor = Color.FromArgb(205, 217, 234);fillChart.ForeColor = Color.White;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IShapeFill Fill { get; }

Property Value

IShapeFill

ForeGroundColor

Represents foreground color.

public Color ForeGroundColor { get; set; }

Property Value

Color

ForeGroundColorObject

Represents foreground color object.

public OColor ForeGroundColorObject { get; }

Property Value

OColor

ForeGroundKnownColor

Represents foreground color.

public ExcelColors ForeGroundKnownColor { get; set; }

Property Value

ExcelColors

Format3D

public Format3D Format3D { get; }

Property Value

Format3D

HasBorder

Indicates whether chart has border.

public bool HasBorder { get; }

Property Value

bool

HasBorderLine

Indicates whethers chart has border line.

public bool HasBorderLine { get; }

Property Value

bool

HasFormat3D

public bool HasFormat3D { get; }

Property Value

bool

HasInterior

This property indicates whether interior object was created. Read-only. The following code illustrates the use of HasInterior property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Column3DClustered;//Create a fill border and set interior valueIChartFillBorder fillBorder = chart.ChartArea;chart.ChartArea.Interior.ForegroundColor = Color.Yellow;//True if the chart element has interior formattingif (fillBorder.HasInterior){//Your Code Here}//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasInterior { get; }

Property Value

bool

HasLineProperties

This property indicates whether line formatting object was created. Read-only. The following code illustrates the use of HasLineProperties property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Column3DClustered;//Create a fill border and set line border valueIChartFillBorder fillBorder = chart.ChartArea;chart.ChartArea.Border.Color = Color.Yellow;//True if the chart element has line formattingif (fillBorder.HasLineProperties){//Your Code Here}//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasLineProperties { get; }

Property Value

bool

HasShadow

public bool HasShadow { get; }

Property Value

bool

Has_dPtPieExplosion

Indicates whether dataformat has PieExplosion.

public bool Has_dPtPieExplosion { get; set; }

Property Value

bool

Interior

Returns object, that represents area properties. Read-only. The following code illustrates the use of Interior property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Column3DClustered;//Gets interior formatting properties for the chart elementIChartInterior chartInterior = chart.ChartArea.Interior;chartInterior.BackgroundColor = Color.Beige;chartInterior.Pattern = ExcelPatternType.DarkDownwardDiagonal;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartInterior Interior { get; }

Property Value

IChartInterior

Is3DBubbles

True to draw bubbles with 3D effects. The following code illustrates how Is3DBubbles property can be used:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Bubble3D;//Set serie formatIChartSerieDataFormat format = chart.Series[0].Format;//Check typeConsole.WriteLine(format.Is3DBubbles);//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool Is3DBubbles { get; set; }

Property Value

bool

IsAutoMarker

Automatic color. The following code illustrates how IsAutoMarker property can be used:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:F2"];//Set chart typechart.ChartType = ExcelChartType.LineMarkers;//Set serie data formatIChartSerieDataFormat format = chart.Series[0].DataPoints.DefaultDataPoint.DataFormat;//Check auto markerConsole.Write(format.IsAutoMarker);//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool IsAutoMarker { get; set; }

Property Value

bool

IsAutomaticFormat

Indicates, if automatic format is used.

public bool IsAutomaticFormat { get; set; }

Property Value

bool

IsBorderSupported

Indicates whether border object is supported. Read-only.

public bool IsBorderSupported { get; }

Property Value

bool

IsFormatted

Indicate if data format is formatted.

public bool IsFormatted { get; }

Property Value

bool

IsInteriorSupported

Indicates whether interior object is supported. Read-only.

public bool IsInteriorSupported { get; }

Property Value

bool

IsMarker

If true - format has marker; otherwise false. Read-only.

public bool IsMarker { get; }

Property Value

bool

IsMarkerSupported

Indicates whether marker is supported by this chart/series. The following code illustrates how set ExcelTreeMapLabelOption.Banner to TreeMapLabelOption:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Pie;//Set serie formatIChartSerieDataFormat format = chart.Series[0].Format;//Check marker supportConsole.WriteLine(format.IsMarkerSupported);//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool IsMarkerSupported { get; }

Property Value

bool

IsShadow

[Obsolete("get and set are not implemented")]
public bool IsShadow { get; set; }

Property Value

bool

IsShowBackground

True = "background = none".

public bool IsShowBackground { get; }

Property Value

bool

IsShowForeground

True = "foreground = none".

public bool IsShowForeground { get; }

Property Value

bool

IsSmoothed

If true - format has smothed line; otherwise false. Read-only.

public bool IsSmoothed { get; }

Property Value

bool

IsSmoothedLine

True if the line series has a smoothed line.

public bool IsSmoothedLine { get; set; }

Property Value

bool

IsSupportFill

Indicats whether chart supports transparency.

public bool IsSupportFill { get; }

Property Value

bool

LineProperties

Returns object, that represents line properties. Read-only. The following code illustrates the use of LineProperties:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Column3DClustered;//Gets line formatting properties for the chart elementIChartBorder border = chart.PlotArea.Border;border.Pattern = ChartLinePatternType.DashDotDot;border.Color = Color.Orange;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public ChartBorder LineProperties { get; }

Property Value

ChartBorder

MarkerBackColorObject

Gets object that holds marker background color.

public OColor MarkerBackColorObject { get; }

Property Value

OColor

MarkerBackgroundColor

Foreground color: RGB value (high byte = 0). The following code illustrates how to set color to markers in charts:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Line;//Set serie formatIChartSerieDataFormat format = chart.Series[0].Format;//Set marker styleformat.MarkerStyle = ChartMarkerType.Circle;//Set colorformat.MarkerBackgroundColor = Color.Red;format.MarkerForegroundColor = Color.Black;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public Color MarkerBackgroundColor { get; set; }

Property Value

Color

MarkerBackgroundKnownColor

Index to color of marker XlsFill. The following code illustrates how to set a color from ExcelColors enumeration to marker applied:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Line;//Set serie formatIChartSerieDataFormat format = chart.Series[0].Format;//Set marker styleformat.MarkerStyle = ChartMarkerType.Circle;//Set colorformat.MarkerBackgroundKnownColor = ExcelColors.Red;format.MarkerForegroundKnownColor = ExcelColors.Black;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public ExcelColors MarkerBackgroundKnownColor { get; set; }

Property Value

ExcelColors

MarkerBorderWidth

Marker border weight(unit pt).

public double MarkerBorderWidth { get; set; }

Property Value

double

MarkerFill

Get fill object of the marker.

The following code illustrates how to fill a marker .

var markerFill = chart.Series[0].Format.MarkerFill;
//fill by defined Texture
markerFill.Texture = GradientTextureType.GreenMarble;

//fill by defined Pattern
markerFill.Pattern = GradientPatternType.PatLargeCheckerBoard;
//Pattern need set fore/background color
markerFill.ForeColor = Color.Blue;
markerFill.BackColor = Color.Red;
//fill by a picture
markerFill.CustomPicture("type1.png")
//set transparency: value from 0.0 (Clear) through 1.0(Opaque)
markerFill.Transparency = 0.5;
public IShapeFill MarkerFill { get; }

Property Value

IShapeFill

MarkerForeColorObject

Gets object that holds marker foreground color.

public OColor MarkerForeColorObject { get; }

Property Value

OColor

MarkerForegroundColor

Background color: RGB value (high byte = 0). The following code illustrates how to set color for markers in charts:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Line;//Set serie formatIChartSerieDataFormat format = chart.Series[0].Format;//Set marker styleformat.MarkerStyle = ChartMarkerType.Circle;//Set colorformat.MarkerBackgroundColor = Color.Red;format.MarkerForegroundColor = Color.Black;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public Color MarkerForegroundColor { get; set; }

Property Value

Color

MarkerForegroundKnownColor

Index to color of marker border. The following code illustrates how to set a color from ExcelColors enumeration to marker applied:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Line;//Set serie formatIChartSerieDataFormat format = chart.Series[0].Format;//Set marker styleformat.MarkerStyle = ChartMarkerType.Circle;//Set colorformat.MarkerBackgroundKnownColor = ExcelColors.Red;format.MarkerForegroundKnownColor = ExcelColors.Black;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public ExcelColors MarkerForegroundKnownColor { get; set; }

Property Value

ExcelColors

MarkerSize

Size of line markers. The following code illustrates how to set MarkerSize for applied markers in charts:

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

Property Value

int

MarkerStyle

Type of marker. The following code illustrates how marker style can be applied to charts:

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

Property Value

ChartMarkerType

MarkerTransparencyValue

Gets or sets the transparency of the line marker.

public double MarkerTransparencyValue { get; set; }

Property Value

double

The transparency.

Options

Gets common serie options. Read-only. The following code illustrates how IChartFormat.GapWidth can be set by accessing CommonSerieOptions property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Column3DStacked;//Set optionsIChartFormat options = chart.Series[0].Format.Options;//Set Gap widthoptions.GapWidth = 400;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartFormat Options { get; }

Property Value

IChartFormat

ParentSerie

public XlsChartSerie ParentSerie { get; }

Property Value

XlsChartSerie

Pattern

Represents pattern.

public ExcelPatternType Pattern { get; set; }

Property Value

ExcelPatternType

Percent

Distance of pie slice from center of pie. The following code illustrates how to set Percent property:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartIChart chart = worksheet.Charts.Add();//Set rangechart.DataRange = worksheet.Range["A1:C2"];//Set chart typechart.ChartType = ExcelChartType.Pie;//Set percentchart.Series[0].Format.Percent = 30;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public int Percent { get; set; }

Property Value

int

QuartileCalculationType

Gets / Sets whether the Quartile calculation is Exclusive or Inclusive

public ExcelQuartileCalculation QuartileCalculationType { get; set; }

Property Value

ExcelQuartileCalculation

Remarks

Applies only to Box and Whisker Charts

SeriesNumber

[Obsolete("get and set are not implemented")]
public int SeriesNumber { get; set; }

Property Value

int

Shadow

public ChartShadow Shadow { get; }

Property Value

ChartShadow

ShowActiveValue

[Obsolete("get and set are not implemented")]
public bool ShowActiveValue { get; set; }

Property Value

bool

ShowBubble

[Obsolete("get and set are not implemented")]
public bool ShowBubble { get; set; }

Property Value

bool

ShowCategoryLabel

[Obsolete("get and set are not implemented")]
public bool ShowCategoryLabel { get; set; }

Property Value

bool

ShowConnectorLines

Gets or sets a boolean value indicating whether to display Connector Lines between data points

public bool ShowConnectorLines { get; set; }

Property Value

bool

Remarks

Applies only to Waterfall Charts

ShowInnerPoints

Gets or sets a boolean value indicating whether to display Inner Points in Box and Whisker chart

public bool ShowInnerPoints { get; set; }

Property Value

bool

ShowMeanLine

Gets or sets a boolean value indicating whether to display Mean Line in Box and Whisker chart

public bool ShowMeanLine { get; set; }

Property Value

bool

ShowMeanMarkers

Gets or sets a boolean value indicating whether to display Mean Marker in Box and Whisker chart

public bool ShowMeanMarkers { get; set; }

Property Value

bool

ShowOutlierPoints

Gets or sets a boolean value indicating whether to display Outlier Points in Box and Whisker chart

public bool ShowOutlierPoints { get; set; }

Property Value

bool

ShowPieCategoryLabel

[Obsolete("get and set are not implemented")]
public bool ShowPieCategoryLabel { get; set; }

Property Value

bool

ShowPieInPercents

[Obsolete("get and set are not implemented")]
public bool ShowPieInPercents { get; set; }

Property Value

bool

SmoothLine

[Obsolete("get and set are not implemented")]
public bool SmoothLine { get; set; }

Property Value

bool

TreeMapLabelOption

Gets / Sets the Display label position in Tree map chart

public ExcelTreeMapLabelOption TreeMapLabelOption { get; set; }

Property Value

ExcelTreeMapLabelOption

Remarks

By Default the Label is overlapped

Visible

Represents visiblity.

public bool Visible { get; set; }

Property Value

bool