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

update replaces data and updateOptions applies the complete options object. Explicitly retain any groups and fields you want to keep. If an update fails, the result contains a diagnostic and the last valid chart remains in place.

One update, one owner
ConfigureResponsibilityRule
dataYour applicationNew object; retain IDs for the same data.
optionsYour applicationupdateOptions receives the complete object.
selectedPoints / hiddenSeriesIdsControlled when you supply the valueAccept proposals by updating that value.
viewport.valueControlled when you supply the valueDo not maintain two applied viewport states.
update.ts
import type { ChartController, ChartOptions } from '@neural-charts/web';

export function setHeight(chart: ChartController, applied: ChartOptions, height: number) {
  const next: ChartOptions = { ...applied, height };
  const result = chart.updateOptions(next);
  if (result.status === 'invalid') throw new Error(result.diagnostic.message);
  return next;
}

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.

language.ts
import type { ChartOptions } from '@neural-charts/web';

export const options: ChartOptions = {
  "locale": "es",
  "formatting": {
    "locale": "de-DE",
    "number": {
      "style": "currency",
      "currency": "EUR"
    }
  },
  "title": "Ingresos"
};

Troubleshooting