Image & Canvas
canvasChartLine
$canvasChartLine
Draws a line chart with optional area fill and data point markers
Syntax
$canvasChartLine[x;y;width;height;data;color;lineWidth?;fill?;showPoints?;pointRadius?;container?]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| x | integer | check_circle Required | — | Top-left X of chart area |
| y | integer | check_circle Required | — | Top-left Y of chart area |
| width | integer | check_circle Required | — | Chart area width |
| height | integer | check_circle Required | — | Chart area height |
| data | string | check_circle Required | — | Semicolon-separated numeric values (minimum 2 values required) |
| color | color | check_circle Required | — | Line (and point) color |
| lineWidth | integer | Optional |
2
|
Line thickness in pixels |
| fill | boolean | Optional |
false
|
true = fill the area under the line with a semi-transparent version of the line color |
| showPoints | boolean | Optional |
true
|
true = draw circles at each data point |
| pointRadius | integer | Optional |
3
|
Radius of data point markers |
| container | string | Optional | — | Container name |
Return Value
canvas
Modifies the canvas in-place.
At least 2 data values are required to draw a line. The chart auto-scales vertically based on the maximum value in the dataset. When fill is true, the area under the line is filled with a semi-transparent version of the line color, creating an area chart effect. Data points are rendered as small circles at each data position; disable them with showPoints:false for a cleaner look.
Examples
Simple line chart
$canvasChartLine[20;30;400;200;10;45;30;60;25;1E88E5;3;true]
Without data points
$canvasChartLine[50;50;350;150;5;12;8;20;15;E53935;2;false;false]