Image & Canvas
canvasChartPie
$canvasChartPie
Draws a pie chart from semicolon-separated data values with automatic color palette fallback
Syntax
$canvasChartPie[x;y;radius;data;colors;labels?;startAngle?;container?]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| x | integer | check_circle Required | — | Center X coordinate |
| y | integer | check_circle Required | — | Center Y coordinate |
| radius | integer | check_circle Required | — | Chart radius in pixels |
| data | string | check_circle Required | — | Semicolon-separated numeric values (e.g. "30;50;20"). Each value becomes a slice proportional to the total. |
| colors | string | check_circle Required | — | Semicolon-separated hex colors (e.g. "E53935;1E88E5;43A047"). Uses a 12-color palette fallback for unspecified slices. |
| labels | string | Optional | — | Semicolon-separated labels (accepted but not rendered by the runtime) |
| startAngle | number | Optional |
-90
|
Starting angle in degrees (-90 = top/12 o'clock) |
| container | string | Optional | — | Container name |
Return Value
canvas
Modifies the canvas in-place. Each slice is drawn as a filled polygon from the center.
Each data value is converted to a slice proportional to the sum of all values. If you provide fewer colors than data values, the runtime cycles through a built-in 12-color palette. Labels are accepted syntactically but are not drawn by the current runtime — they exist for forward compatibility. The default startAngle of -90° places the first slice at the 12 o’clock position.
Examples
Activity breakdown
$canvasChartPie[200;200;120;45;30;25;E53935;1E88E5;43A047]
Custom start angle
$canvasChartPie[150;150;80;60;40;FFD700;8E24AA;;0]