Chart properties.

From simple attributes to structured data, responsive sizing, and logos.

New data and responsive sizing

#

Assign a new array when observations change. Observe the container's actual width and clean up subscriptions when disposing of the view. Supported methods such as appendBatch and replace are documented in each chart's API reference.

const chart = document.querySelector('#trend');
chart.series = chart.series.map(series => ({
  ...series,
  values: series.values.map((value, index) => index === 2 ? 35 : value)
}));

const container = chart.parentElement;
const observer = new ResizeObserver(([entry]) => {
  chart.width = Math.max(160, Math.floor(entry.contentRect.width));
});
observer.observe(container);
// Call observer.disconnect() when disposing of the view.