Data and options
Stable identity, immutable inputs and explicit configuration.
data describes what you know
Data contains the chart type, categories, series and observations. Timeline event titles are event content. Scatter retains numeric XY pairs. null means a missing measurement; zero remains a real value. A category’s visible label does not replace its ID.
options describes presentation
Title, theme, colors, axes, layout, legend and tooltip belong in options. Specialized variants expose typed configuration: column orientation/stacking, Contour levels and WordCloud packing parameters. Core validates their constraints.
Update
Replace the values bound to [data] and [options]. When changing a group such as legend, explicitly retain the values you want to keep. The component retains its instance and emits diagnostic if it receives invalid configuration.
| Configure | Responsibility | Rule |
|---|---|---|
| data | Your application | New object; retain IDs for the same data. |
| options | Your application | [options] receives the complete object. |
| selectedPoints / hiddenSeriesIds | Controlled when you supply the value | Accept proposals by updating that value. |
| viewport.value | Controlled when you supply the value | Do not maintain two applied viewport states. |
import type { WritableSignal } from '@angular/core';
import type { ChartOptions } from '@neural-charts/angular';
export function setHeight(options: WritableSignal<ChartOptions>, height: number): void {
options.update(applied => ({ ...applied, height }));
}
// Bind the signal in the template with [options]="options()".Business objects
Keep business objects outside the chart and retrieve them through seriesId and pointId. Interaction does not depend on a DOM node or the object identity of reconstructed input.
Chart language
options.locale changes the chart’s own messages, controls, help and accessible table between English and Spanish. Your application translates titles, series names, categories, references and affixes while preserving IDs. formatting.locale independently selects regional number and date formatting; it does not translate business content.
import type { ChartOptions } from '@neural-charts/angular';
export const options: ChartOptions = {
"locale": "es",
"formatting": {
"locale": "de-DE",
"number": {
"style": "currency",
"currency": "EUR"
}
},
"title": "Ingresos"
};