Native Vector Charts

THPDFChart combines data series, axes, themes, legends, labels, and accessibility text into a reusable chart model rendered by THPDFPage.DrawChart

The renderer emits PDF path and text operators directly, so charts remain sharp at any zoom level and do not create Image XObjects

Chart model

THPDFChart owns its THPDFChartSeries instances and its two THPDFChartAxis objects, while each series grows point storage geometrically for amortised constant-time append

Call THPDFChart.AddSeries with a THPDFChartKind value, then add finite coordinates through THPDFChartSeries.AddPoint

THPDFChart.ClearSeries releases all owned series, while THPDFChartSeries.Clear retains the series configuration and removes only its points

The SeriesCount, Series, Count, and Points properties provide indexed read access to the model

Series and axes

Line, bar, area, and scatter series can share one Cartesian plot, while a pie chart must contain exactly one hckPie series

THPDFChartAxis.AutomaticMinimum and AutomaticMaximum select data-driven bounds; disabling either property activates its corresponding Minimum or Maximum value

TickCount is clamped to 2 through 20 at render time, ShowGrid controls axis grid lines, and NumberFormat supplies the numeric format for ticks and generated labels

Appearance and labels

THPDFChartTheme selects hctLight, hctDark, or hctMonochrome palettes

THPDFChartLegendPosition selects no legend, a right legend, or a bottom legend through hclNone, hclRight, and hclBottom

Each series exposes Name, Kind, Color, LineWidth, ShowMarkers, ShowLabels, and labeled THPDFChartPoint data

Set Color to a real TColor for an explicit series color or leave the default value to use the active palette

Accessibility

THPDFChart.BuildAccessibleText returns explicit AlternativeText when present or builds a bounded title, series, label, X, and Y summary, with independent point and byte limits

Pass a structure parent to the extended DrawChart overload to wrap the complete chart in a tagged Figure with an Alt entry and layout bounding box

The structure parent should normally be a Document, Sect, or figure-containing layout element created for the current page

Budgets and statistics

THPDFChartRenderOptions.Default permits 64 series, 100,000 points per series, 1,000,000 total points, 512 visible labels, 64 points in generated accessibility text, and 8,192 accessibility bytes

Invalid geometry, non-finite coordinates, mixed pie content, and exceeded series or point budgets raise an exception before drawing begins

THPDFChartRenderStatistics reports rendered series, points, labels, path segments, figure tagging, and label truncation

The validation and rendering passes are linear in the number of series and points, with bounded label and accessibility work

Support types

The public surface comprises THPDFChartKind, THPDFChartTheme, THPDFChartLegendPosition, THPDFChartPoint, THPDFChartSeries, THPDFChartAxis, THPDFChart, THPDFChartRenderOptions, and THPDFChartRenderStatistics

Example

Chart := THPDFChart.Create;
try
  Chart.Title := 'Quarterly revenue';
  Chart.XAxis.Title := 'Quarter';
  Chart.YAxis.Title := 'Revenue';
  Chart.Theme := hctLight;

  SeriesItem := Chart.AddSeries(hckBar, 'North');
  SeriesItem.ShowLabels := True;
  SeriesItem.AddPoint(1, 120, 'Q1');
  SeriesItem.AddPoint(2, 175, 'Q2');
  SeriesItem.AddPoint(3, 164, 'Q3');

  Options := THPDFChartRenderOptions.Default;
  Document.CurrentPage.DrawChart(
    Chart, 48, 72, 500, 320, Options, Statistics
  );
finally
  Chart.Free;
end;

See also: THPDFPage.DrawChart, Vector Graphics Overview, Automatic PDF/UA Structure