Pictorial.
COMMUNITYExpress state through the filled portion of a familiar shape.
LIVE EXAMPLE
Completion status
Appearance and style2
Axes and grid lines17
Legend and interaction13
Title and dimensions3
Fill image areas with values on a shared scale. All values are sample data.
View code
<div id="chart-container" style="width: 100%; min-width: 0;"></div>
<script type="module">
import { defineCustomElement as define0 } from '@syidax/advanced/components/sy-pictorial-chart.js';
define0();
const specs = [
{
"id": "example-chart",
"tag": "sy-pictorial-chart",
"props": {
"engine": "standard",
"values": [65, 80, 45],
"categories": ["A", "B", "C"],
"width": 640,
"height": 360,
"brandPosition": "bottom-right",
"brandLogo": ""
}
}
];
const container = document.querySelector('#chart-container');
const elements = specs.map(({ tag, id, props }) => {
const element = document.createElement(tag);
element.id = id;
Object.assign(element, props);
element.setAttribute('aria-label', 'pictorial example chart');
return element;
});
container.replaceChildren(...elements);
const chart = elements.at(-1);
const onEvent = event => {
console.log('pointClick', event.detail);
};
chart.addEventListener('pointClick', onEvent);
const observer = new ResizeObserver(([entry]) => {
const width = Math.max(160, Math.floor(entry.contentRect.width));
elements.forEach(element => { element.width = width; });
});
observer.observe(container);
// In an SPA, call this function when the view is disposed.
function disposeChart() {
observer.disconnect();
chart.removeEventListener('pointClick', onEvent);
container.replaceChildren();
}
</script>Usage and data
#Use in dashboards and infographics explaining a small number of metrics.
Readers may confuse area with height. Include numeric values and units.
Data contract
| Property | Input format |
|---|---|
values | Numeric values for each item. |
categories | Category names for the shapes. |
Updating data
Assign a new array or object to the property instead of mutating values inside an array. Chart events provide selection results through event.detail. When disposing of the view, clean up ResizeObserver and event listeners registered by your app.
Feature examples
#Try 19 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.
Full-capacity background
Contrast the icon's full area with the filled amount.
View code
Icon spacing
Reduce icon spacing for a denser display.
View code
Inspect values with the pointer
Point to data to view the value at that location.
View code
Crosshair tracking
Move the pointer to read horizontal and vertical coordinates alongside values.
View code
Drag to zoom and pan
Drag to zoom and hold Shift to pan. Use Ctrl + wheel to zoom in or out.
View code
Replay animation
Redraw the same example to inspect its initial display animation.
View code
Animation
Compare 1 examples of Animation. Buttons and options update both the live result and source code.
View code
Axis
Compare 7 examples of Axis. Buttons and options update both the live result and source code.
View code
Crosshair
Compare 5 examples of Crosshair. Buttons and options update both the live result and source code.
View code
Large datasets
Compare 1 examples of Large datasets. Buttons and options update both the live result and source code.
View code
Size
Compare 1 examples of Size. Buttons and options update both the live result and source code.
View code
Tooltip
Compare 12 examples of Tooltip. Buttons and options update both the live result and source code.
View code
Data input
Compare 1 examples of Data input. Buttons and options update both the live result and source code.
View code
Zoom and pan
Compare 6 examples of Zoom and pan. Buttons and options update both the live result and source code.
View code
Context menu
Compare 1 examples of Context menu. Buttons and options update both the live result and source code.
View code
Data context menu
Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.
View code
Read coordinates and data
Compare 1 examples of Read coordinates and data. Buttons and options update both the live result and source code.
View code
Overview
Compare 3 examples of Overview. Buttons and options update both the live result and source code.
View code
Streaming · Add and update live dataPRO
Compare 3 examples of Add and update live data. Buttons and options update both the live result and source code.
View code
Add to your interface
#The code tabs below the preview contain the full data, options, event bindings, and responsive sizing for the current example. Copy them into an app project, such as Vite, that can resolve the installed packages.
API reference
#The full public API for sy-pictorial-chart. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.
Key properties
| Attribute / Property | Type / Default | Description |
|---|---|---|
PictorialChartValuesDefault: new Float32Array(0) | Numeric values for each item. | |
ReadonlyArray<string>Default: undefined | Category names for the shapes. | |
numberDefault: 640 | Chart width in pixels. Update with ResizeObserver when the container changes. | |
numberDefault: 360 | Chart height in pixels. | |
| brandLogo | stringDefault: undefined | The default is the Syidax logo. With the Pro chart.branding entitlement, use none or a PNG, JPEG, or WebP data URL. |
| brandPosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'Default: 'bottom-right' | The corner where the logo is anchored. Applies equally to Community and Pro, on screen and in image exports. |
| iconPadding | numberDefault: 0.1 | Fraction of each band kept as whitespace around its icon, 0..0.9. |
| trackOpacity | numberDefault: 0.16 | Opacity of the unfilled remainder silhouette (0 hides the track). |
| xLabelMode | 'auto' | 'all' | 'thin' | 'rotate' | 'none'Default: undefined | How crowded category-axis labels are decluttered. Default 'auto' thins labels horizontally. |
| xLabelRotation | numberDefault: undefined | Explicit category-label rotation in degrees (respected as a floor). |
| valueAxisLabel | stringDefault: undefined | Set as an HTML attribute or JavaScript property. type: string. |
| xAxis | CartesianAxisInput | ReadonlyArray<CartesianAxisInput>Default: undefined | The category axis, or slot array — slot 0 is the category axis (its `show` / `label` / `position` / `format` apply); later slots are linked relabels or their own kinds. |
| yAxis | CartesianAxisInput | ReadonlyArray<CartesianAxisInput>Default: undefined | The value axis, or slot array — slot 0 (left) carries `value-axis-label` unless it names its own; a user `kind: 'log'` wins; later slots relabel (linked) or bring their own min / max. |
| gridLines | CartesianGridLinesInputDefault: undefined | Allowed values: auto, off. Default: undefined. |
CartesianCrosshairInputDefault: undefined | Crosshair that follows the cursor across the plot. `true`/`'auto'` enables a snapping line; pass an object to set mode/snap/color/dash. | |
CartesianZoomInputDefault: undefined | Settings for zooming and the visible range. | |
| chartTitle | stringDefault: undefined | The title inside the chart. Explain the data's unit and meaning alongside it. |
| chartSubtitle | stringDefault: undefined | The subtitle inside the chart. |
| tooltipEnabled | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
CartesianTooltipInputDefault: undefined | Tooltip settings for pointer-driven values, position, and content. | |
| animated | booleanDefault: false | Whether to animate initial display and data changes. |
| animationDuration | numberDefault: 600 | Animation duration in milliseconds. |
| animationEasing | PictorialChartEasingDefault: 'ease-out' | Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'. |
| animationType | PictorialChartAnimationTypeDefault: undefined | Allowed values: initial, update. Default: undefined. |
Other properties 11
| Attribute / Property | Type / Default | Description |
|---|---|---|
string | ReadonlyArray<string>Default: '#2563eb' | Icon fill colour. Accepts a single CSS colour, an array, or a comma-separated string — one colour applies to every icon; a list cycles per icon. | |
ReadonlyArray<string>Default: undefined | SVG path definitions the icons cycle through per category (Highcharts `paths`). Property-only. Default: the person silhouette. | |
| xLabelMaxCount | numberDefault: undefined | Hard cap on the number of category labels shown. |
| tooltipFormat | (detail: PictorialChartPointerEventDetail) => stringDefault: undefined | Pass as a JavaScript property. type: (detail: PictorialChartPointerEventDetail) => string. |
| enableMouseTracking | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| streamSource | PictorialChartStreamSourceDefault: undefined | A stream source for live data. Check the contract for the specific type. |
| streamWindow | numberDefault: undefined | The streaming data range to keep visible. |
| streamMax | numberDefault: undefined | The maximum number of streaming data points to retain. |
PictorialChartEngineModeDefault: 'auto' | Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type. | |
| proThreshold | numberDefault: 50_000 | Set as an HTML attribute or JavaScript property. type: number. |
PictorialChartUnavailableBehaviourDefault: 'fallback' | Allowed values: fallback, error, throw. Default: 'fallback'. |
Events 15
| Events | Detail type | Description |
|---|---|---|
PictorialChartRenderResult & { tier: PictorialChartEngineTier } | Emits rendering results in detail when chart drawing completes. | |
PictorialChartPointerEventDetail | A point selection event. Read the selected data and index from CustomEvent.detail. | |
PictorialChartPointerEventDetail | null | CustomEvent.detail type: PictorialChartPointerEventDetail | null. Event names are case-sensitive. | |
CartesianCrosshairEventDetail | null | CustomEvent.detail type: CartesianCrosshairEventDetail | null. Event names are case-sensitive. | |
ChartPointContextMenuEventDetail<PictorialChartPointerEventDetail> | CustomEvent.detail type: ChartPointContextMenuEventDetail<PictorialChartPointerEventDetail>. Event names are case-sensitive. | |
{ count: number } | CustomEvent.detail type: { count: number }. Event names are case-sensitive. | |
{ dropped: number } | CustomEvent.detail type: { dropped: number }. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
CartesianTooltipEventDetail | Whether to display the built-in tooltip. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
CartesianTooltipActionEventDetail | CustomEvent.detail type: CartesianTooltipActionEventDetail. Event names are case-sensitive. | |
CartesianSeriesOutsideClickEventDetail | CustomEvent.detail type: CartesianSeriesOutsideClickEventDetail. Event names are case-sensitive. | |
CartesianZoomChangeEventDetail | Fired after every zoom change (drag / pan / wheel / pinch / keyboard / api / reset) with the new state. |
Methods 22
Stencil methods return Promises. Use await within an async function to read the result.
| Method / Arguments | Return type | Description |
|---|---|---|
Promise<PictorialChartRenderResult> | An asynchronous method. Check the argument and return types below. | |
Promise<PictorialChartEngineTier> | An asynchronous method. Check the argument and return types below. | |
| values: PictorialChartValues | Promise<void> | An asynchronous method. Check the argument and return types below. |
| datum: PictorialBarDatum | number | Promise<void> | An asynchronous method. Check the argument and return types below. |
| data: ReadonlyArray<PictorialBarDatum | number> | Promise<void> | An asynchronous method. Check the argument and return types below. |
| count: number | Promise<void> | An asynchronous method. Check the argument and return types below. |
| data: ReadonlyArray<PictorialBarDatum | number> | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<PictorialChartStreamSource | undefined> | An asynchronous method. Check the argument and return types below. | |
| options: { duration?: number; easing?: PictorialChartEasing; enabled?: boolean; type?: PictorialChartAnimationType } | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| cssX: number, cssY: number | Promise<PictorialChartPointerEventDetail | null> | An asynchronous method. Check the argument and return types below. |
| index: number | Promise<CartesianTooltipEventDetail | null> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| request: CartesianZoomRequest | Promise<CartesianZoomChangeEventDetail | null> | Zoom to explicit windows: `x` / `y` as `{ min, max }` or `[min, max]` (`null` clears that orientation); `xAxis` / `yAxis` name the axis by id or slot index. |
| factor: number, anchorFraction?: number | Promise<CartesianZoomChangeEventDetail | null> | Scale the current windows by `factor` (< 1 zooms in) around `anchorFraction` (0..1, default centre). |
| delta: { x?: number; y?: number } | Promise<CartesianZoomChangeEventDetail | null> | Slide the zoomed windows by data units (`{ x?, y? }`); a no-op at the full extent. |
Promise<CartesianZoomChangeEventDetail | null> | Back to the full extent. | |
Promise<CartesianZoomState | null> | The current zoom state (`null` = full extent). | |
| request?: CartesianZoomExtentRequest | Promise<CartesianZoomExtentDetail | null> | The full extent (and key) of the primary — or the named — master axes (`null` before the first layout). |
Promise<ChartEngineStatus> | Requested engine vs what runs, and why (CHART-ADD-08): always Standard (this type has no WebGPU renderer); read without side effects, never consults the license. |
No matching APIs.