Turinys

Title : WideString;

TXLSChartSeriesInfo = Name : WideString; Categories : WideString; Values : WideString; Five overloads cover progressively richer chart-sheet definitions: function const TXLSCustomChartfunction SaveAs(xlExcel97)const

function

const lxHTitle : WideString;le Title: WideString): function;
type
  TXLSChartType = (
    xlsChartTypeColumn,
    xlsChartTypeBar,
    xlsChartTypeLine,
    xlsChartTypePie);

function

const Categories Title : WideString; Values CatAxisTitle: WideString; 'Sheet1!$B$2:$B$5')
type
  TXLSChartSeriesInfo = record
    Name        : WideString;
    Categories  : WideString;
    Values      : WideString;
  end;

// 5) v2.42.0 — + array of series (Name + Categories range + Values range).

AddChartSheet(
// 1) v2.41.0 — name only; default column chart, no titles, no series.
function AddChartSheet(const Name: WideString): function;

// 2) v2.41.0 — name + chart type.
function AddChartSheet(
  const Name : WideString;
  ChartType   : TXLSChartType): function;

// 3) v2.41.0 — + chart title.
function AddChartSheet(
  const Name : WideString;
  ChartType   : TXLSChartType;
  const Title: WideString): function;

// 4) v2.41.0 — + category-axis title + value-axis title.
function AddChartSheet(
  const Name       : WideString;
  ChartType         : TXLSChartType;
  const Title      : WideString;
  const CatAxisTitle: WideString;
  const ValAxisTitle: WideString): function;

// 5) v2.42.0 — + array of series (Name + Categories range + Values range).
function AddChartSheet(
  const Name        : WideString;
  ChartType          : TXLSChartType;
  const Title       : WideString;
  const CatAxisTitle: WideString;
  const ValAxisTitle: WideString;
  const Series      : array of TXLSChartSeriesInfo): function;

const

The emitted chart substream covers the BIFF8 framing the spec calls for — BOF (dt=$0020), Chart / PlotGrowth / Frame / Series / SheetProperties / AxesUsed / AxisParent (POS + category axis + value axis + PlotArea + Frame + ChartFormat + chart-kind record + ChartFormatLink + Legend), EOF. Existing chart-sheet round-trip via TXLSCustomChart const

Series :TXLSChartSeriesInfo): function; Series[i].Name const tStr TXLSChartSeriesInfo): function; BRAI (id=2). Excel uses this label in the legend Title : WideString; series selector, so multi-series charts show proper captions instead of the default "Series1 / Series2" placeholders

A1-range strings are compiled into realA1-range strings are compiled into real Categories Title : WideString; Values 'Data' tArea3D 'Data!$A$2:$A$5' cce=0 Series: Categories / Values begin

Workbook.Sheets[ function 'Data' Sheets collection Title : WideString; gets a chart-sheet boundsheet entry written on save. Cell-level methods on the result are unsupported — the host worksheet is a chart container, not a data sheet

'Quarterly Revenue'

'Data!$A$2:$A$5'

var
  Series: array of TXLSChartSeriesInfo;
begin
  // Populate cells on Sheet1.
  Workbook.Sheets[1].Name := 'Data';
  // ... fill A1:B5 with categories + values ...

  SetLength(Series, 1);
  Series[0].Name       := 'Quarterly Revenue';
  Series[0].Categories := 'Data!$A$2:$A$5';
  Series[0].Values     := 'Data!$B$2:$B$5';

  Workbook.Sheets.AddChartSheet(
    'Revenue',
    xlsChartTypeColumn,
    'Quarterly Revenue',
    'Quarter',
    'USD',
    Series);

  Workbook.SaveAs('Revenue.xls', xlExcel97);
end;

].Values :=

Per-chart-type formatting details (gap width, bar overlap, pie hole size, marker style) are still emitted at the chart-builder defaults — not yet exposed on the API. Save-Title : WideString;-reopen with Excel preserves the Name : WideString; Categories : WideString; Values : WideString;'s presence, kind, title, axis titles, series captions, Title : WideString; (from v2.47.0) the series data binding

'Quarterly Revenue'