StyleCode Property: axisMax

axisMax

Specifies the highest value on an axis.

Applies to Type Default
chart > block
chart > haxis
chart > vaxis > left
chart > vaxis > right
histogram > haxis
histogram > vaxis
linechart > haxis
linechart > vaxis > left
linechart > vaxis > right
plot > haxis
plot > vaxis
scatter > haxis
scatter > vaxis
Number, Date, auto, max auto
// Example: histogram > haxis
table T = extend.range(1000)
T.X = random.poisson(5 into T)

show histogram "My histogram" a1f4 { haxis { axisMax: 100 } } with T.X   

// Example: histogram > vaxis
table T = extend.range(1000)
T.X = random.poisson(5 into T)

show histogram "My histogram" a1f4 { vaxis { axisMax: 100 } } with T.X   

// Example: linechart > haxis
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 { haxis { axisMax: 100 } } with
  Day.StockOnHand
  Day.StockOnOrder

// 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 { axisMax: 100 } } } 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 { axisMax: 100 } } } with
  Day.StockOnHand
  Day.StockOnOrder

// 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 { axisMax: 100 }
  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 { axisMax: 100 } } with
  Sales.Quantity
  Sales.Discount

// 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 { axisMax: 100 }
  Sales.Discount

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

show scatter "My Scatter Plot" { vaxis { axisMax: 100 } } a1d4 with
  Sales.Quantity
  Sales.Discount

Details

A value of max indicates that the lowest value max(values) should be used. The considered values include areaTo or the consequence of stacking bars with a stack seriesType. For the horizontal axis of a linechart, this will be the latest date for which a value is provided (even if that value is zero).

A value of auto is usually the same as min(values), except:

An explicit value just uses that maximum. However, if an explicit numerical value is provided that is below max(values) (which would cause some values to be outside the range), it is replaced with max(values) so that all values remain in the range (this is not the case for date values).

User Contributed Notes
0 notes + add a note