PB Gauge Chart

In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.

This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.

See the highcharts API docs for a comprehensive look at what is possible.

Default


In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo.

Disable Animation


With Title


With Units


Use custom CSS with classes or inline styles (as shown in these docs) to customize the appearance of prefix and suffix units.

Full Circle


With Min and Max Labels


By default, Highcharts set min to 0 and max to 100 but this can be customized if needed as shown here.

Sizing


The Gauge chart resizes dynamically to fit whatever element it's placed within.

Note: set overflow to hidden on the parent element when nesting gauges inside of flex items to best respond to shrinking screens.

Height


Live Data


Custom Color


Highcharts allows for any custom colors to be used. Custom data colors allow for color customization to match the needs of business requirements.

For React, pass the option plotOptions.solidgauge.borderColor with a Playbook token like colors. + data_1 | data_2 | data_3 | data_4 | data_5 | data_6 | data_7 | data_8. HEX colors are also available eg: #CA0095

For Rails, the option plotOptions.solidgauge.borderColor can only be used with HEX values as shown.

Complex Example


We are able to wrap the Highcharts Gauge kit within Playbook kits (such as Flex and Card components).


Available Props