Perspecrive XY CHART Question

Setting it to 0.5 isn't going to produce 5 gridlines, even if there weren't smarts to work out how many will actually fit on the graph; you would get 100s of 1000s of gridlines (600k)

If you want 5 gridlines dynamically, then you will need to:

  1. set the min/max y range statically (props.yAxes[x].value.range.min/max and set useStrict to true)
  2. set props.yAxes[x].appearance.grid.minDistance = expression binding:
({this.props.yAxes[x].value.range.max}-{this.props.yAxes[x].value.range.min})/5

where x = the array item index of your yAxis.
right click on this prop and turn on the "persistent" option so that the value is saved with the view (not technically required, but it's better if you do)

However, it looks like there is some logic to make these numbers logical, so depending what this evaluates to, you might see 5 or less gridlines.

1 Like