Líneas

Ventana temporal enlazada

Ambas vistas usan los mismos instantes UTC y conservan sus escalas Y independientes.

Demo interactiva

Rango Y completo002525505075751001002026-11-012026-11-012026-11-032026-11-032026-11-052026-11-052026-11-072026-11-07Detalle Y independiente20204040606080802026-11-012026-11-012026-11-032026-11-032026-11-052026-11-052026-11-072026-11-07

Configuración

En automático, los paneles comparten fila cuando hay espacio. Usa una columna para compararlos en vertical.

Código del ejemplo

Copia el ejemplo con la configuración aplicada.

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": "overview",
      "data": {
        "type": "line",
        "axes": {
          "x": {
            "type": "time",
            "domain": [
              1793491200000,
              1794096000000
            ],
            "nice": false
          },
          "y": {
            "type": "linear",
            "domain": [
              0,
              100
            ],
            "nice": false
          }
        },
        "series": [
          {
            "id": "sessions",
            "name": "Sesiones",
            "data": [
              {
                "id": "p0",
                "x": 1793491200000,
                "y": 20
              },
              {
                "id": "p1",
                "x": 1793577600000,
                "y": 45
              },
              {
                "id": "p2",
                "x": 1793664000000,
                "y": 30
              },
              {
                "id": "p3",
                "x": 1793750400000,
                "y": 65
              },
              {
                "id": "p4",
                "x": 1793836800000,
                "y": 42
              },
              {
                "id": "p5",
                "x": 1793923200000,
                "y": 75
              },
              {
                "id": "p6",
                "x": 1794009600000,
                "y": 60
              },
              {
                "id": "p7",
                "x": 1794096000000,
                "y": 80
              }
            ]
          }
        ]
      }
    },
    {
      "id": "detail",
      "data": {
        "type": "line",
        "axes": {
          "x": {
            "type": "time",
            "domain": [
              1793491200000,
              1794096000000
            ],
            "nice": false
          },
          "y": {
            "type": "linear",
            "domain": [
              0,
              100
            ],
            "nice": false
          }
        },
        "series": [
          {
            "id": "sessions",
            "name": "Sesiones",
            "data": [
              {
                "id": "p0",
                "x": 1793491200000,
                "y": 20
              },
              {
                "id": "p1",
                "x": 1793577600000,
                "y": 45
              },
              {
                "id": "p2",
                "x": 1793664000000,
                "y": 30
              },
              {
                "id": "p3",
                "x": 1793750400000,
                "y": 65
              },
              {
                "id": "p4",
                "x": 1793836800000,
                "y": 42
              },
              {
                "id": "p5",
                "x": 1793923200000,
                "y": 75
              },
              {
                "id": "p6",
                "x": 1794009600000,
                "y": 60
              },
              {
                "id": "p7",
                "x": 1794096000000,
                "y": 80
              }
            ]
          }
        ]
      }
    }
  ],
  "viewportLinks": [
    {
      "id": "original-x",
      "axis": "x",
      "panelIds": [
        "overview",
        "detail"
      ]
    }
  ]
};
const options: ChartPanelsOptions = {
  chart: {
    "animation": {
      "enabled": true
    },
    "locale": "es",
    "theme": "light",
    toolbar: {
      actions: [ChartToolbarAction.Csv, ChartToolbarAction.Png, ChartToolbarAction.Svg],
      position: ChartToolbarPosition.Top,
    }
  },
  "columns": "auto",
  "panels": {
    "overview": {
      "title": "Rango Y completo",
      "height": 220,
      "unit": "sesiones",
      "legend": {
        "visible": true,
        "position": "bottom",
        "interactive": true
      },
      "viewport": {
        "axes": "xy",
        "controls": true
      },
      "appearance": {
        "colors": [
          "#2C6DCD"
        ],
        "markers": true
      }
    },
    "detail": {
      "title": "Detalle Y independiente",
      "height": 220,
      "unit": "sesiones",
      "legend": {
        "visible": true,
        "position": "bottom",
        "interactive": true
      },
      "viewport": {
        "axes": "xy",
        "controls": true,
        "value": {
          "y": [
            20,
            80
          ]
        }
      },
      "appearance": {
        "colors": [
          "#2C6DCD"
        ],
        "markers": true
      }
    }
  }
};
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(); }

Datos, opciones y eventos

Identifica cada panel y enlaza los ejes X que comparten dominio. Puedes aplicar opciones comunes y sustituirlas por panel.

ChartPanelsData

ChartPanelsOptions

ChartPanelsMountOptions