Skip to main content

PieChartOptions

Options for a pie chart.

Extends​

Properties​

color?​

optional color: string

Optional single color to use for all slices of pie.


colorGenerator?​

optional colorGenerator: ColorGenerator

Optional function to call in order to establish the color to be used for each series

Inherited from​

SeriesBasedChartOptions.colorGenerator


colors?​

optional colors: 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 colorGenerator instead.


data?​

optional data: ObjectData[]

Optional data to load into the chart.

Inherited from​

SeriesBasedChartOptions.data


dataLabels?​

optional 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?​

optional dataSource: DataSource

Optional data source (of type DataSource, meaning both VisuallyJsModel and Selection are supported) from which to retrieve data to load into the chart.

Inherited from​

SeriesBasedChartOptions.dataSource


dataSourceFilter?​

optional dataSourceFilter: ChartModelFilter

When you provide dataSource, you can also provide a filter which accepts or rejects specific nodes/groups in the data source.

Inherited from​

SeriesBasedChartOptions.dataSourceFilter


defaultColor?​

optional defaultColor: string

Optional color to use for every series. Overrides any colorGenerator.

Inherited from​

SeriesBasedChartOptions.defaultColor


emptyMessage?​

optional emptyMessage: string

Message to display when the chart has no data. Defaults to "No data".

Inherited from​

SeriesBasedChartOptions.emptyMessage


grouped?​

optional grouped: boolean

If true, the data will be grouped, if the chart type supports it (eg Bar/Column).

Inherited from​

SeriesBasedChartOptions.grouped


groupField?​

optional groupField: string

The name of the field that identifies which group a data point belongs to. Defaults to group.

Inherited from​

SeriesBasedChartOptions.groupField


height?​

optional height: number

Height for the chart. If omitted, height is computed from the width of the chart's container

Inherited from​

SeriesBasedChartOptions.height


innerRadius?​

optional 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?​

optional interactive: boolean

Defaults to false. When true, mouse clicks on a slice of the pie will select/deselect that slice.


labelFont?​

optional labelFont: FontSpec

Optional font specification for the data labels.


labelPosition?​

optional labelPosition: "inside" | "outside"

Where to place labels. Defaults to "outside".


legend?​

optional legend: boolean | LegendSpec

Either a boolean true/false, indicating the legend should be shown/hidden, or a spec for a legend.

Inherited from​

SeriesBasedChartOptions.legend


resizeObserver?​

optional resizeObserver: boolean

Defaults to true, meaning the chart will redraw when its container element resizes.

Inherited from​

SeriesBasedChartOptions.resizeObserver


selectedCategory?​

optional 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?​

optional selectedSliceOffset: number

The number of pixels to offset the selected slice by. Defaults to 10.


series​

series: RecordBasedSeriesOptions[]

Definition of the chart series' to display. You can display multiple series on a chart.

Inherited from​

SeriesBasedChartOptions.series


showLabels?​

optional 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?​

optional style: ChartStyleOptions

Styles for legend and grid.

Inherited from​

SeriesBasedChartOptions.style


subtitle?​

optional subtitle: SubtitleSpec

Subtitle for the chart.

Inherited from​

SeriesBasedChartOptions.subtitle


title?​

optional title: ChartTitleSpec

Title for the chart.

Inherited from​

SeriesBasedChartOptions.title


titlePadding?​

optional titlePadding: number

Padding to leave underneath the title

Inherited from​

SeriesBasedChartOptions.titlePadding


tooltip?​

optional tooltip: TooltipOptions

Options for a tooltip for the chart.

Inherited from​

SeriesBasedChartOptions.tooltip


url?​

optional url: string

Optional URL from which to retrieve data to load into the chart

Inherited from​

SeriesBasedChartOptions.url


width?​

optional width: number

Width for the chart. If omitted, width is computed from the width of the chart's container

Inherited from​

SeriesBasedChartOptions.width


zoom?​

optional zoom: object

Optional zoom configuration.

enabled?​

optional enabled: boolean

Whether or not zoom is enabled.

initialValue?​

optional initialValue: number

Initial zoom value. Defaults to 1.

range?​

optional range: [number, number]

Zoom range to support. Defaults to [0.05, 3]

Inherited from​

SeriesBasedChartOptions.zoom