Declares the charts in the composition. Each panel has its own ID and chart data.
Linked category window
Zoom the same categories in two charts while each keeps its own vertical window.
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.
Angular · TypeScript
import { ChartToolbarAction, ChartToolbarPosition } from '@neural-charts/angular';
import { Component } from '@angular/core';
import { NeuralChartPanels, type ChartPanelsData, type ChartPanelsOptions } from '@neural-charts/angular';
@Component({
selector: 'app-rollout-panels',
imports: [NeuralChartPanels],
template: '<nc-chart-panels [data]="data" [options]="options" instanceId="rollout" />'
})
export class RolloutPanels {
readonly data: ChartPanelsData = {
"panels": [
{
"id": "overview",
"data": {
"type": "line",
"axes": {
"x": {
"type": "category",
"values": [
{
"id": "day-0",
"label": "Day 1"
},
{
"id": "day-1",
"label": "Day 2"
},
{
"id": "day-2",
"label": "Day 3"
},
{
"id": "day-3",
"label": "Day 4"
},
{
"id": "day-4",
"label": "Day 5"
},
{
"id": "day-5",
"label": "Day 6"
},
{
"id": "day-6",
"label": "Day 7"
},
{
"id": "day-7",
"label": "Day 8"
}
]
},
"y": {
"type": "linear",
"domain": [
0,
100
],
"nice": false
}
},
"series": [
{
"id": "sessions",
"name": "Sessions",
"data": [
{
"id": "p0",
"x": "day-0",
"y": 20
},
{
"id": "p1",
"x": "day-1",
"y": 45
},
{
"id": "p2",
"x": "day-2",
"y": 30
},
{
"id": "p3",
"x": "day-3",
"y": 65
},
{
"id": "p4",
"x": "day-4",
"y": 42
},
{
"id": "p5",
"x": "day-5",
"y": 75
},
{
"id": "p6",
"x": "day-6",
"y": 60
},
{
"id": "p7",
"x": "day-7",
"y": 80
}
]
}
]
}
},
{
"id": "detail",
"data": {
"type": "line",
"axes": {
"x": {
"type": "category",
"values": [
{
"id": "day-0",
"label": "Day 1"
},
{
"id": "day-1",
"label": "Day 2"
},
{
"id": "day-2",
"label": "Day 3"
},
{
"id": "day-3",
"label": "Day 4"
},
{
"id": "day-4",
"label": "Day 5"
},
{
"id": "day-5",
"label": "Day 6"
},
{
"id": "day-6",
"label": "Day 7"
},
{
"id": "day-7",
"label": "Day 8"
}
]
},
"y": {
"type": "linear",
"domain": [
0,
100
],
"nice": false
}
},
"series": [
{
"id": "sessions",
"name": "Sessions",
"data": [
{
"id": "p0",
"x": "day-0",
"y": 20
},
{
"id": "p1",
"x": "day-1",
"y": 45
},
{
"id": "p2",
"x": "day-2",
"y": 30
},
{
"id": "p3",
"x": "day-3",
"y": 65
},
{
"id": "p4",
"x": "day-4",
"y": 42
},
{
"id": "p5",
"x": "day-5",
"y": 75
},
{
"id": "p6",
"x": "day-6",
"y": 60
},
{
"id": "p7",
"x": "day-7",
"y": 80
}
]
}
]
}
}
],
"viewportLinks": [
{
"id": "original-x",
"axis": "x",
"panelIds": [
"overview",
"detail"
]
}
]
};
readonly options: ChartPanelsOptions = {
chart: {
"animation": {
"enabled": true
},
"locale": "en",
"theme": "light",
toolbar: {
actions: [ChartToolbarAction.Csv, ChartToolbarAction.Png, ChartToolbarAction.Svg],
position: ChartToolbarPosition.Top,
}
},
"columns": "auto",
"panels": {
"overview": {
"title": "Full Y range",
"height": 220,
"unit": "sessions",
"legend": {
"visible": true,
"position": "bottom",
"interactive": true
},
"viewport": {
"axes": "xy",
"controls": true
},
"appearance": {
"colors": [
"#2C6DCD"
],
"markers": true
}
},
"detail": {
"title": "Independent Y detail",
"height": 220,
"unit": "sessions",
"legend": {
"visible": true,
"position": "bottom",
"interactive": true
},
"viewport": {
"axes": "xy",
"controls": true,
"value": {
"y": [
20,
80
]
}
},
"appearance": {
"colors": [
"#2C6DCD"
],
"markers": true
}
}
}
};
}Data, options and events
Identify each panel and link X axes that share a domain. Apply common options and override them per panel.