Download the PHP package noeka/svgraph without Composer
On this page you can find all versions of the php package noeka/svgraph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download noeka/svgraph
More information about noeka/svgraph
Files in noeka/svgraph
Package svgraph
Short Description JavaScript-free SVG chart rendering for PHP. Sparkline, line/area, bar, pie/donut, and progress charts as static markup.
License MIT
Informations about the package svgraph
svgraph
JavaScript-free SVG chart rendering for PHP. Sparkline, line/area, bar, pie/donut, and progress charts as static markup — no canvas, no JS, no build step.
- Server-side: charts render to plain SVG strings, ready to echo into a template.
- Zero JavaScript: hover tooltips, keyboard focus, and animations are pure CSS.
- Themeable: built-in light/dark themes plus a full set of CSS custom properties.
- Accessible:
role="img"with labelled<title>/<desc>, screen-reader data table fallback, focusable points, link safety, reduced-motion aware. - Tiny: PSR-4, no runtime dependencies.
Requirements
- PHP 8.3+
Installation
Quick start
Every chart is Stringable — cast with (string) or drop directly
into a template with <?= ?>.
Chart gallery
| Sparkline |
Line / area |
Bar |
| Pie |
Donut |
Progress |
Click any chart for its full options reference and worked examples.
Theming
Full reference: docs/theming.md.
Multi-series
For bar charts, ->grouped() and ->stacked() pick how series share
each x-tick. See bar chart docs.
Legend (toggle series visibility)
Available on line and bar charts. Each legend entry is a <label> bound
to a hidden checkbox; clicking it hides that series and dims the entry.
Pure CSS — no JavaScript.
Caveats:
- State is page-local. Refreshing the page resets every toggle; without JS there is nowhere to persist it.
- Axes do not rescale. Hiding a tall series leaves the value axis at the original combined min/max, so the remaining series stay at their original positions on the canvas.
- Multiple charts on the same page get unique IDs automatically, so toggling one chart never affects another.
- Keyboard-accessible. The
<label>+ checkbox combo is natively focusable; pressing Space toggles the series.
Animations
All entrance animations sit inside @media (prefers-reduced-motion: no-preference),
so users who request reduced motion always see a static chart. Details:
docs/animations.md.
Documentation
- Getting started
- Data formats — every input shape (lists, tuples, maps,
Point/Series/Slice/Link) - Theming — themes, palettes, full token reference
- Annotations — reference lines, threshold bands, target zones, callouts
- Animations
- Accessibility
- CSS customization —
.series-{N}hooks,--svgraph-*properties - Recipes — Blade, Twig, email, caching
- docs/index.md — full table of contents
- Contributing — developer setup, tooling, workflow
Regenerating example images
The SVGs in docs/images/ are generated from the
runnable PHP scripts in examples/. Rebuild them after a
code change:
License
MIT — see LICENSE.