PieChartOptions
Options for a pie chart.
| Name | Type | Description |
|---|---|---|
| color? | string | Optional single color to use for all slices of pie. |
| colorGenerator? | ColorGenerator | Optional function to call in order to establish the color to be used for each series |
| colors? | Array<string> | Optional list of colors to use for the slices of pie. You will need to know the order of the data points in order to match these - if you do not, you will want to use a instead. |
| data? | Array<ObjectData> | Optional data to load into the chart. |
| dataLabels? | DataLabelsOptions | Options for data labels. If true, the value for the slice is shown. If a string, it is used as a format string. |
| dataSource? | DataSource | Optional data source (of type , meaning both and are supported) from which to retrieve data to load into the chart. |
| dataSourceFilter? | ChartModelFilter | When you provide , you can also provide a filter which accepts or rejects specific nodes/groups in the data source. |
| defaultColor? | string | Optional color to use for every series. Overrides any colorGenerator. |
| emptyMessage? | string | Message to display when the chart has no data. Defaults to "No data". |
| grouped? | boolean | If true, the data will be grouped, if the chart type supports it (eg Bar/Column). |
| groupField? | string | The name of the field that identifies which group a data point belongs to. Defaults to . |
| height? | number | Height for the chart. If omitted, height is computed from the width of the chart's container |
| innerRadius? | number | When you want a hole in the middle of the pie, this number specifies the ratio of that hole to the diameter of the pie. Valid values are, strictly speaking, in the range 0 - 1, but a value of 0 would result in no hole, and a value >= 1 would result in no chart. |
| interactive? | boolean | Defaults to false. When true, mouse clicks on a slice of the pie will select/deselect that slice. |
| labelFont? | FontSpec | Optional font specification for the data labels. |
| labelPosition? | "inside" | "outside" | Where to place labels. Defaults to "outside". |
| legend? | boolean | LegendSpec | Either a boolean true/false, indicating the legend should be shown/hidden, or a spec for a legend. |
| resizeObserver? | boolean | Defaults to true, meaning the chart will redraw when its container element resizes. |
| selectedCategory? | number | The index of the category (slice) to be selected. This will result in the slice being shifted out from the center of the pie. |
| selectedSliceOffset? | number | The number of pixels to offset the selected slice by. Defaults to 10. |
| series | Array<RecordBasedSeriesOptions> | Definition of the chart series' to display. You can display multiple series on a chart. |
| showLabels? | "value" | "label" | "percentage" | "label-value" | "label-percentage" | Defines what to show in the data labels. 'label' (default) shows the category name. 'value' shows the raw number. 'percentage' shows the slice's percentage of the total. 'label-value' shows label and value. 'label-percentage' shows label and percentage. |
| style? | ChartStyleOptions | Styles for legend and grid. |
| subtitle? | SubtitleSpec | Subtitle for the chart. |
| title? | ChartTitleSpec | Title for the chart. |
| titlePadding? | number | Padding to leave underneath the title |
| tooltip? | TooltipOptions | Options for a tooltip for the chart. |
| url? | string | Optional URL from which to retrieve data to load into the chart |
| width? | number | Width for the chart. If omitted, width is computed from the width of the chart's container |
| zoom? | {
enabled:boolean, initialValue:number, range:[number, number] } | Optional zoom configuration. |