StyleCode Property: unitPosition
unitPosition
Controls the position of the unit in the number pipeline.
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 { unitPosition: right } } }
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 { unitPosition: right } } }
show barchart "My BarChart" a1b6 with
sum(Items.Quantity)
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 { unitPosition: right } }
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 { unitPosition: right } }
// 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 { unitPosition: right } } }
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 { unitPosition: right } } }
show linechart "My Line Chart" a1b6 with
Day.StockOnHand
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 { unitPosition: right } }
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 { unitPosition: right } }
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 { unitPosition: right } }
// Example: plot > haxis
table Sales = with
[| as Quantity, as Discount |]
[| 10, 40 |]
[| 2, 10 |]
[| 1, 0 |]
show plot "My Plot" a1d4 with
Sales.Quantity { unitPosition: right }
Sales.Discount
// Example: plot > vaxis
table Sales = with
[| as Quantity, as Discount |]
[| 10, 40 |]
[| 2, 10 |]
[| 1, 0 |]
{ vaxis { unitPosition: right } }
show plot "My Plot" a1d4 with
Sales.Quantity
Sales.Discount
// Example: scalar > entry > value
myValue = 123
show scalar "My Scalar" a1b1 with
myValue { value { unitPosition: right } }
// 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 { unitPosition: right }
// 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 { unitPosition: right }
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) { unitPosition: right }
// 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 { unitPosition: right } }
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 { unitPosition: right } }
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 { unitPosition: right } }
T.Label
group by T.Label
Details
The auto
value is resolved based on the value of unit
.
It is right
, except for the following units: €, $, £.
These units use left. Surrounding spaces are ignored when
recognizing them.