HotXLS ドキュメント

TXLSXChart と TXLSXCharts クラス

TXLSXCharts は TXLSXWorksheet.Charts が公開する埋め込みグラフのコレクションで、TXLSXChart がグラフの配置、軸、系列を管理します

宣言

function TXLSXCharts.Add: TXLSXChart; overload;
function TXLSXCharts.Add(AChartType: TXLSXChartType; const ATitle: WideString; AFromRow, AFromCol, AToRow, AToCol: Integer): TXLSXChart; overload;
function TXLSXChart.AddSeries(const AName, ACategories, AValues: WideString): TXLSXChartSeries;
function TXLSXChart.AddPlotGroup(AChartType: TXLSXChartType; AAxisGroup: TXLSXChartAxisGroup = xlsxAxisPrimary): TXLSXChartPlotGroup;
procedure TXLSXChart.ClearSeries;
procedure TXLSXChart.ClearPlotGroups;
procedure TXLSXChart.ClearPreservedXml;
property TXLSXChart.ChartType: TXLSXChartType;
property TXLSXChart.HasPreservedXml: Boolean;
property TXLSXChart.CategoryAxis, ValueAxis: TXLSXChartAxis;
property TXLSXChart.SecondaryCategoryAxis, SecondaryValueAxis: TXLSXChartAxis;
property TXLSXChart.SeriesAxis: TXLSXChartAxis;
property TXLSXChart.TitleTextStyle, LegendTextStyle: TXLSXChartTextStyle;
property TXLSXChart.PlotAreaLayout, TitleLayout, LegendLayout: TXLSXChartLayout;
property TXLSXChart.ShowLegend, TitleOverlay, LegendOverlay: Boolean;
property TXLSXChart.LegendPosition: TXLSXChartLegendPosition;
property TXLSXChart.Series[Index: Integer]: TXLSXChartSeries;
property TXLSXChart.PlotGroups[Index: Integer]: TXLSXChartPlotGroup;
property TXLSXChart.RadarStyle: TXLSXChartRadarStyle;
property TXLSXChart.HoleSize, FirstSliceAng: Integer;
property TXLSXChart.OfPieType: TXLSXChartOfPieType;
property TXLSXChart.OfPieSplitType: TXLSXChartOfPieSplitType;
property TXLSXChart.OfPieSplitPos, OfPieSecondPieSize, OfPieGapWidth: Integer;
property TXLSXChart.RoundedCorners, AutoTitleDeleted: Boolean;
property TXLSXChart.ChartBackgroundColor, ChartBorderColor, PlotAreaBackgroundColor: LongWord;
property TXLSXChart.ProtectionEnabled: Boolean;
property TXLSXChart.ProtectedChartObjects, ProtectedDataEditing, ProtectedFormatting, ProtectedSelection, ProtectedUserInterface: Boolean;
property TXLSXChart.ShowDataTableHorzBorder, ShowDataTableVertBorder, ShowDataTableOutline: Boolean;
property TXLSXChart.HasDropLines, HasSeriesLines: Boolean;
property TXLSXChart.OwnerSheet: TXLSXWorksheet;

グラフ メンバー

Title, CategoryAxisTitle and ValueAxisTitleグラフおよび主軸のキャプション テキスト
TitleTextStyle and TitleLayoutグラフタイトルのフォント、色、強調、回転、オーバーレイ、手動位置の型付き指定
ShowLegend, LegendPosition, LegendTextStyle and LegendLayout凡例の表示、位置、オーバーレイ、フォント、手動位置
PlotAreaLayout正規化された ChartML 座標による、プロット矩形の手動指定(内側または外側)
FromRow, FromCol, ToRow and ToCol1 始まりのワークシートアンカー矩形
CategoryAxis and ValueAxis主カテゴリ(X)軸と主数値(Y)軸
SecondaryCategoryAxis and SecondaryValueAxisセカンダリ プロットグループが使用する上軸と右軸
SeriesAxis3 次元カテゴリグラフで使用される奥行き軸
PlotGroupsSeries がフラットな互換ビューのままである一方で、複合グラフを可能にする順序付きのグラフファミリーグループ
HasPreservedXml拡張に対して安全な Roundtrip のために、グラフが元の ChartML を保持しているかどうかを報告します
ShowDataTable and ShowDataTableKeysデータテーブル表示の制御
ShowDataTableHorzBorder, ShowDataTableVertBorder and ShowDataTableOutlinec:showHorzBorder、c:showVertBorder、c:showOutline として出力される、データテーブル罫線の独立したスイッチ。3 つともデフォルトは True です
HasDropLines and HasSeriesLines折れ線グラフのドロップ ラインは各ポイントをカテゴリ軸に接続し、系列線は積み上げ棒または折れ線の系列セグメントを接続します
HasUpDownBars, UpDownGapWidth and HasHiLowLines線グラフと株価グラフの表示制御
Rotation3DX, Rotation3DY, Elevation3D, Perspective3D and RightAngleAxes3D3 次元グラフのビュー制御
HeightPercent3D, DepthPercent3D and GapDepth3D3 次元プロットの高さ、奥行き、系列間隔のパーセント
RadarStyle現在のグラフ種別に対するレーダーチャートファミリーのバリエーション
HoleSize and FirstSliceAngドーナツの内径の割合(10..90)と、円およびドーナツグラフの開始角度(度単位)
OfPieType, OfPieSplitType, OfPieSplitPos, OfPieSecondPieSize and OfPieGapWidthPie-of-Pie と Bar-of-Pie のレイアウト、分割ルール、主プロットとセカンダリ プロットのサイズ
RoundedCornersグラフ領域の角丸の切り替え
AutoTitleDeleted単一系列名から導かれる自動タイトルを抑制し、c:autoTitleDeleted を出力します
ChartBackgroundColor, ChartBorderColor and PlotAreaBackgroundColor$RRGGBB 値によるグラフとプロットエリアの塗りつぶしおよび罫線の色。0 はテーマの既定値を維持します
ProtectionEnabled, ProtectedChartObjects, ProtectedDataEditing, ProtectedFormatting, ProtectedSelection and ProtectedUserInterfaceグラフ保護スイッチと、c:protection として出力される個々の編集制限
OwnerSheetこのグラフを所有するワークシートへの読み取り専用参照

グラフの種類と組み合わせグループ

TXLSXChartType には、縦棒、横棒、折れ線、円、面、ドーナツ、散布図、バブル、レーダー、株価、Of-Pie、サーフェス、3D サーフェス、3D 縦棒、3D 横棒、3D 折れ線、3D 円、3D 面の各ファミリーが含まれます
最初のプロットグループは ChartType と AddSeries で制御される互換グループです 追加のグループは AddPlotGroup で追加でき、xlsxAxisPrimary と xlsxAxisSecondary のどちらも使用できます

系列、近似曲線、誤差範囲

function TXLSXChartSeries.AddTrendline(AType: TXLSXChartTrendlineType): TXLSXChartTrendline;
function TXLSXChartSeries.AddErrorBar(ADir: TXLSXChartErrDir): TXLSXChartErrBar;
property TXLSXChartSeries.Trendlines[Index: Integer]: TXLSXChartTrendline;
property TXLSXChartSeries.ErrBarX, ErrBarY: TXLSXChartErrBar;
property TXLSXChartTrendline.TrendlineType: TXLSXChartTrendlineType;
property TXLSXChartTrendline.DispEq, DispRSqr: Boolean;
property TXLSXChartTrendline.Order, Period: Integer;
property TXLSXChartErrBar.ValueType: TXLSXChartErrValType;
property TXLSXChartErrBar.Value, PlusValue, MinusValue: Double;
TrendlineType線形、指数、対数、多項式、べき乗、移動平均の近似曲線
DispEq and DispRSqrグラフに数式と R 二乗値を表示します
Order and Period対応する近似曲線の種別における、多項式の次数または移動平均の期間
ValueType固定値、割合、標準偏差、標準誤差、カスタムの誤差値
NoEndCap誤差範囲の両端のキャップを非表示にします

軸とデータラベルのメンバー

LogBase and Orientation対数スケールの底と、通常または反転した軸の順序
MajorGridlines and MinorGridlines目盛線の表示制御
MinValue, MaxValue, MajorUnit and MinorUnitサポートされている場合の、明示的なスケール境界と目盛間隔
CrossesAt, TickLblPos and DispUnits軸の交差位置、ラベルの配置、表示単位
ShowValue, ShowCategoryName, ShowSeriesName, ShowLegendKey, ShowPercent and ShowBubbleSize系列ごとのデータラベル要素
Separator複数のデータラベル要素の間に表示されるテキスト

未対応 ChartML の保持

TXLSXWorkbook.PreserveUnsupportedParts が有効な場合(これがデフォルトです)、インポートしたグラフは元の ChartML を保持します 手を加えていないグラフはその XML を正規化なしでそのまま再生し、型付きプロパティへの変更は、生成された HotXLS モデルを元のツリーにオーバーレイします
不明な名前空間、markup-compatibility の AlternateContent、拡張リスト、カスタム スタイル、モデル化されていない書式は、既知のプロパティの編集中も元のグラフオブジェクトに付いたままです ClearPreservedXml を呼び出すと、1 つのグラフについてこの保持された XML を破棄し、型付きプロパティだけから再生成します

例

var
  Chart: TXLSXChart;
  Secondary: TXLSXChartPlotGroup;
begin
  Chart := Sheet.Charts.Add(xlsxChartLine, 'Monthly sales', 2, 5, 18, 12);
  Chart.AddSeries('Sales', 'Sheet1!$A$2:$A$13', 'Sheet1!$B$2:$B$13');
  Chart.ValueAxisTitle := 'Amount';
  Chart.TitleTextStyle.Name := 'Aptos Display';
  Chart.TitleTextStyle.Size := 18;
  Chart.TitleTextStyle.Bold := True;
  Chart.PlotAreaLayout.Target := xlsxChartLayoutInner;
  Chart.PlotAreaLayout.SetPositionAndSize(0.12, 0.18, 0.72, 0.64);
  Chart.ShowLegend := True;
  Chart.LegendPosition := xlsxChartLegendBottom;
  Chart.LegendTextStyle.Size := 10;
  Secondary := Chart.AddPlotGroup(xlsxChartColumn, xlsxAxisSecondary);
  Secondary.AddSeries('Margin', 'Sheet1!$A$2:$A$13', 'Sheet1!$C$2:$C$13');
  Chart.SecondaryValueAxis.Title := 'Margin percent';
  Chart.Series[0].AddTrendline(xlsxTrendLinear).DispRSqr := True;
  Chart.Series[0].ShowValue := True;
end;

関連項目