Pie Chart
A pie chart: the parts of a whole as the slices of a disc, each as much of the turn as its value is of their sum. With a hole in its middle it is a ring, a donut, which has room in the hole for a total or a title.
import com.pantrixui.components.chart.pie.PantrixPieChart
- Angle.
startAngleis where the first slice begins, in degrees clockwise from twelve o'clock;sweepAngleis how much of a turn the slices take together: 360 a whole pie, 180 a half pie. A half pie is as wide as its box allows. - Order and small slices.
sortlays the slices out as given, largest first or smallest first.othersgathers the slices smaller than a share of the whole into one slice at the end; that slice's tooltip and what a screen reader hears of it name each one it holds. - Values. A slice's value is an amount; the chart works out its share. A slice with no value, or one that is not over nought, has no place in the pie, and its name stays in the legend.
- Ring.
holesays how much of the radius is cut out: nought is a whole pie, six tenths a ring with room to write in.centerstands in the hole, in the largest box the hole holds; in a half ring, in the hole of the half that is drawn. - The slice pointed at. The slice under the pointer, or the one that is touched, stands out past the pie's rim and the tooltip writes its value and its share. With a finger, another touch on the slice that is pointed at lets go of it.
- Legend. The names of the slices, each beside its colour. Pressing an entry takes the slice out of the pie; the slices that are left share the whole anew.
- Labels.
labelswrites each slice's share on the slice, in black or white, whichever reads better on its colour; its value, whereformatis given. A label that does not fit on its slice is written outside it with the slice's name, and a line in the slice's colour links it to the slice.positionchanges this:Outsidewrites all of them outside,Centeronly inside. The pie makes room at its two sides for the words outside it; where that room would leave the pie less than half its size, the words stay inside only. - Direction. The pie turns clockwise in a language read from right to left too; its legend follows the reading direction.
- Export.
exportputs a button over the chart: the chart is made, as it is on the screen and without the part that is pointed at or its tooltip, into a PNG, an SVG or a PDF file and handed to the app. - Automation. The chart is
PieChart_<tagKey>; the pie.Plot, the slices.Slice_<number>, the legend's entries.Legend_<the slice's key>, the tooltip.Tooltip.
Examples
The shares of a whole
At its plainest: the slices, each with its key, its name and its value. The first slice starts at twelve o'clock and the others follow it clockwise; the legend stands under the chart.
Move the pointer over a slice, or touch it: the slice stands out and the tooltip writes the number of visits and its share of the total. Press a name in the legend: the slice goes and the others share the whole anew.
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
description = "Visits by source",
tagKey = "plain"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
A ring with its total in the middle
A pie with its middle cut out is a ring: six tenths of the radius are cut out (hole) and the total is written in the hole (center).
Take a slice out from the legend: the number in the middle becomes the total of the slices that are left. The screen keeps the chart's state itself (rememberChartState) and reads the hidden slices from it.
val state = rememberChartState()
val strings = PantrixTheme.strings
val total = VISIT_SOURCES.filter { it.key !in state.hidden }.sumOf { it.visits }
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
hole = 0.6f,
center = {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
PantrixText(text = strings.decimal(total), style = PantrixTheme.typography.title)
PantrixText(text = "visits", color = PantrixTheme.colors.textSecondary)
}
},
state = state,
description = "Visits by source, with their total in the middle",
tagKey = "ring"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
The shares on the slices
The shares are on the slices (labels): each slice has its share of the total written on it, in black or white, whichever reads better on the slice's colour. Turn the switch: the labels write the value, not the share (ChartDataLabels(format = …)).
A label that does not fit on its slice is written outside it with the slice's name; a line links it to its slice.
var values by remember { mutableStateOf(false) }
val strings = PantrixTheme.strings
PantrixSwitchButton(
checked = values,
onCheckedChange = { values = it },
label = "Write the values",
tagKey = "pie_labels_values"
)
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
labels = if (values) ChartDataLabels(format = { strings.decimal(it) }) else ChartDataLabels(),
description = "Visits by source, with their shares",
tagKey = "labels"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
Where the labels go
Where the labels go (ChartDataLabels(position = …)). "Automatic" (Auto) writes each share on its slice and the ones that do not fit outside; "Outside" (Outside) writes each slice's name and share beside the pie; "Inside" (Center) leaves out the ones that do not fit. A line in the slice's colour links the words outside to their slice, and the pie makes room for them at its two sides.
var place by remember { mutableStateOf(ChartDataLabelPosition.Outside) }
PantrixSegmentButton(
options = PIE_LABEL_PLACES,
selected = place,
onSelect = { place = it },
fullWidth = false,
tagKey = "pie_label_place"
)
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
labels = ChartDataLabels(position = place),
legend = null,
description = "Visits by source, with their shares",
tagKey = "label_place"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
private val PIE_LABEL_PLACES = listOf(
SegmentOption(value = ChartDataLabelPosition.Auto, label = "Automatic", tagKey = "auto"),
SegmentOption(value = ChartDataLabelPosition.Outside, label = "Outside", tagKey = "outside"),
SegmentOption(value = ChartDataLabelPosition.Center, label = "Inside", tagKey = "inside")
)
A half ring
A half ring: the slices begin at nine o'clock (startAngle = 270f) and take half a turn (sweepAngle = 180f). The ring is as wide as its box allows, and the total stands in the hole of the half that is drawn.
val total = PantrixTheme.strings.decimal(VISIT_SOURCES.sumOf { it.visits })
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
hole = 0.6f,
startAngle = 270f,
sweepAngle = 180f,
center = { PantrixText(text = total, style = PantrixTheme.typography.title) },
description = "Visits by source, a half ring",
tagKey = "half"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
Order and small slices
Visits by browser, largest first (sort = PieSort.Descending). The slices smaller than five hundredths of the whole are gathered into one slice at the end (others = PieOthers(share = 0.05f)); its name is the theme's word. Move the pointer over the gathered slice, or touch it: the tooltip names each one it holds. Turn the switch off: every slice shows.
var gathered by remember { mutableStateOf(true) }
PantrixSwitchButton(
checked = gathered,
onCheckedChange = { gathered = it },
label = "Gather the small ones",
tagKey = "pie_gathered"
)
PantrixPieChart(
slices = BROWSER_VISITS.map { PieSlice(it.key, it.name, it.visits) },
sort = PieSort.Descending,
others = if (gathered) PieOthers(share = 0.05f) else null,
labels = ChartDataLabels(),
legend = ChartLegend(position = ChartLegendPosition.End),
description = "Visits by browser",
tagKey = "gathered"
)
private data class Browser(
val key: String,
val name: String,
val visits: Int
)
private val BROWSER_VISITS = listOf(
Browser("safari", "Safari", 198),
Browser("firefox", "Firefox", 42),
Browser("chrome", "Chrome", 612),
Browser("opera", "Opera", 24),
Browser("edge", "Edge", 54),
Browser("uc", "UC", 17),
Browser("samsung", "Samsung", 31),
Browser("yandex", "Yandex", 22)
)
Where the legend stands
The legend stands on one of the chart's four sides. Above and under it the entries are set in a row, which goes on to another line where they do not fit; at the sides they stand under one another and take no more than four tenths of the width. The pie is the largest circle that fits in the middle of what the legend leaves.
var place by remember { mutableStateOf(ChartLegendPosition.End) }
PantrixSegmentButton(
options = PIE_LEGEND_PLACES,
selected = place,
onSelect = { place = it },
fullWidth = false,
tagKey = "pie_legend_place"
)
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
hole = 0.6f,
legend = ChartLegend(position = place),
description = "Visits by source",
tagKey = "legend"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
private val PIE_LEGEND_PLACES = listOf(
SegmentOption(value = ChartLegendPosition.Top, label = "Top", tagKey = "top"),
SegmentOption(value = ChartLegendPosition.Bottom, label = "Bottom", tagKey = "bottom"),
SegmentOption(value = ChartLegendPosition.Start, label = "Start", tagKey = "start"),
SegmentOption(value = ChartLegendPosition.End, label = "End", tagKey = "end")
)
Pressing a slice
onSelect gives the slice that is pressed: its key, its name, its value and how the chart writes it. Press a slice, or go to one with the keyboard and press Enter: the line under the card writes what was pressed.
val report = LocalExampleEvents.current
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
description = "Visits by source",
onSelect = { point -> report("${point.name}: ${point.text}") },
tagKey = "pressed"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
Values that change
When the values change the slices go from where they were to where they are now. Turn the switch: the chart shows last year's visits. The slices are matched by their keys: a slice whose name or value changes is the same slice, and keeps its colour and its place in the legend.
var before by remember { mutableStateOf(false) }
PantrixSwitchButton(
checked = before,
onCheckedChange = { before = it },
label = "Last year",
tagKey = "pie_before"
)
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, if (before) it.before else it.visits) },
hole = 0.6f,
labels = ChartDataLabels(),
description = if (before) "Visits by source last year" else "Visits by source this year",
tagKey = "changing"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
Your own colours and sizes
A chart's own look. Each slice names its own colour (PieSlice(color = …)): shades of one violet from the palette in place of the theme's chart colours. ChartStyle gives the sizes: no gap between the slices (sliceGap) and a lower chart (height). A field that is not given stays the theme's.
val dark = LocalDemoDarkTheme.current
val violet = PantrixPalette.Violet
val tones = if (dark) {
listOf(violet.shade300, violet.shade400, violet.shade500, violet.shade600, violet.shade700)
} else {
listOf(violet.shade800, violet.shade600, violet.shade500, violet.shade400, violet.shade300)
}
PantrixPieChart(
slices = VISIT_SOURCES.mapIndexed { index, source ->
PieSlice(source.key, source.name, source.visits, color = tones[index])
},
labels = ChartDataLabels(),
description = "Visits by source",
style = ChartStyle(sliceGap = 0.dp, height = 180.dp),
tagKey = "own_look"
)
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
Export
export = ChartExport(...) puts an export button over the chart: press it and choose the kind (PNG, SVG or PDF). The chart makes the file and hands it to onExport; below, its name and size show, and a PNG's picture, and "Save the file" hands it over in the platform's way.
The file has the pie as it is on the screen, the legend under it; the slice that is pointed at and its tooltip are not in it. What stands in the hole by center is not in the file either.
var file by remember { mutableStateOf<ChartExportFile?>(null) }
PantrixPieChart(
slices = VISIT_SOURCES.map { PieSlice(it.key, it.name, it.visits) },
hole = 0.6f,
center = { PantrixText(text = "Visits", color = PantrixTheme.colors.textSecondary) },
description = "Visits by source",
tagKey = "exported",
export = ChartExport(fileName = "visit-sources") { file = it }
)
ExportedFile(file, tagKey = "exported")
private data class VisitSource(
val key: String,
val name: String,
val visits: Int,
val before: Int
)
private val VISIT_SOURCES = listOf(
VisitSource("direct", "Direct", visits = 420, before = 380),
VisitSource("search", "Search", visits = 310, before = 240),
VisitSource("social", "Social", visits = 150, before = 260),
VisitSource("mail", "E-mail", visits = 80, before = 90),
VisitSource("other", "Other", visits = 40, before = 30)
)
API
slices
A pie chart: the parts of a whole as the slices of a disc, each as much of the turn as its value is of their sum. With a hole in its middle it is a ring, a donut, which has room in the hole for a total or a title.
| Parameter | Type | Default | What it is |
|---|---|---|---|
slices | List<PieSlice> | the slices, in the order they lie in the pie where sort keeps it, clockwise from startAngle. Their keys tell them apart, and two with one key are refused. | |
modifier | Modifier | Modifier | the chart's modifier. A height here is the chart's, the legend's with it. |
hole | Float | 0f | how much of the pie's radius is cut out of its middle: nought for a whole pie, and six tenths for a ring with room to write in. No more than nine tenths. |
center | (@Composable () -> Unit)? | null | what stands in the hole of a ring: a total, a title. It has the largest box the hole holds, of a half ring in the half that is drawn. A whole pie has no place for it. |
labels | ChartDataLabels? | null | what is written about the slices: each slice's share of the whole, or its value as the labels' format writes it. On a slice it is written in black or white, whichever reads on the slice; outside it, the slice's name comes before it, with a line in the slice's colour leading to it. Their position says where: Outside outside every slice, Auto on each slice that holds its words and outside the others, and any other on the slices only, where a slice too small to hold its words has none. Words outside stand in a column at each side; where a side has no room for all of them, one under another, the smallest slices there have none. null writes nothing about them. |
legend | ChartLegend? | ChartLegend() | where the names of the slices stand. null shows none. |
tooltip | ChartTooltip? | ChartTooltip() | what is shown for the slice that is pointed at: its value, as the tooltip's format writes it or in the theme's language, and its share of the whole. null shows none. Whether a tooltip is shared and whether it has a crosshair say nothing to a pie. |
empty | (@Composable () -> Unit)? | null | what the chart shows while it has no value to draw, in the place of the theme's words for it ("No data"), which a screen reader is then not told either. null writes the words. |
state | ChartState | rememberChartState() | what the reader has hidden and what they point at: the chart's own where none is given. A slice is hidden by its key, and pointed at by a selection whose x is its key. |
description | String? | null | what the pie shows, in a few words, for a screen reader: the first thing it says of the chart. Left out, the chart is announced by the names of its slices. |
onSelect | ((ChartPoint) -> Unit)? | null | called with the slice that is pressed: its key as the point's series and its x, its name, its value, and what the pie writes for it. |
style | ChartStyle? | null | this chart's own geometry: the fields set here, with the theme's for the rest. |
colors | ChartColors? | null | this chart's own colours, where they are not the theme's. |
tagKey | String? | null | the chart's automation key: the chart is PieChart_<tagKey>, the pie PieChart_<tagKey>.Plot, a slice PieChart_<tagKey>.Slice_<number> counted from one, the legend's entry of a slice PieChart_<tagKey>.Legend_<slice's key> and the tooltip PieChart_<tagKey>.Tooltip. A press on a slice is reported as a PieChart select event with the slice's key, and a press on a legend's entry as a toggle event with the key and whether the slice is shown. Nothing of the values is reported. |
startAngle | Float | 0f | where the first slice begins, in degrees clockwise from twelve o'clock: 270 begins at nine o'clock. |
sweepAngle | Float | 360f | how many degrees the slices take together: a whole turn, 360, or 180 for a half pie, from over nought up to a whole turn. |
sort | PieSort | PieSort.Given | the order the slices lie in: as given, the largest first or the smallest first. |
others | PieOthers? | null | how the smallest slices are gathered into one. null gathers none. |
export | ChartExport? | null | what lets the reader take the chart out of the app as a PNG, an SVG or a PDF: a button over the chart makes the file of it as it is and hands it over (see ChartExport). null, the chart has no such button. What stands in the hole, center, is not in the file. |
ChartStyle
A chart's geometry: how tall it is where nothing says, how thick its lines and how large its marks are, and the room between its parts; and whether its fills have textures besides their colours.
| Parameter | Type | Default | What it is |
|---|---|---|---|
height | Dp | Dp.Unspecified | How tall a chart's plot is, with its axes, where the chart's modifier gives it no height. A legend above or under the plot adds its own. |
lineWidth | Dp | Dp.Unspecified | The width of a series' line. |
markerSize | Dp | Dp.Unspecified | The width and height of the mark on a point. |
selectedMarkerSize | Dp | Dp.Unspecified | The same of the mark on the point that is pointed at. |
gridWidth | Dp | Dp.Unspecified | The width of the grid's lines, of the lines along the axes and of the line that marks the place pointed at. Zero draws none. |
labelGap | Dp | Dp.Unspecified | Between the plot and what is written beside it and under it, and between that and an axis' title. |
tickSpacing | Dp | Dp.Unspecified | The least room between two values marked along the axis of values: what decides how many are marked where the axis does not say. |
legendGap | Dp | Dp.Unspecified | Between the legend and the chart it stands beside. |
legendItemGap | Dp | Dp.Unspecified | Between one entry of the legend and the next. |
swatchSize | Dp | Dp.Unspecified | How wide the sample of a series is in the legend and in the tooltip: a short run of its line, or a patch of its fill. |
swatchGap | Dp | Dp.Unspecified | Between that sample and the name after it. |
tooltipShape | ShapeSpec | ShapeSpec.Unspecified | The tooltip's corners: a step of the brand's shape scale, or a fixed shape. |
tooltipHorizontalPadding | Dp | Dp.Unspecified | Between the tooltip's sides and what it holds. |
tooltipVerticalPadding | Dp | Dp.Unspecified | Between its top and bottom and what it holds, and between its heading and rows. |
tooltipGap | Dp | Dp.Unspecified | Between the place pointed at and the tooltip beside it. |
tooltipElevation | Dp | Dp.Unspecified | The tooltip's shadow. |
barGap | Dp | Dp.Unspecified | Between two bars that stand side by side at a place. Bars too thin for it stand closer. |
barMaxWidth | Dp | Dp.Unspecified | The widest a bar is, however much room its place has: a chart of three places is not three slabs. |
barRadius | Dp | Dp.Unspecified | How round the corners of a bar's end are, the end away from nought. |
sliceGap | Dp | Dp.Unspecified | Between two slices of a pie that lie side by side, the same from the pie's middle to its rim. |
selectedSliceOffset | Dp | Dp.Unspecified | How far the slice of a pie that is pointed at stands out past the pie's rim. The pie keeps this much room about itself, so that the slice has where to stand. |
gaugeWidth | Dp | Dp.Unspecified | How thick the arc of a gauge is. An arc is no thicker than half its radius. |
meterHeight | Dp | Dp.Unspecified | How tall the bar of a meter group is. |
trackerHeight | Dp | Dp.Unspecified | How tall the blocks of a status tracker are. |
bubbleMinSize | Dp | Dp.Unspecified | How far across the smallest bubble of a scatter chart is: a point whose size is nothing, or too little to be seen as an area, is still a point. |
bubbleMaxSize | Dp | Dp.Unspecified | How far across its largest bubble is: the one whose size is the most of the chart's. |
navigatorHeight | Dp | Dp.Unspecified | How tall the strip under a chart's plot is, on which the part of the chart that is in view is marked and moved, in a chart whose zoom has one: how wide, beside a plot whose places go down its side. |
barBandShare | Float | Float.NaN | How much of a place's band its bars take, more than nought and one at the most: the rest is the room between one place's bars and the next's. Bars are no wider than barMaxWidth all the same. |
markLineWidth | Dp | Dp.Unspecified | The width of a mark's line: a target, a limit, a day. Zero draws none, and the mark's words are written all the same. |
markBandAlpha | Float | Float.NaN | How much of its colour a mark's band is drawn in, from nought to one: a band lies behind the series, and is a tint. |
patterns | Boolean? | null | Whether the fills of a chart's series, slices and tiles are drawn with textures besides their colours, and its lines broken in turn (ChartPattern): what tells them apart for a reader who cannot tell the colours apart. Left out, as the system is set: on where it is set to tell things apart without colour, iOS's "Differentiate Without Color" and Android's colour correction, and off otherwise. |
nodeWidth | Dp | Dp.Unspecified | How wide a node of a sankey is. |
nodeGap | Dp | Dp.Unspecified | Between two nodes of a column of a sankey. |
ChartColors
What a chart is painted with, for a chart that does not take the theme's colours: a colour that is set is used, and one that is left out stays the theme's.
| Parameter | Type | Default | What it is |
|---|---|---|---|
series | List<Color> | emptyList() | The colours the series are drawn in, in the order they are handed out, for the series that name none of their own. Empty, they are the theme's chart colours. |
grid | Color | Color.Unspecified | The lines drawn across the chart at the marks of an axis. The theme's divider. |
axis | Color | Color.Unspecified | The line along an axis. The theme's border. |
label | Color | Color.Unspecified | What is written beside the axes: the values, the places and the axes' titles, and the names in the legend. The theme's textSecondary. |
crosshair | Color | Color.Unspecified | The line that marks the place pointed at. The theme's borderHover: stronger than the grid it crosses, and quieter than the series it stands behind. |
tooltipContainer | Color | Color.Unspecified | The tooltip's fill. The theme's surface. |
tooltipBorder | Color | Color.Unspecified | The tooltip's edge. The theme's border. |
tooltipText | Color | Color.Unspecified | The tooltip's heading and its values. The theme's textPrimary. |
tooltipLabel | Color | Color.Unspecified | The names of the series in the tooltip. The theme's textSecondary. |
rising | Color | Color.Unspecified | What a value that goes up is drawn in: a step of a waterfall that adds. The theme's success. |
falling | Color | Color.Unspecified | What a value that goes down is drawn in: a step of a waterfall that takes away. The theme's danger. |
Accessibility
- Keyboard. The pie is one stop for Tab: the arrows go from slice to slice, and after the last slice back to the first; Home and End go to the first and the last slice, Escape lets go, Enter and Space press the slice that is pointed at. On desktop and on the web a press on the pie gives it the focus: the arrows that follow go round this pie.
- Screen reader. The chart says its
descriptionfirst, then each slice with its name, its value and its share.