StyleCode Property: zeros v1

zeros

Replaces exact zero values before the number pipeline applies units, signs, precision, or scaling.
Use an empty string to hide zeros. auto preserves the regular number pipeline.

Applies to Type Default
barchart > series > value
chart > haxis
chart > vaxis > left
chart > vaxis > right
chart > plotxy > series > value
chart > plot > series > line > value
chart > haxis
chart > scatter > series > value
file > column > value
gauge > entry > value
histogram > series > value
linechart > vaxis > left
linechart > vaxis > right
linechart > series > line > 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, auto auto

Examples

// 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 { sc } }
  group by Items.Category

// Example: chart > haxis
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 with
  haxis by T.X { zeros: "" }
  plot by T.X
    same(T.Y)

// Example: chart > vaxis > left
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 { vaxis { left { zeros: "" } } } with
  haxis by T.X
  plot by T.X
    same(T.Y)

// Example: chart > vaxis > right
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 { vaxis { right { zeros: "" } } } with
  haxis by T.X
  plot by T.X
    same(T.Y)

// Example: chart > plotxy > series > value
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 with
  plotxy T.X
    T.Y { value { zeros: "" } }
    order by T.Y

// Example: chart > plot > series > line > value
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 with
  haxis by T.X
  plot by T.X
    same(T.Y) { value { zeros: "" } }

// Example: chart > haxis
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 with
  haxis by T.X { zeros: "" }
  plot by T.X
    same(T.Y)

// Example: chart > scatter > series > value
table T = extend.range(5)
T.X = T.N
T.Y = T.N * 2

show chart "My Chart" a1f4 with
  scatter T.X
    T.Y { value { zeros: "" } }

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

// 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 { zeros: "" } }

// 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 |]

show linechart "My Line Chart" a1b6 { vaxis { left { zeros: "" } } } 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 |]

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

// Example: linechart > series > line > value
table T[Date] = with
  [| as Date, as Value |]
  [| date(2023,01,15), 15 |]
  [| date(2023,01,16), 5 |]
  [| date(2023,01,17), 12 |]

show linechart "My Line Chart" a1b6 with
  same(T.Value) { value { zeros: "" } }
  group by T.Date

// 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 { zeros: "" } }
  group by Sales.Category

// Example: plot > series > value
// Example: plot > series
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]

show plot "My Plot" a1d4 with
  Sales.Quantity
  Sales.Discount { value { zeros: "" } }

// Example: plot > haxis
// Example: plot > series
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]

show plot "My Plot" a1d4 with
  Sales.Quantity { zeros: "" }
  Sales.Discount

// Example: plot > vaxis
// Example: plot > series
table Sales = with
  [| as Quantity, as Discount |]
  [| 10, 40 |]
  [| 2, 10 |]
  [| 1, 0 |]

show plot "My Plot" a1d4 { vaxis { zeros: "" } } with
  Sales.Quantity
  Sales.Discount

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

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

// 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 { zeros: "" }

// 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 { zeros: "" }
  Sales.Discount

// Example: slicepicker > entry
table Items = with
  [| as Id |]
  [| "A" |]
  [| "B" |]
  [| "C" |]
  
table Slices[slice] = slice by [Items.Id] title: "Slice \{Items.Id}"

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

// 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 { zeros: "" } }
  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 { zeros: "" } }
  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 { zeros: "" } }
  T.Label
  group by T.Label

User Contributed Notes
0 notes + add a note