
fastchart 0.2.0: native PHP charting extension with 19 chart types, plus Code 128 and QR codes
I maintain a handful of native PHP extensions. fastchart is the newest. 0.2.0 just landed.
The problem. PHP server-side charting is in rough shape. JpGraph hasn't seen meaningful work in years. pChart is abandoned. The common workaround is a Node or Python sidecar microservice that exists just to render PNGs. For OHLC plus indicator panes there isn't a serious PHP-native option at all.
Some history. In 2006 Rasmus and I shipped PECL/GDChart, a binding for the gdchart library. It died with its upstream in 2007. Since then I've built about six private PHP chart extensions, each solving exactly one need (a QR variant, OHLC for a dashboard, a couple of chart types). None shipped. fastchart is the consolidation.
What's in it:
- 19 chart classes: Line, Area, Bar, Scatter, Bubble, Pie, Stock, Radar, Polar, Surface, Contour, Gauge, Gantt, BoxPlot, Treemap, Funnel, Waterfall, Heatmap, LinearMeter
- StockChart with 7 candle styles (CANDLE / BAR / DIAMOND / I_CAP / HOLLOW / VOLUME / VECTOR), SMA/EMA/WMA overlays, plus RSI / MACD / Bollinger Bands / Parabolic SAR / Stochastic / OBV indicator panes
- A parallel Symbol family (new in 0.2.0): Code 128 (ISO/IEC 15417, auto subset switching, mod-103 checksum) and QR Code (ISO/IEC 18004, ECC L/M/Q/H, versions 1-40, vendored nayuki encoder)
- Output to PNG, JPEG, WebP, AVIF, GIF
- 105 public methods, 86 phpt tests, PHP 8.3+ (NTS or ZTS), BSD 3-Clause
Install via PIE:
pie install iliaal/fastchart
Requires ext-gd (PHP's bundled GD extension); fastchart renders through gd.
Repo: https://github.com/iliaal/fastchart
Full writeup with the StockChart indicator stack and the composition pattern: https://ilia.ws/blog/fastchart-0-2-0-native-php-charts-barcodes-and-qr-codes-in-one-extension
Open to feedback on chart types worth adding next and on the StockChart indicator set.