Declares the charts in the composition. Each panel has its own ID and chart data.
Three independent indicators
Compare CPU load, availability and throughput in responsive panels.
Live demo
Configuration
With automatic layout, panels share a row when space allows. Use one column to compare them vertically.
Automatic
Example code
Copy the example with its current settings.
JS/TS · TypeScript
import { ChartToolbarAction, ChartToolbarPosition } from '@neural-charts/web';
import { createChartPanels, type ChartPanelsData, type ChartPanelsOptions } from '@neural-charts/web/panels';
const data: ChartPanelsData = {
"panels": [
{
"id": "load",
"data": {
"type": "gauge",
"value": 72,
"domain": [
0,
100
]
}
},
{
"id": "availability",
"data": {
"type": "gauge",
"value": 99.95,
"domain": [
0,
100
]
}
},
{
"id": "throughput",
"data": {
"type": "gauge",
"value": 38,
"domain": [
0,
60
]
}
}
]
};
const options: ChartPanelsOptions = {
chart: {
"animation": {
"enabled": true
},
"locale": "en",
"theme": "light",
toolbar: {
actions: [ChartToolbarAction.Csv, ChartToolbarAction.Png, ChartToolbarAction.Svg],
position: ChartToolbarPosition.Top,
}
},
"columns": "auto",
"panels": {
"load": {
"title": "CPU load",
"height": 180,
"unit": "%",
"layout": {
"style": "solid",
"preset": "arc"
},
"appearance": {
"colors": [
"#2C6DCD"
]
}
},
"availability": {
"title": "Availability",
"height": 180,
"unit": "%",
"layout": {
"style": "solid",
"preset": "arc"
},
"appearance": {
"colors": [
"#638A35"
]
}
},
"throughput": {
"title": "Throughput",
"height": 180,
"unit": "req/s",
"layout": {
"style": "needle",
"preset": "arc"
},
"appearance": {
"colors": [
"#8B6CCE"
]
}
}
}
};
const host = document.createElement('div');
document.body.append(host);
const chart = createChartPanels(host, data, options, { instanceId: 'rollout' });
if (chart.status === 'invalid') throw new Error(chart.diagnostic.message);
export function dispose() { chart.value.destroy(); host.remove(); }Data, options and events
Identify each panel and link X axes that share a domain. Apply common options and override them per panel.