Data visualization
Bar, line, area, and pie charts for a series of labeled values.
data_visualization renders one chart from a series of labeled values, or segments for a pie.
It isn’t part of the public @slack/types package, so treat this page’s field list as the reference.
Fields
typestring
Always `data_visualization`.
stringtitle?string
Shown above the chart. Omit it and no heading renders.
stringchartChart
The chart itself.
ChartChart
type"bar" | "line" | "area" | "pie"
The chart kind. No other values are supported.
"bar" | "line" | "area" | "pie"series?ChartSeries[]
One or more series, for `bar`, `line`, and `area` charts. One entry draws a single series; two or more group bars or plot multiple lines/areas.
ChartSeries[]segments?{ label: string; value: number }[]
Wedges, for a `pie` chart only. A negative value is clamped to 0.
{ label: string; value: number }[]axis_config?AxisConfig
Axis labels and category overrides. Ignored for `pie`.
AxisConfigChartSeries is { name: string; data: { label: string; value: number }[] }. AxisConfig is
{ categories?: string[]; x_label?: string; y_label?: string }. categories overrides the x-axis
labels; when omitted they’re taken from the first series’ data[].label.
Examples
Bar: single series
The preview above shows one series as grouped bars.
Bar: multiple series
Bar: negative values
Bars for negative values extend below the zero line instead of being clipped or flipped.