PieChartOptions
Options for a pie chart.
Extends
Properties
color?
optionalcolor:string
Optional single color to use for all slices of pie.
colorGenerator?
optionalcolorGenerator:ColorGenerator
Optional function to call in order to establish the color to be used for each series
Inherited from
SeriesBasedChartOptions.colorGenerator
colors?
optionalcolors: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?
optionaldata:ObjectData[]
Optional data to load into the chart.
Inherited from
dataLabels?
optionaldataLabels: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?
optionaldataSource: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?
optionaldataSourceFilter: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?
optionaldefaultColor:string
Optional color to use for every series. Overrides any colorGenerator.
Inherited from
SeriesBasedChartOptions.defaultColor
emptyMessage?
optionalemptyMessage:string
Message to display when the chart has no data. Defaults to "No data".
Inherited from
SeriesBasedChartOptions.emptyMessage
grouped?
optionalgrouped:boolean
If true, the data will be grouped, if the chart type supports it (eg Bar/Column).
Inherited from
SeriesBasedChartOptions.grouped
groupField?
optionalgroupField:string
The name of the field that identifies which group a data point belongs to. Defaults to group.
Inherited from
SeriesBasedChartOptions.groupField
height?
optionalheight:number
Height for the chart. If omitted, height is computed from the width of the chart's container
Inherited from
SeriesBasedChartOptions.height
innerRadius?
optionalinnerRadius: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?
optionalinteractive:boolean
Defaults to false. When true, mouse clicks on a slice of the pie will select/deselect that slice.
labelFont?
optionallabelFont:FontSpec
Optional font specification for the data labels.
labelPosition?
optionallabelPosition:"inside"|"outside"
Where to place labels. Defaults to "outside".
legend?
optionallegend: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?
optionalresizeObserver:boolean
Defaults to true, meaning the chart will redraw when its container element resizes.
Inherited from
SeriesBasedChartOptions.resizeObserver
selectedCategory?
optionalselectedCategory: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?
optionalselectedSliceOffset: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?
optionalshowLabels:"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?
optionalstyle:ChartStyleOptions
Styles for legend and grid.
Inherited from
subtitle?
optionalsubtitle:SubtitleSpec
Subtitle for the chart.
Inherited from
SeriesBasedChartOptions.subtitle
title?
optionaltitle:ChartTitleSpec
Title for the chart.
Inherited from
titlePadding?
optionaltitlePadding:number
Padding to leave underneath the title
Inherited from
SeriesBasedChartOptions.titlePadding
tooltip?
optionaltooltip:TooltipOptions
Options for a tooltip for the chart.
Inherited from
SeriesBasedChartOptions.tooltip
url?
optionalurl:string
Optional URL from which to retrieve data to load into the chart
Inherited from
width?
optionalwidth:number
Width for the chart. If omitted, width is computed from the width of the chart's container
Inherited from
zoom?
optionalzoom:object
Optional zoom configuration.
enabled?
optionalenabled:boolean
Whether or not zoom is enabled.
initialValue?
optionalinitialValue:number
Initial zoom value. Defaults to 1.
range?
optionalrange: [number,number]
Zoom range to support. Defaults to [0.05, 3]