Skip to content

Getting started

@statistikzh/charts is a data visualization library for the Canton of Zurich. It provides ready-to-use chart types for web applications.

The library is maintained by the Office for Statistics and Data of the Canton of Zurich.

  • Bar charts, horizontal or vertical, with grouped, stacked, and normalized variants
  • Line charts for time series, with optional grouping
  • Interactive legends and optional tooltips

Every chart is a self-contained instance: you create it once, feed it data and options, and update either whenever they change.

  1. Install the package via npm or a CDN.
  2. Learn the create, update, clean up lifecycle shared by every chart.
  3. Shape your data to match the rules each chart type expects.
  4. Pick a chart type: Bar chart or Line chart.