Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

Chart Provider

Version 2.0.1GithubStorybookDesign assets pendingPeer review pending

Chart Provider is a data visualization component used to wrap an individual chart to store and share state to child charting elements.

Guidelines

Guidelines page anchor

Chart Provider is a wrapper around Highcharts that provides a consistent API for configuring an individual chart instance. This component has no visible elements and is an engineering asset only. It acts as a store for chart options and provides a context for managing chart state.

We highly recommend using our BaseChart code inside the Chart Provider to ensure that the chart is rendered correctly and state is correctly stored.

The Chart Provider accepts a single object that defines the chart to render. This can be passed either through the options prop for supported Paste charts or through the highchartsOptions prop to render custom charts using the full Highcharts API.

Using our supported chart options gives engineers a more streamlined and intuitive API for building various chart types. We offer a set of base configuration options shared across all charts, along with additional options specific to certain chart types. This approach simplifies the often heavily nested Highcharts API, making it easier to configure charts with clearer and more approachable property names.

For all chart configuration options you can check our code here(link takes you to an external page)

Line Chart

Line Chart page anchor

Below is an example where only the necessary options are deifned. More examples can be found here. To view the options available to configure this chart, references the API.

Below is an example where only the necessary options are deifned. More examples can be found here. To view the options available to configure this chart, references the API.

Below is an example where only the necessary options are deifned. More examples can be found here. To view the options available to configure this chart, references the API.

You can use the highchartsOptions prop to create any currently unsupported charts by passing the Highcharts config directly to the base chart without modification. We recommend using our wrappers for easier migration and a simpler way of accessing the rendered chart object for building custom interactions.

(warning)

Compatibility

If you build charts using the Highcharts API directly it will be unlikely that our Paste data visualization components will function correctly as they depend on helper functions and event tracking that we enrich the default options with.