3D Bar.
PRORepresent combinations of two categories with bars of varying height.
LIVE EXAMPLE
Quarter and product comparison
Appearance and style3
Legend and interaction13
Title and dimensions3
Represent combinations of X and Y categories as Z heights. 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-pro/components/sy-bar-3d.js';
define0();
// Pro: complete registerLicense at app startup using your issued certificate.
// The website preview certificate is not for use in customer apps.
const specs = [
{
"id": "example-chart",
"tag": "sy-bar-3d",
"props": {
"data": [
{
"x": "Q1",
"y": "A",
"z": 12
},
{
"x": "Q2",
"y": "A",
"z": 19
},
{
"x": "Q3",
"y": "A",
"z": 26
},
{
"x": "Q4",
"y": "A",
"z": 33
},
{
"x": "Q1",
"y": "B",
"z": 40
},
{
"x": "Q2",
"y": "B",
"z": 17
},
{
"x": "Q3",
"y": "B",
"z": 24
},
{
"x": "Q4",
"y": "B",
"z": 31
},
{
"x": "Q1",
"y": "C",
"z": 38
},
{
"x": "Q2",
"y": "C",
"z": 15
},
{
"x": "Q3",
"y": "C",
"z": 22
},
{
"x": "Q4",
"y": "C",
"z": 29
}
],
"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', 'bar-3d 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
#Arrange magnitudes across intersecting categories, such as products and quarters, in space.
Bars at the back may be hidden. Provide a 2D Heatmap or table as well.
Data contract
| Property | Input format |
|---|---|
data | An array of { x, y, z, color? }. x and y are categories; z is bar height. |
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 35 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.
Bar width and depthPRO
Adjust bar spacing along the X and Y directions.
View code
Translucent barsPRO
Inspect overlapping bars using translucency.
View code
Inspect values with the pointerPRO
Point to data to view the value at that location.
View code
Crosshair trackingPRO
Move the pointer to read horizontal and vertical coordinates alongside values.
View code
Replay animationPRO
Redraw the same example to inspect its initial display animation.
View code
AccessibilityPRO
Compare 1 examples of Accessibility. Buttons and options update both the live result and source code.
View code
AnimationPRO
Compare 3 examples of Animation. Buttons and options update both the live result and source code.
View code
AxesPRO
Compare 2 examples of Axes. Buttons and options update both the live result and source code.
View code
CameraPRO
Compare 3 examples of Camera. Buttons and options update both the live result and source code.
View code
Metrics and itemsPRO
Compare 3 examples of Metrics and items. Buttons and options update both the live result and source code.
View code
ColorPRO
Compare 4 examples of Color. Buttons and options update both the live result and source code.
View code
CrosshairPRO
Compare 3 examples of Crosshair. Buttons and options update both the live result and source code.
View code
Data inputPRO
Compare 8 examples of Data input. Buttons and options update both the live result and source code.
View code
FootprintPRO
Compare 3 examples of Footprint. Buttons and options update both the live result and source code.
View code
LegendPRO
Compare 1 examples of Legend. Buttons and options update both the live result and source code.
View code
LightingPRO
Compare 3 examples of Lighting. Buttons and options update both the live result and source code.
View code
LocalePRO
Compare 1 examples of Locale. Buttons and options update both the live result and source code.
View code
Large datasetsPRO
Compare 2 examples of Large datasets. Buttons and options update both the live result and source code.
View code
SizePRO
Compare 2 examples of Size. Buttons and options update both the live result and source code.
View code
TooltipPRO
Compare 13 examples of Tooltip. Buttons and options update both the live result and source code.
View code
Zoom and panPRO
Compare 3 examples of Zoom and pan. Buttons and options update both the live result and source code.
View code
Camera ChangePRO
Compare 1 examples of Camera Change. Buttons and options update both the live result and source code.
View code
Context menuPRO
Compare 1 examples of Context menu. Buttons and options update both the live result and source code.
View code
HoverPRO
Compare 1 examples of Hover. Buttons and options update both the live result and source code.
View code
Point ClickPRO
Compare 1 examples of Point Click. Buttons and options update both the live result and source code.
View code
Data context menuPRO
Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.
View code
RuntimePRO
Compare 4 examples of Runtime. Buttons and options update both the live result and source code.
View code
Selection ChangedPRO
Compare 1 examples of Selection Changed. Buttons and options update both the live result and source code.
View code
CameraPRO
Compare 1 examples of Camera. Buttons and options update both the live result and source code.
View code
ExportPRO
Compare 1 examples of Export. Buttons and options update both the live result and source code.
View code
Read coordinates and dataPRO
Compare 1 examples of Read coordinates and data. Buttons and options update both the live result and source code.
View code
Runtime APIPRO
Compare 2 examples of Runtime API. Buttons and options update both the live result and source code.
View code
OptionalPRO
Compare 1 examples of Optional. Buttons and options update both the live result and source code.
View code
Bar3DPRO
Compare 3 examples of Bar3D. 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-bar-3d. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.
Key properties
| Attribute / Property | Type / Default | Description |
|---|---|---|
Bar3DDataDefault: undefined | An array of { x, y, z, color? }. x and y are categories; z is bar height. | |
numberDefault: 800 | Chart width in pixels. Update with ResizeObserver when the container changes. | |
numberDefault: 480 | 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. |
numberDefault: 1 | Set as an HTML attribute or JavaScript property. type: number. | |
booleanDefault: false | Whether to show a legend for series or items. | |
| barWidth | numberDefault: .72 | Set as an HTML attribute or JavaScript property. type: number. |
| barDepth | numberDefault: .72 | Set as an HTML attribute or JavaScript property. type: number. |
| 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. |
CartesianTooltipInputDefault: undefined | Tooltip settings for pointer-driven values, position, and content. | |
| tooltipEnabled | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
CartesianCrosshairInputDefault: undefined | Pass as a JavaScript property. type: CartesianCrosshairInput. | |
| animated | booleanDefault: false | Whether to animate initial display and data changes. |
| animationDuration | numberDefault: 600 | Animation duration in milliseconds. |
| animationEasing | Bar3DEasingDefault: 'ease-out' | Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'. |
| animationType | HeatmapAnimationTypeDefault: undefined | Allowed values: initial, update. Default: undefined. |
Other properties 21
| Attribute / Property | Type / Default | Description |
|---|---|---|
HeatmapColorInputDefault: 'viridis' | Pass as a JavaScript property. type: HeatmapColorInput. | |
| colorDomain | Bar3DDomainDefault: undefined | Pass as a JavaScript property. type: Bar3DDomain. |
| missingColor | stringDefault: '#94a3b8' | Set as an HTML attribute or JavaScript property. type: string. |
| barSize | Scene3DVectorDefault: [2,2,2] | Pass as a JavaScript property. type: Scene3DVector. |
stringDefault: 'en-US' | Set as an HTML attribute or JavaScript property. type: string. | |
Bar3DAxesOptions|boolean|stringDefault: undefined | Pass as a JavaScript property. type: Bar3DAxesOptions|boolean|string. | |
| xCategories | ReadonlyArray<Bar3DCategory>Default: undefined | Pass as a JavaScript property. type: ReadonlyArray<Bar3DCategory>. |
| yCategories | ReadonlyArray<Bar3DCategory>Default: undefined | Pass as a JavaScript property. type: ReadonlyArray<Bar3DCategory>. |
Scene3DMaterialOptionsDefault: undefined | Pass as a JavaScript property. type: Scene3DMaterialOptions. | |
Scene3DLightingOptionsDefault: undefined | Pass as a JavaScript property. type: Scene3DLightingOptions. | |
Scene3DCameraOptions|stringDefault: undefined | Pass as a JavaScript property. type: Scene3DCameraOptions|string. | |
Orbit3DOptions|boolean|stringDefault: undefined | Pass as a JavaScript property. type: Orbit3DOptions|boolean|string. | |
| showEmpty | booleanDefault: true | Whether the component shows its own empty-geometry notice. |
| activeColor | stringDefault: '#f59e0b' | Set as an HTML attribute or JavaScript property. type: string. |
| enableMouseTracking | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| tooltipFormat | (detail:Bar3DHitDetail)=>stringDefault: undefined | Pass as a JavaScript property. type: (detail:Bar3DHitDetail)=>string. |
| crosshairSnapDistance | numberDefault: 12 | Set as an HTML attribute or JavaScript property. type: number. |
| streamSource | Bar3DStreamSourceDefault: undefined | A stream source for live data. Check the contract for the specific type. |
| streamMax | numberDefault: undefined | The maximum number of streaming data points to retain. |
Bar3DEngineModeDefault: 'auto' | Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type. | |
Bar3DUnavailableBehaviourDefault: 'fallback' | Allowed values: fallback, error. Default: 'fallback'. |
Events 16
| Events | Detail type | Description |
|---|---|---|
Bar3DRenderResult&{tier:Bar3DEngineTier} | Emits rendering results in detail when chart drawing completes. | |
Bar3DHitDetail | A point selection event. Read the selected data and index from CustomEvent.detail. | |
Bar3DHitDetail|null | CustomEvent.detail type: Bar3DHitDetail|null. Event names are case-sensitive. | |
Bar3DSelectionChangeEventDetail | CustomEvent.detail type: Bar3DSelectionChangeEventDetail. Event names are case-sensitive. | |
ChartPointContextMenuEventDetail<Bar3DHitDetail> | CustomEvent.detail type: ChartPointContextMenuEventDetail<Bar3DHitDetail>. Event names are case-sensitive. | |
Bar3DCameraChangeEventDetail | CustomEvent.detail type: Bar3DCameraChangeEventDetail. Event names are case-sensitive. | |
Bar3DCrosshairDetail|null | CustomEvent.detail type: Bar3DCrosshairDetail|null. Event names are case-sensitive. | |
{count:number;replaced:number} | CustomEvent.detail type: {count:number;replaced:number}. Event names are case-sensitive. | |
{dropped:number} | CustomEvent.detail type: {dropped:number}. 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. | |
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. | |
{message:string} | CustomEvent.detail type: {message:string}. Event names are case-sensitive. |
Methods 44
Stencil methods return Promises. Use await within an async function to read the result.
| Method / Arguments | Return type | Description |
|---|---|---|
| point: Bar3DDatum | Promise<void> | An asynchronous method. Check the argument and return types below. |
| points: ReadonlyArray<Bar3DDatum> | Promise<void> | An asynchronous method. Check the argument and return types below. |
| points: ReadonlyArray<Bar3DDatum> | 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. |
| count: number | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| points: ReadonlyArray<Bar3DDatum> | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<Bar3DStreamSource|undefined> | An asynchronous method. Check the argument and return types below. | |
| data: Bar3DData | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<Bar3DDatum[]> | An asynchronous method. Check the argument and return types below. | |
Promise<{ points: number; validPoints: number; missingCoordinates: number; invalidCoordinates: number; missingValues: number; zeroHeight: number; }> | An asynchronous method. Check the argument and return types below. | |
Promise<Bar3DGeometry> | 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. | |
| options: {enabled?:boolean;duration?:number;easing?:Bar3DEasing;type?:HeatmapAnimationType} | 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<Scene3DCameraOptions> | An asynchronous method. Check the argument and return types below. | |
| options: Scene3DCameraOptions | Promise<void> | An asynchronous method. Check the argument and return types below. |
| projection: Scene3DProjection | 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. | |
| padding?: number | Promise<void> | An asynchronous method. Check the argument and return types below. |
| factor: number | Promise<void> | A factor below one moves closer. Perspective changes distance; orthographic changes zoom. |
| azimuth: number, polar?: number | Promise<void> | An asynchronous method. Check the argument and return types below. |
| x: number, y: number | 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<Bar3DRenderResult> | An asynchronous method. Check the argument and return types below. | |
Promise<Bar3DEngineTier> | An asynchronous method. Check the argument and return types below. | |
Promise<string|undefined> | An asynchronous method. Check the argument and return types below. | |
Promise<ChartEngineStatus> | Requested engine vs what runs, and why (CHART-ADD-08); a frozen or unlicensed chart reports the license outcome. | |
Promise<void> | Without the grant (or while frozen) nothing is recycled: no GPU work starts. | |
| cssX: number, cssY: number | Promise<Bar3DHitDetail|null> | An asynchronous method. Check the argument and return types below. |
| index: number | Promise<Bar3DHitDetail|null> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<Bar3DSelection> | 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. |
| 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. | |
| index: number | Promise<boolean> | An asynchronous method. Check the argument and return types below. |
| request: Bar3DCrosshairShowRequest | Promise<boolean> | Quiet source-category synchronization. Categories retain their original string or number type. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<ChartDataTable> | An asynchronous method. Check the argument and return types below. | |
| options?: CsvOptions | Promise<string> | An asynchronous method. Check the argument and return types below. |
Promise<string> | An asynchronous method. Check the argument and return types below. |
No matching APIs.