Skip to content
Block Kit for React
Esc
↑↓navigate↵open⌘Jpreview
On this page

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.

Your AppAPP

Messages sent this week

Messages
05001,0001,5002,0002,5003,000MonTueWedThuFri
Day
Messages

Fields

PropType
typestring

Always `data_visualization`.

Typestring
title?string

Shown above the chart. Omit it and no heading renders.

Typestring
chartChart

The chart itself.

TypeChart

Chart

PropType
type"bar" | "line" | "area" | "pie"

The chart kind. No other values are supported.

Type"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.

TypeChartSeries[]
segments?{ label: string; value: number }[]

Wedges, for a `pie` chart only. A negative value is clamped to 0.

Type{ label: string; value: number }[]
axis_config?AxisConfig

Axis labels and category overrides. Ignored for `pie`.

TypeAxisConfig

ChartSeries 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

Your AppAPP

Messages sent by platform

Messages
03006009001,2001,5001,800MonTueWedThuFri
Day
DesktopMobile

Bar: negative values

Your AppAPP

Net headcount change

People (delta)
-20246MonTueWedThuFri
Day
Delta

Bars for negative values extend below the zero line instead of being clipped or flipped.

Line: negative values

Your AppAPP

Net revenue delta (vs. forecast)

Delta ($)
-200-1000100200MonTueWedThuFri
Day
Delta

Area: multiple series

Your AppAPP

Concurrent users by platform

Users
01,0002,0003,0004,000MonTueWedThuFri
Day
DesktopMobile

Pie: multiple segments

Your AppAPP

Plan distribution by tier

FreeProBusiness+Enterprise

Pie: one dominant segment

Your AppAPP

Active sessions by client (one dominant)

DesktopMobileWebOther

Was this page helpful?