HotXLS 文档

TXLSXChartTextStyle 类

TXLSXChartTextStyle 控制图表标题、图例标签、坐标轴标题和坐标轴刻度线标签的 DrawingML 文本属性

声明

type
  TXLSXChartTextStyle = class
    property Name: WideString;
    property Size: Double;
    property Color: LongWord;
    property HasColor: Boolean;
    property Bold, Italic, Underline, Strikeout: Boolean;
    property Rotation: Double;
    procedure Assign(Source: TXLSXChartTextStyle);
    procedure Clear;
    procedure ClearColor;
    function IsDefault: Boolean;
  end;

属性

Name拉丁字体名称或主题字体标记
Size磅值,为 0 时继承图表主题
Color and HasColor显式 RGB 文本颜色及其存在标志
Bold, Italic, Underline and Strikeout以 DrawingML 字符属性写入的强类型强调样式开关
Rotation以度数表示的文本旋转角度,按 DrawingML 原生角度单位序列化

用法

图表拥有的实例可通过 TitleTextStyle 和 LegendTextStyle 访问。坐标轴拥有的实例可通过 TextStyle 和 TitleTextStyle 访问
ClearColor 将颜色选择恢复为图表主题,而不更改其他文本属性。Clear 将完整样式恢复为继承的默认值

示例

Chart.TitleTextStyle.Name := 'Aptos Display';
Chart.TitleTextStyle.Size := 18;
Chart.TitleTextStyle.Color := $204080;
Chart.TitleTextStyle.Bold := True;
Chart.CategoryAxis.TextStyle.Rotation := -45;

请参阅