Interaction and state

Pointer, keyboard, selection, legend and viewport.

Explore and select

Move the pointer, use the arrow keys, or tap an observation to see its details. Click, tap, or press Enter or Space to select it. Escape closes the detail. The tooltip stays inside the plot, near the observation. A shared tooltip shows the series at the same position. Activation reports the identity, observation and pointer or keyboard source.

Controlled state

If you apply selectedPoints, hiddenSeriesIds or viewport.value, the component outputs propose changes. Accept a proposal by updating the signal bound to [options].

Applied state versus proposals
Controlled valueComponent event
selectedPointsselectionChange
hiddenSeriesIdshiddenSeriesChange
viewport.valueviewportChange
controlled-chart.ts
import { ChangeDetectionStrategy, Component, input, signal } from '@angular/core';
import { NeuralChart, type ChartData, type ChartOptions } from '@neural-charts/angular';

@Component({
  selector: 'app-controlled-chart',
  imports: [NeuralChart],
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    <nc-chart [data]="data()" [options]="options()" instanceId="controlled-visits"
      (hiddenSeriesChange)="applyVisibility($event)"
      (pointActivate)="lastPoint.set($event.id.pointId)" />
    <p>{{ lastPoint() }}</p>
  `,
})
export class ControlledChart {
  readonly data = input.required<ChartData>();
  readonly options = signal<ChartOptions>({ hiddenSeriesIds: [] });
  readonly lastPoint = signal<string | null>(null);

  applyVisibility(hiddenSeriesIds: readonly string[]): void {
    this.options.update(applied => ({ ...applied, hiddenSeriesIds }));
  }
}

Zoom and pan

Turn on Zoom and pan under Chart toolbar. The zoom-in, zoom-out and reset icons appear together. The Zoom slider selects how much the magnifiers add or subtract. It starts at 1× and ranges from 0.1× to 15× in 0.1× steps. Moving the slider sets the next increment. Reset restores the full range. Customize the range, step, initial setting and label with viewport.zoom, typed as ChartZoomOptions. A scrollbar below the plot appears when the chart has room to pan horizontally. Use the arrow keys on the scrollbar or Shift + arrow keys on the chart. With the chart focused, use +, − and 0 to zoom in, zoom out or reset. You can also drag with the mouse, use Ctrl or Cmd with the wheel, or pinch and pan with two fingers. One finger scrolls the page. A gesture proposes one viewport when it ends. The app decides whether to apply it when it controls that state. Set viewport.axes to enable zoom in code on a supported chart.

Try synchronized zoom and tooltips →

Responsive detail

In narrow containers, the tooltip adjusts its width and allows long content to scroll within the plot. Selection follows logical identity. Hiding labels for density never removes their values from the original-data table.