Atelier

AtelierChart

Accessible SVG charts in PHP.

Clean server-side charts from typed PHP models. Builders validate the data, Atelier Layout computes the geometry, and Atelier SVG produces a responsive document without JavaScript, a browser, or an external binary.

Quarterly revenue202520260204060Q1Q2Q3Q41832244226243835
A grouped bar chart rendered directly from an immutable model, with semantic labels and responsive SVG geometry.

Features

  • Fourteen chart families
    Bars, lines, areas, radar, pie, donut, scatter, bubble, stacked and diverging bars, gauges, sparklines, activity, and strips share one API.
  • Typed, immutable models
    Builders validate friendly input and return chart semantics without renderer details, ready for SVG or another renderer.
  • Accessible by default
    Titles, descriptions, essential labels, responsive view boxes, and semantic SVG structure remain available without hover.

Build a chart

use Atelier\Chart\Chart;

$model = Chart::bar()
    ->title('Quarterly revenue')
    ->description('Revenue by quarter for 2025 and 2026, in millions.')
    ->series('2025', ['Q1' => 18, 'Q2' => 32, 'Q3' => 24, 'Q4' => 42])
    ->series('2026', ['Q1' => 26, 'Q2' => 24, 'Q3' => 38, 'Q4' => 35])
    ->build();

echo Chart::render($model);

The same model can return an Atelier SVG document for composition into a larger drawing:

$document = Chart::renderDocument($model);

Composition and point charts

use Atelier\Chart\Chart;

$share = Chart::donut()
    ->title('Traffic sources')
    ->slice('Direct', 42)
    ->slice('Search', 31)
    ->slice('Referral', 18)
    ->build();

$markets = Chart::bubble()
    ->title('Market opportunities')
    ->axes('Growth %', 'Margin %')
    ->series('Markets', [
        ['x' => 18, 'y' => 62, 'size' => 420],
        ['x' => 28, 'y' => 54, 'size' => 270],
    ])
    ->build();

Bubble values are interpreted as areas, and smooth lines use monotone cubic interpolation so curves pass through every observation without overshooting.

Line and point charts fit their scale to the data by default. Fixed domains, custom display formatters, derived themes, generated data descriptions, and wrapped legends are available when the chart needs stricter presentation constraints.

Source and requirements

Requires PHP 8.3 or later, Atelier Layout, and Atelier SVG.

View Chart on GitHub.

Documentation

Foundations

Comparison and change

Composition and relationships

Specialized views