Table of Contents

Class ChartTextArea

Namespace
Spire.Xls.Charts
Assembly
Spire.XLS.dll
public class ChartTextArea : XlsObject, IDisposable, IChartDataLabels, IChartTextArea, IFont, IExcelApplication, IOptimizedUpdate
Inheritance
ChartTextArea
Implements
Inherited Members

Properties

BackgroundMode

Display mode of the background. The following code illustrates the use of BackgroundMode 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["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Set the Area's text in the chartchart.ChartTitleArea.Text = "Student Chart";//Set the Display mode of the backgroundchart.ChartTitleArea.BackgroundMode = ChartBackgroundMode.Opaque;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public ChartBackgroundMode BackgroundMode { get; set; }

Property Value

ChartBackgroundMode

Color

public Color Color { get; set; }

Property Value

Color

Delimiter

Delimeter.

public string Delimiter { get; set; }

Property Value

string

Font

Returns FontImpl for current font. Read-only.

[Obsolete("This properties is obsolete. \r Modify properties of fontImpl will affect others. Recommend direct use properties of ChartTitleArea\r modify the font style of ChartTitleArea.")]
public FontWrapper Font { get; }

Property Value

FontWrapper

FontName

public string FontName { get; set; }

Property Value

string

FrameFormat

Return format of the text area. The following code illustrates the use of FrameFormat 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["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

IChartFrameFormat

HasBubbleSize

Indicates whether buble size is in data labels.

public bool HasBubbleSize { get; set; }

Property Value

bool

HasCategoryName

Indicates whether category name is in data labels.

public bool HasCategoryName { get; set; }

Property Value

bool

HasDataLabels

Indicates whether contain dataLabels .

public bool HasDataLabels { get; }

Property Value

bool

HasLegendKey

Indicates whether legend key is in data labels.

public bool HasLegendKey { get; set; }

Property Value

bool

HasPercentage

Indicates whether percentage is in data labels.

public bool HasPercentage { get; set; }

Property Value

bool

HasSeriesName

Indicates whether series name is in data labels.

public bool HasSeriesName { get; set; }

Property Value

bool

HasTextRotation

public bool HasTextRotation { get; }

Property Value

bool

HasValue

Indicates whether value is in data labels.

public bool HasValue { get; set; }

Property Value

bool

HorizontalAlignType

public HorizontalAlignType HorizontalAlignType { get; set; }

Property Value

HorizontalAlignType

Index

public int Index { get; }

Property Value

int

IsAutoColor

public bool IsAutoColor { get; }

Property Value

bool

IsAutoMode

True if background is set to automatic. The following code illustrates the use of IsAutoMode 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["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Set the Area's text in the chartchart.ChartTitleArea.Text = "Student Chart";//True if background is set to automaticConsole.WriteLine(chart.ChartTitleArea.IsAutoMode);//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool IsAutoMode { get; }

Property Value

bool

IsBold

public bool IsBold { get; set; }

Property Value

bool

IsItalic

public bool IsItalic { get; set; }

Property Value

bool

IsResizeShapeToFitText

public bool IsResizeShapeToFitText { get; set; }

Property Value

bool

IsShowLabelPercent

Indicates whether to show category label and value as percentage.

public bool IsShowLabelPercent { get; set; }

Property Value

bool

IsStrikethrough

public bool IsStrikethrough { get; set; }

Property Value

bool

IsSubscript

public bool IsSubscript { get; set; }

Property Value

bool

IsSuperscript

public bool IsSuperscript { get; set; }

Property Value

bool

IsTextWrapped

public bool IsTextWrapped { get; set; }

Property Value

bool

IsTrend

Indicates if current text assign to trend object.

public bool IsTrend { get; set; }

Property Value

bool

KnownColor

public ExcelColors KnownColor { get; set; }

Property Value

ExcelColors

NumberFormat

Gets or sets number format for the text area.

public string NumberFormat { get; set; }

Property Value

string

NumberFormatIndex

Gets index to the number format. Read-only.

public int NumberFormatIndex { get; }

Property Value

int

OColor

Returns textarea's color object. Read-only.

public OColor OColor { get; }

Property Value

OColor

ParagraphType

public ChartParagraphType ParagraphType { get; set; }

Property Value

ChartParagraphType

Parent

public object Parent { get; }

Property Value

object

ParentWorkbook

public XlsWorkbook ParentWorkbook { get; }

Property Value

XlsWorkbook

Position

Represents data labels position.

public DataLabelPositionType Position { get; set; }

Property Value

DataLabelPositionType

ShowLeaderLines

Indicates whether Leader Lines is in data labels. The following code illustrates how to access the IChartDataLabels and set to leader lines to show:

//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");
[Obsolete("get and set are not implemented")]
public bool ShowLeaderLines { get; set; }

Property Value

bool

Size

public double Size { get; set; }

Property Value

double

StrikethroughType

public string StrikethroughType { get; set; }

Property Value

string

Text

Area's text.Some items(such as legend,axis...) maybe invalid. The following code illustrates the use of Text 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["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Set the Area's text in the chartchart.ChartTitleArea.Text = "Student Chart";//Save to fileworkbook.SaveToFile("Chart.xlsx");
public string Text { get; set; }

Property Value

string

TextRotationAngle

Text rotation angle. The following code illustrates the use of TextRotationAngle 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["B2:C6"];//Set chart typechart.ChartType = ExcelChartType.Cone3DClustered;//Set the Area's text in the chartchart.ChartTitleArea.Text = "Student Chart";//Set the Text rotation anglechart.ChartTitleArea.TextRotationAngle = 30;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public int TextRotationAngle { get; set; }

Property Value

int

Underline

public FontUnderlineType Underline { get; set; }

Property Value

FontUnderlineType

VerticalAlignment

public FontVertialAlignmentType VerticalAlignment { get; set; }

Property Value

FontVertialAlignmentType

X

public float X { get; set; }

Property Value

float

Y

public float Y { get; set; }

Property Value

float

Methods

BeginUpdate()

public void BeginUpdate()

Clone(object)

public object Clone(object parent)

Parameters

parent object

Returns

object

Clone(object, Dictionary<int, int>, Dictionary<string, string>)

public object Clone(object parent, Dictionary<int, int> fontIndexes, Dictionary<string, string> dicNewSheetNames)

Parameters

parent object
fontIndexes Dictionary<int, int>
dicNewSheetNames Dictionary<string, string>

Returns

object

EndUpdate()

public void EndUpdate()

GetThemeColor(out ThemeColorType, out double)

public bool GetThemeColor(out ThemeColorType type, out double tint)

Parameters

type ThemeColorType
tint double

Returns

bool

SetFont(ExcelFont)

public void SetFont(ExcelFont font)

Parameters

font ExcelFont

SetThemeColor(ThemeColorType, double)

public void SetThemeColor(ThemeColorType type, double tint)

Parameters

type ThemeColorType
tint double