PB Circle 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.

Live Data


Rounded Corners


Accepts Any Block


Color Overrides


Custom data colors allow for color customization to match the needs of business requirements.

For React, import the colors from Playbook's tokens, then set custom colors in the plotOptions.pie.colors array using the desired color variables.

For Rails, only HEX colors can be used eg: #CA0095

Data with Labels


Data with Legend


Legend Position


Layout options from Highcharts:

align Type: String | Values: left | center | right (defaults to center)
verticalAlign Type: String | Values: top | middle | bottom (defaults to bottom)
layout Type: String | Values: horizontal | vertical | proximate (defaults to horizontal)
x Type: Number (defaults to 0)
y Type: Number (defaults to 0)

layout determines the position of the legend items
layout: proximate will place the legend items as close as possible to the graphs they're representing. It will also determine whether to place the legend above/below or on the side of the plot area, if the legend is in a corner.

x offsets the legend relative to its horizontal alignment. Negative x moves it to the left, positive x moves it to the right

y offsets the legend relative to its vertical alignment. Negative y moves it up, positive y moves it down.

With Title


Inner Circle Size Options


Tooltip Customization


Tooltip options from Highcharts:

headerFormat Type: String | when set to null will disable the header.
pointFormat Type: String | defines the HTML template for each data point and supports custom HTML when useHTML is enabled.
useHTML Type: boolean (default false) | enables HTML rendering in tooltips.
{point.name} and {point.y} are useful values that can be referenced for each point in the graph.


Available Props