barchart

barchart, tile type

The barchart tile displays one or more numeric series grouped by category. Each value expression passed after the with keyword should use an aggregator. An explicit group by statement is expected.

table T = extend.range(10)
T.X = random.poisson(5 into T)
T.G = "G\{T.N}"

show barchart "My Groups" {unit: "$"} with
  sum(T.X)
  group by T.G

The tile can also display multiple series:

table T = with
  [| as Category, as Units, as Returns |]
  [| "A", 10, 1 |]
  [| "A", 15, 2 |]
  [| "B", 8, 0 |]
  [| "B", 12, 1 |]

show barchart "Units and returns" { 1..2, 1..4 } with
  sum(T.Units) as "Units" { color: "orange" }
  sum(T.Returns) as "Returns" { color: "red" }
  group by T.Category

Remarks

Each value expression becomes one series in the barchart.

With block placement such as { 1..2, 1..4 }, the group by expression must have type text. Use text(...) when grouping by a non-text category.

Legacy dashboards with placement such as a1d4 accept exactly one value expression. Use block placement such as { 1..2, 1..4 } to display multiple series. See show for the placement rules.

StyleCode

For generic StyleCode rules, see stylecode.

User Contributed Notes
0 notes + add a note