Table of Contents

Interface IChartTextArea

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

Represents the Text Area in a chart.

public interface IChartTextArea : IFont, IExcelApplication, IOptimizedUpdate
Inherited Members

Properties

BackgroundMode

Display mode of the background. The following code illustrates the use of BackgroundMode property:

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

//Create chart
IChart chart = worksheet.Charts.Add();

//Set range
chart.DataRange = worksheet.Range["B2:C6"];

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

//Set the Area's text in the chart
chart.ChartTitleArea.Text = "Student Chart";

//Set the Display mode of the background
chart.ChartTitleArea.BackgroundMode = ChartBackgroundMode.Opaque;

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

Property Value

ChartBackgroundMode

FrameFormat

Return format of the text area. The following code illustrates the use of FrameFormat property:

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

//Create chart
IChart chart = worksheet.Charts.Add();

//Set range
chart.DataRange = worksheet.Range["B2:C6"];

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

//Get the formatting options of the chart for text area
chart.ChartTitleArea.Text = "Student Chart";
chart.ChartTitleArea.FrameFormat.Border.Color = Color.Brown;
chart.ChartTitleArea.FrameFormat.Interior.Pattern = ExcelPatternType.Percent25;

//Save to file
workbook.SaveToFile("Chart.xlsx");
IChartFrameFormat FrameFormat { get; }

Property Value

IChartFrameFormat

IsAutoMode

True if background is set to automatic. The following code illustrates the use of IsAutoMode property:

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

//Create chart
IChart chart = worksheet.Charts.Add();

//Set range
chart.DataRange = worksheet.Range["B2:C6"];

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

//Set the Area's text in the chart
chart.ChartTitleArea.Text = "Student Chart";

//True if background is set to automatic
Console.WriteLine(chart.ChartTitleArea.IsAutoMode);

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

Property Value

bool

Text

Area's text.Some items(such as legend,axis...) maybe invalid. The following code illustrates the use of Text property:

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

//Create chart
IChart chart = worksheet.Charts.Add();

//Set range
chart.DataRange = worksheet.Range["B2:C6"];

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

//Set the Area's text in the chart
chart.ChartTitleArea.Text = "Student Chart";

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

Property Value

string

TextRotationAngle

Text rotation angle. The following code illustrates the use of TextRotationAngle property:

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

//Create chart
IChart chart = worksheet.Charts.Add();

//Set range
chart.DataRange = worksheet.Range["B2:C6"];

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

//Set the Area's text in the chart
chart.ChartTitleArea.Text = "Student Chart";

//Set the Text rotation angle
chart.ChartTitleArea.TextRotationAngle = 30;

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

Property Value

int