...

StyleCode Property: unit

unit

Controls the unit of numbers in the number pipeline.

Applies to Type Default
barchart > vaxis > left
barchart > vaxis > right
barchart > series
barchart > series > value
chart > haxis
chart > vaxis > left
chart > vaxis > right
chart > block > plotxy > series
chart > block > plotxy > series > value
chart > block > plot > series
chart > block > plot > series > value
chart > block > haxis
chart > block > scatter > series
chart > block > scatter > series > value
gauge > entry > value
histogram > series > value
linechart > vaxis > left
linechart > vaxis > right
linechart > series
linechart > series > value
piechart > series > value
plot > series > value
plot > haxis
plot > vaxis
scalar > entry > value
scatter > series
scatter > haxis
slicepicker > entry
summary > entry > value
table > column > value
treemap > series > value
Text ""

Examples

// Example: barchart > vaxis > left
table Items = with
  [| as SKU, as Category, as Quantity |]
  [| "AAA", "CAT_1", 10 |]
  [| "BBB", "CAT_2", 20 |]
  [| "CCC", "CAT_1", 30 |]

{ vaxis { left { unit: "$" } } }
show barchart "My BarChart" a1b6 with
  sum(Items.Quantity)
  group by Items.Category

// Example: barchart > vaxis > right
table Items = with
  [| as SKU, as Category, as Quantity |]
  [| "AAA", "CAT_1", 10 |]
  [| "BBB", "CAT_2", 20 |]
  [| "CCC", "CAT_1", 30 |]

{ vaxis { right { unit: "$" } } }
show barchart "My BarChart" a1b6 with
  sum(Items.Quantity)
  group by Items.Category

// Example: barchart > series
table Items = with
  [| as SKU, as Category, as Quantity |]
  [| "AAA", "CAT_1", 10 |]
  [| "BBB", "CAT_2", 20 |]
  [| "CCC", "CAT_1", 30 |]

show barchart "My BarChart" a1b6 with
  sum(Items.Quantity) { unit: "$" }
  group by Items.Category

// Example: barchart > series > value
table Items = with
  [| as SKU, as Category, as Quantity |]
  [| "AAA", "CAT_1", 10 |]
  [| "BBB", "CAT_2", 20 |]
  [| "CCC", "CAT_1", 30 |]

show barchart "My BarChart" a1b6 with
  sum(Items.Quantity) { value { unit: "$" } }
  group by Items.Category

// Example: gauge > entry > value
show gauge "My gauge" a1b2 with 0.5

// Example: histogram > series > value
table T = extend.range(1000)
T.X = random.poisson(5 into T)
         
show histogram "My histogram" a1f4 with T.X { value { unit: "$" } }

// Example: linechart > vaxis > left
table Day[Date] = with
  [| as Date, as StockOnHand, as StockOnOrder |]
  [| date(2023,01,15), 15,10 |]
  [| date(2023,01,16), 5, 2 |]
  [| date(2023,01,17), 12, 4 |]
  [| date(2023,01,18), 13, 7 |]

{ vaxis { left { unit: "$" } } }
show linechart "My Line Chart" a1b6 with
  Day.StockOnHand
  Day.StockOnOrder

// Example: linechart > vaxis > right
table Day[Date] = with
  [| as Date, as StockOnHand, as StockOnOrder |]
  [| date(2023,01,15), 15,10 |]
  [| date(2023,01,16), 5, 2 |]
  [| date(2023,01,17), 12, 4 |]
  [| date(2023,01,18), 13, 7 |]

{ vaxis { right { unit: "$" } } }
show linechart "My Line Chart" a1b6 with
  Day.StockOnHand
  Day.StockOnOrder

// Example: linechart > series
table Day[Date] = with
  [| as Date, as StockOnHand, as StockOnOrder |]
  [| date(2023,01,15), 15,10 |]
  [| date(2023,01,16), 5, 2 |]
  [| date(2023,01,17), 12, 4 |]
  [| date(2023,01,18), 13, 7 |]

show linechart "My Line Chart" a1b6 with
  Day.StockOnHand { unit: "$" }
  Day.StockOnOrder

// Example: linechart > series > value
table Day[Date] = with
  [| as Date, as StockOnHand, as StockOnOrder |]
  [| date(2023,01,15), 15,10 |]
  [| date(2023,01,16), 5, 2 |]
  [| date(2023,01,17), 12, 4 |]
  [| date(2023,01,18), 13, 7 |]

show linechart "My Line Chart" a1b6 with
  Day.StockOnHand { value { unit: "$" } }
  Day.StockOnOrder

// Example: piechart > series > value
table Sales = with
  [| as Quantity, as Category |]
  [| 10, "A" |]
  [| 1, "B" |]
  [| 5, "B" |]
  [| 4, "A" |]
  [| 12, "C" |]

show piechart "My Pie Chart" a1b6 with
  sum(Sales.Quantity) { value { unit: "$" } }
  group by Sales.Category

// Example: plot > series > value
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]
      
show plot "My Plot" a1d4 with
  Sales.Quantity
  Sales.Discount { value { unit: "$" } }

// Example: plot > haxis
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]
      
show plot "My Plot" a1d4 with
  Sales.Quantity { unit: "$" }
  Sales.Discount

// Example: plot > vaxis
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]
      
{ vaxis { unit: "$" } }
show plot "My Plot" a1d4 with
  Sales.Quantity
  Sales.Discount

// Example: scalar > entry > value
myValue = 123

show scalar "My Scalar" a1b1 with
  myValue { value { unit: "$" } }

// Example: scatter > series
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]
    
show scatter "My Scatter Plot" a1d4 with
  Sales.Quantity
  Sales.Discount { unit: "$" }

// Example: scatter > haxis
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]
    
show scatter "My Scatter Plot" a1d4 with
  Sales.Quantity { unit: "$" }
  Sales.Discount

// Example: slicepicker > entry
table Items = with
  [| as Id |]
  [| "A" |]
  [| "B" |]
  [| "C" |]

Items.Slice = sliceDashboard(Items.Id) by Items.Id

show slicepicker "Pick a slice" a1b3 with
  same(Items.Id) { unit: "$" }

// Example: summary > entry > value
table Sales = with
  [| as Quantity, as NetAmount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 20 |]
    
show summary "My Summary" a1b3 with
  sum(Sales.Quantity) { value { unit: "$" } }
  sum(Sales.NetAmount)

// Example: table > column > value
table Orders = with
  [| as Date, as Quantity |]
  [| date(2023,02,21), 150 |]
  [| date(2023,02,22), 250 |]

show table "My Table" a1c4 with
  Orders.Date { value { unit: "$" } }
  Orders.Quantity

// Example: treemap > series > value
table T = with
  [| as Quantity, as Label |]
  [| 10, "A" |]
  [| 1, "B" |]
  [| 5, "B" |]
  [| 4, "A" |]
  [| 12, "C" |]

show treemap "My Treemap" a1b6 with
  sum(T.Quantity) { value { unit: "$" } }
  T.Label
  group by T.Label

User Contributed Notes
0 notes + add a note