Chart

Dependency-free SVG chart component supporting bar and line types with tooltips, axis labels, and optional goal lines.

Bar Chart

Steps
0310062009300 MonTueWedThuFriSatSun Goal

Line Chart

Revenue
084671693325400 JanFebMarAprMayJun
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->chart($id)stringCreate a chart component.
->type($type)stringChart type: bar or line.
->labels($labels)arrayX-axis category labels.
->series($name, $values, $color)string, array, ?stringAdd a data series. $color defaults to #2196F3.
->width($w)intSVG viewBox width in px (default: 640, min: 240).
->height($h)intSVG viewBox height in px (default: 220, min: 140).
->yMax($max)?floatOverride the automatic Y-axis maximum.
->goal($value, $color, $label)float, ?string, ?stringDraw a horizontal goal/target line.