Search code examples
vega-lite

Scale domain bounds not being set


I have a corner case visualization here where the domain is not being set to the bounds---it does work if I set the values to something else, like [0, 2000], or [0,4000], but curiously not to the values I want.

Open the Chart in the Vega Editor


Solution

  • By default Vega-Lite chooses "nice" domain boundaries, so that axes end on round numbers. If you want specific domain values without this additional adjustment, you can disable this behavior in the scale specification:

    "scale": {"domain": [0, 2090], "nice": false}