Class Title

Class Title

Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)

封装表示图表或轴标题的对象。

public class Title : ChartTextFrame

继承

objectChartFrameChartTextFrameTitle

继承成员

ChartTextFrame.m_IsAutoText, ChartTextFrame.m_deleted, ChartTextFrame.horizontal, ChartTextFrame.vertical, ChartTextFrame.rotation, ChartTextFrame.m_CharsList, ChartTextFrame.Characters(int, int), ChartTextFrame.IsAutoText, ChartTextFrame.IsDeleted, ChartTextFrame.TextHorizontalAlignment, ChartTextFrame.TextVerticalAlignment, ChartTextFrame.RotationAngle, ChartTextFrame.IsAutomaticRotation, ChartTextFrame.Text, ChartTextFrame.LinkedSource, ChartTextFrame.ReadingOrder, ChartTextFrame.DirectionType, ChartTextFrame.IsTextWrapped, ChartTextFrame.IsResizeShapeToFitText, ChartFrame.m_IsAutoXPos, ChartFrame.m_IsAutoYPos, ChartFrame.m_IsOffsetPosBeSet, ChartFrame.m_fontIndex, ChartFrame.m_AutoScaleFont, ChartFrame.m_BackgroundMode, ChartFrame.m_isAutoSize, ChartFrame.SetPositionAuto(), ChartFrame.IsInnerMode, ChartFrame.Border, ChartFrame.Area, ChartFrame.TextOptions, ChartFrame.Font, ChartFrame.AutoScaleFont, ChartFrame.BackgroundMode, ChartFrame.IsAutomaticSize, ChartFrame.X, ChartFrame.Y, ChartFrame.Height, ChartFrame.Width, ChartFrame.Shadow, ChartFrame.ShapeProperties, ChartFrame.IsDefaultPosBeSet, ChartFrame.DefaultX, ChartFrame.DefaultY, ChartFrame.DefaultWidth, ChartFrame.DefaultHeight, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

示例

Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

Cells cells = sheet.Cells;
cells[0,1].PutValue("收入");
cells[1,0].PutValue("公司 A");
cells[2,0].PutValue("公司 B");
cells[3,0].PutValue("公司 C");
cells[1,1].PutValue(10000);
cells[2,1].PutValue(20000);
cells[3,1].PutValue(30000);

int chartIndex = sheet.Charts.Add(ChartType.Column, 9, 9, 21, 15);
Chart chart = sheet.Charts[chartIndex];

//设置图表标题
chart.Title.Text = "标题";
//将图表标题的字体颜色设置为蓝色
chart.Title.Font.Color = Color.Blue;
//设置图表类别轴的标题
chart.CategoryAxis.Title.Text = "类别";
//设置图表值轴的标题
chart.ValueAxis.Title.Text = "值";
Dim workbook as Workbook = new Workbook()
Dim sheet as Worksheet = workbook.Worksheets(0)

Dim cells as Cells = sheet.Cells
cells(0,1).PutValue("收入")
cells(1,0).PutValue("公司 A")
cells(2,0).PutValue("公司 B")
cells(3,0).PutValue("公司 C")
cells(1,1).PutValue(10000)
cells(2,1).PutValue(20000)
cells(3,1).PutValue(30000)

Dim chartIndex as Integer = sheet.Charts.Add(ChartType.Column, 9, 9, 21, 15)    ///
Dim chart as Chart = sheet.Charts(chartIndex)

'设置图表标题
chart.Title.Text = "标题"
'将图表标题的字体颜色设置为蓝色
chart.Title.Font.Color = Color.Blue
'设置图表类别轴的标题
chart.CategoryAxis.Title.Text = "类别"
'设置图表值轴的标题
chart.ValueAxis.Title.Text = "值"

属性

IsVisible

表示标题是否可见。

public bool IsVisible { get; set; }

属性值

bool

OverLay

表示在不调整图表大小的情况下,居中叠加标题。

public bool OverLay { get; set; }

属性值

bool

Text

获取或设置显示单位标签的文本。

public override string Text { get; set; }

属性值

string

X

获取或设置图表区域左上角的 x 坐标,以 1/4000 单位表示。

public override int X { get; set; }

属性值

int

Y

获取或设置图表区域左上角的 y 坐标,以 1/4000 单位表示。

public override int Y { get; set; }

属性值

int

方法

Characters()

获取此标题的富文本格式。

public FontSetting[] Characters()

返回

FontSetting[]

返回 FontSetting 数组

 中文