Item.
COMMUNITYShow counts with repeated symbols.
LIVE EXAMPLE
Seat composition
Appearance and style9
Legend and interaction12
Title and dimensions3
Represent one unit with one symbol. 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-item-chart.js';
define0();
const specs = [
{
"id": "example-chart",
"tag": "sy-item-chart",
"props": {
"engine": "standard",
"values": [
{
"name": "Product A",
"value": 42,
"color": "#8263d9"
},
{
"name": "Product B",
"value": 28,
"color": "#239c91"
},
{
"name": "Product C",
"value": 18,
"color": "#e99954"
},
{
"name": "Other",
"value": 12,
"color": "#d76c8f"
}
],
"legend": true,
"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', 'item 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
#Represent whole-number counts such as seats, people, or individual items.
Not suitable for precise fractional comparisons. Explain what each symbol represents.
Data contract
| Property | Input format |
|---|---|
values | An array of { name, value, color? }. value is the symbol count. |
symbol | circle, square, or diamond. |
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 17 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.
Set the row count
Arrange items in four rows for comparison.
View code
Marker shape
Show composition using square symbols.
View code
Inspect values with the pointer
Point to data to view the value at that location.
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
Legend
Compare 2 examples of Legend. 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-item-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 |
|---|---|---|
ItemChartValuesDefault: [] | An array of { name, value, color? }. value is the symbol count. | |
numberDefault: 520 | Chart width in pixels. Update with ResizeObserver when the container changes. | |
numberDefault: 400 | 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. |
ItemChartSymbolDefault: 'circle' | circle, square, or diamond. | |
numberDefault: undefined | Explicit concentric ring count; auto (smallest that fits) when unset. | |
| itemPadding | numberDefault: 0.1 | 0..0.9 — fraction of each cell kept as whitespace around its dot (Highcharts itemPadding). |
| startAngle | numberDefault: -100 | Degrees, 0 = 12 o'clock, clockwise. Default −100…100 = parliament hemicycle. |
| endAngle | numberDefault: 100 | Set as an HTML attribute or JavaScript property. type: number. |
| centerText | stringDefault: undefined | Set as an HTML attribute or JavaScript property. type: string. |
| centerSubtext | stringDefault: undefined | Set as an HTML attribute or JavaScript property. type: string. |
| 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. |
booleanDefault: false | Whether to show a legend for series or items. | |
| legendPosition | ItemChartLegendPositionDefault: 'bottom' | Where the legend is positioned. |
| tooltipShow | booleanDefault: true | Whether to display the built-in tooltip. |
ItemChartTooltipInputDefault: undefined | Tooltip settings for pointer-driven values, position, and content. | |
CartesianZoomInputDefault: undefined | Settings for zooming and the visible range. | |
| animated | booleanDefault: false | Whether to animate initial display and data changes. |
| animationDuration | numberDefault: 600 | Animation duration in milliseconds. |
| animationEasing | ItemChartEasingDefault: 'ease-out' | Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'. |
| animationType | ItemChartAnimationTypeDefault: undefined | Allowed values: initial, update. Default: undefined. |
Other properties 18
| Attribute / Property | Type / Default | Description |
|---|---|---|
ItemChartPaletteNameDefault: 'tableau10' | Allowed values: tableau10, tableau20, observable10, paired12, set3_12. Default: 'tableau10'. | |
ReadonlyArray<string>Default: undefined | Pass as a JavaScript property. type: ReadonlyArray<string>. | |
| innerSize | number | stringDefault: undefined | Central hole — px or `%` of the outer radius (Highcharts innerSize). |
number | stringDefault: undefined | Pass as a JavaScript property. type: number | string. | |
| centerX | number | stringDefault: undefined | Pass as a JavaScript property. type: number | string. |
| centerY | number | stringDefault: undefined | Pass as a JavaScript property. type: number | string. |
| minSize | numberDefault: 80 | Set as an HTML attribute or JavaScript property. type: number. |
| legendItems | LegendItem[]Default: undefined | Pass as a JavaScript property. type: LegendItem[]. |
| legendFloatAlign | 'start' | 'center' | 'end'Default: 'end' | `legend-position="float"`: the overlay's horizontal anchor inside the drawing rectangle. |
| legendFloatVerticalAlign | 'top' | 'middle' | 'bottom'Default: 'top' | `legend-position="float"`: the overlay's vertical anchor inside the drawing rectangle. |
| legendDraggable | booleanDefault: false | `legend-position="float"`: the floating legend can be dragged inside the chart bounds. |
| tooltipFormat | (party: ItemChartResolvedParty) => stringDefault: undefined | Pass as a JavaScript property. type: (party: ItemChartResolvedParty) => string. |
| enableMouseTracking | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
ItemChartEngineModeDefault: 'auto' | Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type. | |
ItemChartUnavailableBehaviourDefault: 'fallback' | Allowed values: fallback, error, throw. Default: 'fallback'. | |
| streamSource | ItemChartStreamSourceDefault: 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. |
Events 15
| Events | Detail type | Description |
|---|---|---|
ItemChartRenderResult & { tier: ItemChartEngineTier } | Emits rendering results in detail when chart drawing completes. | |
ItemChartPointEventDetail | A point selection event. Read the selected data and index from CustomEvent.detail. | |
ItemChartPointEventDetail | null | CustomEvent.detail type: ItemChartPointEventDetail | null. Event names are case-sensitive. | |
ChartPointContextMenuEventDetail<ItemChartPointEventDetail> | CustomEvent.detail type: ChartPointContextMenuEventDetail<ItemChartPointEventDetail>. Event names are case-sensitive. | |
{ index: number; partyId: string; label: string; disabled: boolean } | CustomEvent.detail type: { index: number; partyId: string; label: string; disabled: boolean }. Event names are case-sensitive. | |
{ index: number; seriesId: string; disabled: boolean } | CustomEvent.detail type: { index: number; seriesId: string; disabled: boolean }. 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. | |
ItemChartTooltipShowEventDetail | Whether to display the built-in tooltip. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
ItemChartTooltipActionEventDetail | CustomEvent.detail type: ItemChartTooltipActionEventDetail. Event names are case-sensitive. | |
CartesianZoomChangeEventDetail | Fired after every zoom change (drag / pan / wheel / pinch / keyboard / api / reset) with the new viewport windows. |
Methods 25
Stencil methods return Promises. Use await within an async function to read the result.
| Method / Arguments | Return type | Description |
|---|---|---|
Promise<ItemChartRenderResult> | An asynchronous method. Check the argument and return types below. | |
Promise<ItemChartEngineTier> | An asynchronous method. Check the argument and return types below. | |
| datum: ItemChartDatum, opts?: { insertAt?: number } | Promise<number> | An asynchronous method. Check the argument and return types below. |
| idOrIndex: string | number | Promise<boolean> | An asynchronous method. Check the argument and return types below. |
| idOrIndex: string | number, patch: Partial<Exclude<ItemChartDatum, number>> | Promise<boolean> | An asynchronous method. Check the argument and return types below. |
| idOrIndex: string | number, value: number | Promise<boolean> | An asynchronous method. Check the argument and return types below. |
| datum: ItemChartDatum | Promise<void> | An asynchronous method. Check the argument and return types below. |
| datums: ReadonlyArray<ItemChartDatum> | 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. |
| datums: ReadonlyArray<ItemChartDatum> | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<ItemChartStreamSource | undefined> | An asynchronous method. Check the argument and return types below. | |
| options: { duration?: number; easing?: ItemChartEasing; enabled?: boolean; type?: ItemChartAnimationType } | 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> | Replay the initial angular-wipe reveal. No-op when animation is off. | |
| cssX: number, cssY: number | Promise<{ partyIndex: number; partyId: string; seatIndex: number; seatInParty: number } | null> | An asynchronous method. Check the argument and return types below. |
| idOrIndex: string | number | Promise<ItemChartPointEventDetail | 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 viewport windows: `x` / `y` as `{ min, max }` or `[min, max]` over 0..1 (`null` clears that orientation). |
| 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 viewport units (`{ x?, y? }`, 1 = the whole drawing); 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 (0..1 on both orientations, key `'0'`). |
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.