Chart
Dependency-free SVG chart component supporting bar and line types with tooltips, axis labels, and optional goal lines.
Bar Chart
Line Chart
Revenue
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->chart($id) | string | Create a chart component. |
->type($type) | string | Chart type: bar or line. |
->labels($labels) | array | X-axis category labels. |
->series($name, $values, $color) | string, array, ?string | Add a data series. $color defaults to #2196F3. |
->width($w) | int | SVG viewBox width in px (default: 640, min: 240). |
->height($h) | int | SVG viewBox height in px (default: 220, min: 140). |
->yMax($max) | ?float | Override the automatic Y-axis maximum. |
->goal($value, $color, $label) | float, ?string, ?string | Draw a horizontal goal/target line. |