Selector
bp-chart-pie

Inputs

Pie Chart inputs
InputTypeDescriptionNotes
dataobject[]The data used to create the chart.If the data needs to be updated dynamically, create a copy of the data, make the needed changes, then reassign the new array to the input variable. Otherwise Angular will not pick up on the change detection.
namestringThe key from the data to use for the name of each segment.Default is "name".
valuestringThe key from the data to use for the value of each segment.Default is "value".
bpIDstringThe value for the SVG's id attribute.

Ids must only be used once per page.

Ids should be camelCase, e.g.: #myId.

See identifiers.

titlestringThe string to use as the SVG's title element.Required.
descriptionstringA string used by screen readers for when a segment is selected.

Default is "#{percent}% #{name} with #{value}" where percent, name, and value are the segments corresponding values.

Required.

formattersobjectAn object containing formatter functions for the information in the pie chart.See formatters.

Identifiers

Formatters
PropertyTypeDescriptionNotes
name(string) => stringThe formatter function for the name text.Default is (name: string): string => name.
percent(number) => stringThe formatter function for the percent text.Default is (percent: number): string => String(percent) + '%'.
value(number) => stringThe formatter function for the value text.Default is (value: number): string => new Intl.NumberFormat().format(value).

Identifiers

Identifiers
IDDescription
bpIDThe unique identifier for the pie chart component.
bpID + 'Description'The unique identifier for the aria controls / description.