Class XlsChartDataLabels
- Namespace
- Spire.Xls.Core.Spreadsheet.Charts
- Assembly
- Spire.XLS.dll
public class XlsChartDataLabels : XlsObject, IDisposable, IChartDataLabels, IChartTextArea, IFont, IExcelApplication, IOptimizedUpdate
- Inheritance
-
XlsChartDataLabels
- Implements
- Derived
- Inherited Members
Properties
BackgroundMode
Display mode of the background.
public ChartBackgroundMode BackgroundMode { get; set; }
Property Value
Color
Gets or sets color.
public Color Color { get; set; }
Property Value
Delimiter
Delimeter.
//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:C3"];//Set chart typechart.ChartType = ExcelChartType.ColumnClustered;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set ' ' symbol as separator for data labelsdataLabels.HasValue = true;dataLabels.HasSeriesName = true;dataLabels.Delimiter =" ";//Save to fileworkbook.SaveToFile("Chart.xlsx");
public string Delimiter { get; set; }
Property Value
Font
[Obsolete("This properties is obsolete. \r Modify properties of fontImpl will affect others. Recommend direct use properties of ChartDataLabels\r modify the font style.")]
public XlsFont Font { get; }
Property Value
FontName
Returns or sets the font name. Read / write string.
public string FontName { get; set; }
Property Value
Format
public XlsChartSerieDataFormat Format { get; }
Property Value
FrameFormat
Return format of the text area.
//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["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Get the formatting options of the chart for text areachart.ChartTitleArea.Text = "Student Chart";chart.ChartTitleArea.FrameFormat.Border.Color = Color.Brown;chart.ChartTitleArea.FrameFormat.Interior.Pattern = ExcelPatternType.Percent25;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartFrameFormat FrameFormat { get; }
Property Value
HasBubbleSize
Indicates whether bubble size is in data labels.
//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:C3"];//Set chart typechart.ChartType = ExcelChartType.Bubble;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the bubble sizesdataLabels.HasBubbleSize = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasBubbleSize { get; set; }
Property Value
HasCategoryName
Indicates whether category name is in data labels.
//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:C3"];//Set chart typechart.ChartType = ExcelChartType.ColumnClustered;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the category namesdataLabels.HasCategoryName = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasCategoryName { get; set; }
Property Value
HasFormula
Gets or sets a value indicating whether this instance has formula.
public bool HasFormula { get; }
Property Value
HasLegendKey
Indicates whether legend key is in data labels.
//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:C3"];//Set chart typechart.ChartType = ExcelChartType.ColumnClustered;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the legend keydataLabels.HasValue = true;dataLabels.HasLegendKey = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasLegendKey { get; set; }
Property Value
HasManualLayout
Indicates whether border formatting object was created. Read-only.
public bool HasManualLayout { get; }
Property Value
HasPercentage
Indicates whether percentage is in data labels.
//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.Pie;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the percentage valuesdataLabels.HasPercentage = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasPercentage { get; set; }
Property Value
HasSeriesName
Indicates whether series name is in data labels.
//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:C3"];//Set chart typechart.ChartType = ExcelChartType.ColumnClustered;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the serie namedataLabels.HasSeriesName = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasSeriesName { get; set; }
Property Value
HasValue
Indicates whether value is in data labels.
//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:C3"];//Set chart typechart.ChartType = ExcelChartType.ColumnClustered;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the valuesdataLabels.HasValue = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool HasValue { get; set; }
Property Value
HasWedgeCallout
public bool HasWedgeCallout { get; set; }
Property Value
Height
Y-size. 1/4000 of chart plot. IsHMode Shall set to True
public int Height { get; set; }
Property Value
Index
public int Index { get; }
Property Value
IsAutoColor
Indicates whether color has automatic color. Read-only.
public bool IsAutoColor { get; }
Property Value
IsAutoMode
True if background is set to automatic.
public bool IsAutoMode { get; }
Property Value
IsBold
True if the font is bold. Read / write Boolean.
public bool IsBold { get; set; }
Property Value
IsHMode
false value Specifies that the Height shall be interpreted as the Bottom of the chart element..
public bool IsHMode { get; set; }
Property Value
IsItalic
True if the font style is italic. Read / write Boolean.
public bool IsItalic { get; set; }
Property Value
IsResizeShapeToFitText
public bool IsResizeShapeToFitText { get; set; }
Property Value
IsStrikethrough
True if the font is struck through with a horizontal line. Read / write Boolean
public bool IsStrikethrough { get; set; }
Property Value
IsSubscript
True if the font is formatted as subscript. False by default. Read / write Boolean.
public bool IsSubscript { get; set; }
Property Value
IsSuperscript
True if the font is formatted as superscript. False by default. Read/write Boolean
public bool IsSuperscript { get; set; }
Property Value
IsTextWrapped
public bool IsTextWrapped { get; set; }
Property Value
IsWMode
false value Specifies that the Width shall be interpreted as the Right of the chart element..
public bool IsWMode { get; set; }
Property Value
IsXMode
true value Specifies that the X shall be interpreted as the Left of the chart element..
public bool IsXMode { get; set; }
Property Value
IsYMode
true value Specifies that the Y shall be interpreted as the Top of the chart element..
public bool IsYMode { get; set; }
Property Value
KnownColor
Returns or sets the primary color of the object.
public ExcelColors KnownColor { get; set; }
Property Value
NumberFormat
Represents trend line label number format.
public string NumberFormat { get; set; }
Property Value
Position
Represents data labels position.
//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.Pie;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the leader linesdataLabels.HasValue = true;dataLabels.Position = DataLabelPositionType.Outside;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public DataLabelPositionType Position { get; set; }
Property Value
ShowLeaderLines
Indicates whether Leader Lines is in data labels.
//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.Pie;//Get the chart serieIChartSerie serie = chart.Series[0];//Get serie data labelsIChartDataLabels dataLabels = serie.DataPoints.DefaultDataPoint.DataLabels;//Set the data label to show the leader linesdataLabels.HasValue = true;dataLabels.Position = DataLabelPositionType.Outside;dataLabels.ShowLeaderLines = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool ShowLeaderLines { get; set; }
Property Value
Size
Returns or sets the size of the font. Read / write Variant.
public double Size { get; set; }
Property Value
StrikethroughType
public string StrikethroughType { get; set; }
Property Value
Text
Gets or sets text.
public string Text { get; set; }
Property Value
TextArea
Text of area.
public XlsChartDataLabelArea TextArea { get; }
Property Value
TextRotationAngle
Text rotation angle. between -90 and 90.
public int TextRotationAngle { get; set; }
Property Value
Underline
Returns or sets the type of underline applied to the font.
public FontUnderlineType Underline { get; set; }
Property Value
ValueFromCell
Set Range for value. above Excel 2013
public CellRange ValueFromCell { get; set; }
Property Value
VerticalAlignment
Returns or sets font vertical alignment.
public FontVertialAlignmentType VerticalAlignment { get; set; }
Property Value
Width
X-size. 1/4000 of chart plot. IsWMode Shall set to True
public int Width { get; set; }
Property Value
X
X-position of upper-left corner. 1/4000 of chart plot. IsXMode Shall set to True
public int X { get; set; }
Property Value
Y
Y-position of upper-left corner. 1/4000 of chart plot. IsYMode Shall set to True
public int Y { get; set; }
Property Value
Methods
BeginUpdate()
public void BeginUpdate()
EndUpdate()
public void EndUpdate()
GetThemeColor(out ThemeColorType, out double)
public bool GetThemeColor(out ThemeColorType type, out double tint)
Parameters
type
ThemeColorTypetint
double
Returns
SetThemeColor(ThemeColorType, double)
public void SetThemeColor(ThemeColorType type, double tint)
Parameters
type
ThemeColorTypetint
double