Pantrix UI

Bar Chart

A bar chart of rows that are given once: at each place the rows name, a bar for each of the values read from them, side by side, or on one another where they are stacked.

import com.pantrixui.components.chart.bar.PantrixBarChart

Examples

A single amount

At its plainest: the rows, the x that gives a row's place, and a single value. A chart of one series has no legend.

Move the pointer over a month, or touch the month: its band is shaded and the tooltip writes that month's sales.

PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(ChartValue("online", "Online") { it.online }),
    description = "Online sales by month",
    tagKey = "plain"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

Side by side or stacked

Three sales channels, side by side each month: which of them leads in each month is read. Turn the switch: the bars go on one another (stacked) and each month's total is read too; the channels' shares are seen from the colours.

Press a name in the legend: the channel goes, and the bars that stay widen or the stack gets shorter.

var stacked by remember { mutableStateOf(false) }
PantrixSwitchButton(
    checked = stacked,
    onCheckedChange = { stacked = it },
    label = "Stacked",
    tagKey = "bar_stacked"
)
PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("stores", "Stores") { it.stores },
        ChartValue("partners", "Dealers") { it.partners }
    ),
    stacked = stacked,
    description = "Sales of three channels by month",
    tagKey = "stacked"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

Values that go below zero

Values on both sides of zero: a month's profit or loss. A profit goes up from zero and a loss down from it; a line is drawn at zero. The values are written short (format).

val strings = PantrixTheme.strings
PantrixBarChart(
    data = BALANCE,
    x = { it.first },
    values = listOf(ChartValue("balance", "Profit") { it.second }),
    yAxis = ChartAxis(format = { strings.compact(it) }),
    description = "Profit and loss by month",
    tagKey = "below_zero"
)

private val BALANCE = listOf(
    "Jan" to 64_000,
    "Feb" to 31_000,
    "Mar" to -12_000,
    "Apr" to -38_000,
    "May" to 22_000,
    "Jun" to 87_000
)

Bars read one at a time

The tooltip tells the series apart (shared = false): the bar under the pointer is marked by a ring and the tooltip writes its value alone. On a keyboard the arrows up and down go from one bar to the other. Press a bar: the row underneath writes what was pressed.

var pressed by remember { mutableStateOf<String?>(null) }
PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("stores", "Stores") { it.stores }
    ),
    tooltip = ChartTooltip(shared = false),
    onSelect = { pressed = "${it.label}, ${it.name}: ${it.text}" },
    description = "Online and store sales by month",
    tagKey = "one_by_one"
)
PantrixText(text = pressed ?: "Press a bar")

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

Many places

Thirty days. Each day's band is narrow and the bars are thin to match; the days' names are left out by a rule. All the values stay where they are: the value of every day is shown with a pointer or a finger.

PantrixBarChart(
    data = DAYS,
    x = { it.first },
    values = listOf(ChartValue("orders", "Orders") { it.second }),
    xAxis = ChartAxis(label = { "Day $it" }),
    description = "Daily orders of the last thirty days",
    tagKey = "many_places"
)

private val DAYS = List(30) { day -> (day + 1) to 120 + day * 4 - (if (day % 7 >= 5) 45 else 0) + (day * 37) % 23 }

Long names

Places with long names: a shop's eight best-selling products. Where the names do not fit side by side, and more of them fit turned, they are written turned an eighth, each ending under its place; where they do not fit turned either, every second or third is written, as before. The first and the last name are always written. A very long name is cut short so that it reaches no further down than a third of the chart's height, and a name at the box's edge so that it stays inside. Short names stay flat.

PantrixBarChart(
    data = BEST_SELLERS,
    x = { it.first },
    values = listOf(ChartValue("sold", "Sold (units)") { it.second }),
    description = "This month's sales of the eight best-selling products",
    tagKey = "long_names"
)

private val BEST_SELLERS = listOf(
    "Wireless headphones" to 412,
    "Smart watch" to 356,
    "Portable charger" to 298,
    "Bluetooth speaker" to 251,
    "Gaming mouse" to 214,
    "Mechanical keyboard" to 187,
    "High-resolution webcam" to 143,
    "USB-C hub" to 121
)

Horizontal bars

The same eight products, as horizontal bars (horizontal = true): the names stand beside the chart, each on its own line, written across; the bars go from the left and their values are written at their ends (labels). The target line (marks) stands on the axis of values, so it cuts the chart from top to bottom.

Move the pointer over a product or touch it: its row is shaded and the tooltip writes its value. With the keyboard, on the chart, the down and up arrows go from product to product.

PantrixBarChart(
    data = BEST_SELLERS,
    x = { it.first },
    values = listOf(ChartValue("sold", "Sold (units)") { it.second }),
    horizontal = true,
    labels = ChartDataLabels(),
    marks = listOf(ChartReferenceLine(y = 300, label = "Target")),
    description = "This month's sales of the eight best-selling products, as horizontal bars",
    tagKey = "horizontal"
)

private val BEST_SELLERS = listOf(
    "Wireless headphones" to 412,
    "Smart watch" to 356,
    "Portable charger" to 298,
    "Bluetooth speaker" to 251,
    "Gaming mouse" to 214,
    "Mechanical keyboard" to 187,
    "High-resolution webcam" to 143,
    "USB-C hub" to 121
)

Horizontal and stacked

Horizontal bars stand side by side or stacked too: here three channels' monthly sales, stacked. The legend takes a channel out; each stack's total is written at the end of its bar (total).

PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("stores", "Stores") { it.stores },
        ChartValue("partners", "Dealers") { it.partners }
    ),
    stacked = true,
    horizontal = true,
    labels = ChartDataLabels(total = true),
    description = "Sales of three channels by month, as horizontal stacked bars",
    tagKey = "horizontal_stacked"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

A long ranking

The number of stores in forty provinces, from the most to the fewest: this many rows do not fit in the chart's height. In a horizontal chart that is looked at closer (zoom) the first ten provinces fill the plot (ChartState.zoomTo); the navigator (navigator = true) stands upright at the chart's right and shows all the provinces, and the part in view is dragged along it or made larger by its ends.

Drag the chart up and down with the mouse, turn the wheel, or slide two fingers along it; the wheel with Ctrl, and two fingers moved apart or together, look closer or further off. The buttons go up and down, look further off and closer, and show all the provinces again. With the keyboard the arrow down goes to the next province; reaching one that is out of view moves the part in view.

val state = rememberChartState()
LaunchedEffect(state) { state.zoomTo(start = 0f, end = 0.25f) }
PantrixBarChart(
    data = PROVINCES,
    x = { it.first },
    values = listOf(ChartValue("stores", "Stores") { it.second }),
    modifier = Modifier.height(360.dp),
    horizontal = true,
    zoom = ChartZoom(navigator = true),
    state = state,
    description = "The number of stores in forty provinces, from the most to the fewest",
    tagKey = "long_ranking"
)

private val PROVINCES = PROVINCE_NAMES.mapIndexed { place, name -> name to 2400 / (place + 3) + 5 }

private val PROVINCE_NAMES = (
    "İstanbul Ankara İzmir Bursa Antalya Konya Adana Gaziantep Şanlıurfa Kocaeli " +
        "Mersin Diyarbakır Hatay Manisa Kayseri Samsun Balıkesir Kahramanmaraş Van Aydın " +
        "Tekirdağ Sakarya Denizli Muğla Eskişehir Mardin Trabzon Malatya Ordu Erzurum " +
        "Afyonkarahisar Sivas Tokat Zonguldak Adıyaman Elazığ Batman Çorum Kütahya Şırnak"
).split(" ")

Values over the bars

Values are written beside the bars (labels): over the end of a bar that stands by itself, under a bar that goes below zero. Turn the switch: in stacked bars a value is written inside its bar, in the black or white that reads better on the bar's colour, and the stack's total over its end (total). The line marks a target no month reaches (marks); where it runs through a label, the label is written on a plate that covers the line there. The target's words stand at the line's start (labelPosition): at its end they would take the place of the highest months' labels.

Pick where the labels go with the buttons (position): "Auto" is wherever there is room; the others are past the bar's end, inside its end, its middle and its base. Past the end of a stacked bar is the next bar: there the label is written inside the end of its own bar.

A label is written where it has room: one that would stand on another label, reach out of the chart or not fit its bar is left out; the value is still in the tooltip and with the screen reader. ChartDataLabels(format = …) says how a value is written; left out, the axis' way of writing is used.

var stacked by remember { mutableStateOf(false) }
var position by remember { mutableStateOf(ChartDataLabelPosition.Auto) }
PantrixSwitchButton(
    checked = stacked,
    onCheckedChange = { stacked = it },
    label = "Stacked",
    tagKey = "bar_labels_stacked"
)
PantrixSegmentButton(
    options = LABEL_PLACES,
    selected = position,
    onSelect = { position = it },
    fullWidth = false,
    tagKey = "label_place"
)
PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("stores", "Stores") { it.stores }
    ),
    stacked = stacked,
    labels = ChartDataLabels(position = position, total = stacked),
    marks = listOf(
        ChartReferenceLine(
            y = if (stacked) 140 else 75,
            label = "Target",
            labelPosition = ChartMarkLabelPosition.Start
        )
    ),
    description = "Online and store sales by month, with their values",
    tagKey = "labels"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

private val LABEL_PLACES = listOf(
    SegmentOption(value = ChartDataLabelPosition.Auto, label = "Auto", tagKey = "auto"),
    SegmentOption(value = ChartDataLabelPosition.Outside, label = "Out", tagKey = "outside"),
    SegmentOption(value = ChartDataLabelPosition.InsideEnd, label = "End", tagKey = "inside_end"),
    SegmentOption(value = ChartDataLabelPosition.Center, label = "Middle", tagKey = "center"),
    SegmentOption(value = ChartDataLabelPosition.InsideStart, label = "Base", tagKey = "inside_start")
)

Stacked as shares

Each channel's share of every month: each month's bar is a hundred percent and the channels take their shares of it (stacking = ChartStacking.Percent). What reads is not the sales themselves but how they are shared: in which month the online share grew. The axis writes percentages and the labels the shares; the tooltip writes each channel's sales with its share, and then the month's total.

PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("stores", "Stores") { it.stores },
        ChartValue("partners", "Dealers") { it.partners }
    ),
    stacked = true,
    stacking = ChartStacking.Percent,
    labels = ChartDataLabels(),
    description = "Each channel's share of sales by month",
    tagKey = "shares"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

Second axis

Two kinds of value: sales in thousands of lira, the online share in percent. The share is read by the second axis (ChartValue(axis = ChartYAxis.Second)), which stands at the chart's other side and writes its values its own way (secondYAxis). Both axes start at zero, and their zeros are on one line.

val strings = PantrixTheme.strings
PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("share", "Online share", axis = ChartYAxis.Second) {
            it.online.toDouble() / (it.online + it.stores)
        }
    ),
    secondYAxis = ChartAxis(format = { strings.percent(it) }),
    description = "Online sales by month, and their share of all sales",
    tagKey = "second_axis"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

Your own sizes

A chart's own sizes: the bars have square ends (barRadius), are no wider than twenty-four dp (barMaxWidth), stand further apart side by side (barGap) and take nine tenths of a month's band (barBandShare). A field that is not given stays the theme's.

PantrixBarChart(
    data = SALES,
    x = { it.month },
    values = listOf(
        ChartValue("online", "Online") { it.online },
        ChartValue("stores", "Stores") { it.stores }
    ),
    description = "Online and store sales by month",
    style = ChartStyle(barRadius = 0.dp, barMaxWidth = 24.dp, barGap = 6.dp, barBandShare = 0.9f),
    tagKey = "own_look"
)

private data class Sales(
    val month: String,
    val online: Int,
    val stores: Int,
    val partners: Int
)

private val SALES = listOf(
    Sales("Jan", online = 42, stores = 58, partners = 21),
    Sales("Feb", online = 51, stores = 49, partners = 18),
    Sales("Mar", online = 48, stores = 61, partners = 26),
    Sales("Apr", online = 63, stores = 55, partners = 24),
    Sales("May", online = 70, stores = 52, partners = 31),
    Sales("Jun", online = 66, stores = 64, partners = 29)
)

API

data

A bar chart of rows that are given once: at each place the rows name, a bar for each of the values read from them, side by side, or on one another where they are stacked.

ParameterTypeDefaultWhat it is
dataList<T>the rows.
x(T) -> Anywhere a row stands along the chart: a name, a day, anything that is equal to itself.
valuesList<ChartValue<T>>the series: what each reads from a row, and how it is called and coloured. A bar has neither the dashes nor the mark a value may name.
modifierModifierModifierthe chart's modifier. A height here is the chart's, the legend's with it.
stackedBooleanfalsewhether the bars of a place stand on one another, in the order of values, and not side by side.
stackingChartStackingChartStacking.Normalhow the stacked bars stand on one another: as their values, or as their shares of the stack. Bars that are not stacked have no stack for it to go by.
horizontalBooleanfalsewhether the places go down the chart's side and the bars along it, and not along its foot and up.
labelsChartDataLabels?nullthe values written at the ends of the bars, or inside the bars of a stack, where they have room. null writes none.
xAxisChartAxis?ChartAxis()the axis of the places, under the chart, or beside it where it is horizontal. null draws nothing of it.
yAxisChartAxis?ChartAxis()the axis of the values, beside the chart, or under it where it is horizontal. null draws nothing of it.
secondYAxisChartAxis?ChartAxis()the second axis of the values, at the chart's other side, or over it where it is horizontal: drawn where a value is read by it (ChartValue.axis), and not otherwise. null draws nothing of it.
marksList<ChartMark>emptyList()the lines and the bands drawn in the plot besides the series: a target, a limit, a stretch of places.
legendChartLegend?ChartLegend()where the names of the series stand. null shows none.
tooltipChartTooltip?ChartTooltip()what is shown for the place that is pointed at. null shows none.
zoomChartZoom?nullwhat lets the reader look closer at a part of the places and move along the rest. null, which it is unless the chart is given one, shows all the places and no more.
exportChartExport?nullwhat lets the reader take the chart out of the app as a file: a picture, or a drawing that is sharp at any size. null, which it is unless the chart is given one, and the chart has no such button.
empty(@Composable () -> Unit)?nullwhat the chart shows in its plot 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. A file the chart is exported as says them.
stateChartStaterememberChartState()what the reader has hidden and what they point at: the chart's own where none is given.
descriptionString?nullwhat the chart shows, in a few words, for a screen reader.
onSelect((ChartPoint) -> Unit)?nullcalled with the value that is pressed.
styleChartStyle?nullthis chart's own geometry.
colorsChartColors?nullthis chart's own colours, where they are not the theme's.
tagKeyString?nullthe chart's automation key. The chart is tagged as the PantrixChart it is, Chart_<tagKey>, and its parts and events are that chart's.

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.

ParameterTypeDefaultWhat it is
heightDpDp.UnspecifiedHow 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.
lineWidthDpDp.UnspecifiedThe width of a series' line.
markerSizeDpDp.UnspecifiedThe width and height of the mark on a point.
selectedMarkerSizeDpDp.UnspecifiedThe same of the mark on the point that is pointed at.
gridWidthDpDp.UnspecifiedThe 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.
labelGapDpDp.UnspecifiedBetween the plot and what is written beside it and under it, and between that and an axis' title.
tickSpacingDpDp.UnspecifiedThe least room between two values marked along the axis of values: what decides how many are marked where the axis does not say.
legendGapDpDp.UnspecifiedBetween the legend and the chart it stands beside.
legendItemGapDpDp.UnspecifiedBetween one entry of the legend and the next.
swatchSizeDpDp.UnspecifiedHow 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.
swatchGapDpDp.UnspecifiedBetween that sample and the name after it.
tooltipShapeShapeSpecShapeSpec.UnspecifiedThe tooltip's corners: a step of the brand's shape scale, or a fixed shape.
tooltipHorizontalPaddingDpDp.UnspecifiedBetween the tooltip's sides and what it holds.
tooltipVerticalPaddingDpDp.UnspecifiedBetween its top and bottom and what it holds, and between its heading and rows.
tooltipGapDpDp.UnspecifiedBetween the place pointed at and the tooltip beside it.
tooltipElevationDpDp.UnspecifiedThe tooltip's shadow.
barGapDpDp.UnspecifiedBetween two bars that stand side by side at a place. Bars too thin for it stand closer.
barMaxWidthDpDp.UnspecifiedThe widest a bar is, however much room its place has: a chart of three places is not three slabs.
barRadiusDpDp.UnspecifiedHow round the corners of a bar's end are, the end away from nought.
sliceGapDpDp.UnspecifiedBetween two slices of a pie that lie side by side, the same from the pie's middle to its rim.
selectedSliceOffsetDpDp.UnspecifiedHow 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.
gaugeWidthDpDp.UnspecifiedHow thick the arc of a gauge is. An arc is no thicker than half its radius.
meterHeightDpDp.UnspecifiedHow tall the bar of a meter group is.
trackerHeightDpDp.UnspecifiedHow tall the blocks of a status tracker are.
bubbleMinSizeDpDp.UnspecifiedHow 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.
bubbleMaxSizeDpDp.UnspecifiedHow far across its largest bubble is: the one whose size is the most of the chart's.
navigatorHeightDpDp.UnspecifiedHow 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.
barBandShareFloatFloat.NaNHow 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.
markLineWidthDpDp.UnspecifiedThe 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.
markBandAlphaFloatFloat.NaNHow 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.
patternsBoolean?nullWhether 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.
nodeWidthDpDp.UnspecifiedHow wide a node of a sankey is.
nodeGapDpDp.UnspecifiedBetween 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.

ParameterTypeDefaultWhat it is
seriesList<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.
gridColorColor.UnspecifiedThe lines drawn across the chart at the marks of an axis. The theme's divider.
axisColorColor.UnspecifiedThe line along an axis. The theme's border.
labelColorColor.UnspecifiedWhat is written beside the axes: the values, the places and the axes' titles, and the names in the legend. The theme's textSecondary.
crosshairColorColor.UnspecifiedThe 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.
tooltipContainerColorColor.UnspecifiedThe tooltip's fill. The theme's surface.
tooltipBorderColorColor.UnspecifiedThe tooltip's edge. The theme's border.
tooltipTextColorColor.UnspecifiedThe tooltip's heading and its values. The theme's textPrimary.
tooltipLabelColorColor.UnspecifiedThe names of the series in the tooltip. The theme's textSecondary.
risingColorColor.UnspecifiedWhat a value that goes up is drawn in: a step of a waterfall that adds. The theme's success.
fallingColorColor.UnspecifiedWhat a value that goes down is drawn in: a step of a waterfall that takes away. The theme's danger.