Vega: Why does axis's tickCount affect tick label format?

Created on 21 May 2018  路  3Comments  路  Source: vega/vega

image

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "data": {"url": "data/seattle-weather.csv"},
  "mark": "tick",
  "encoding": {
    "x": {"field": "precipitation", "type": "quantitative", "axis": {"tickCount": 100}}
  }
}

image

The ticks now have .0 for all numbers

Is this just artifact of JS floating point calculation?

question

Most helpful comment

I disagree that this is a bug. The precision correctly aligns with the number of ticks and currently will stay consistent when changing the pixel length of the axis.

All 3 comments

I think it's because the ticks actually have values that need the precision. However, their labels are not visible because the labels overlap and so many are removed.

I still think this is a bug, though.

I disagree that this is a bug. The precision correctly aligns with the number of ticks and currently will stay consistent when changing the pixel length of the axis.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jheer picture jheer  路  5Comments

sonlichao picture sonlichao  路  4Comments

mattijn picture mattijn  路  3Comments

donghaoren picture donghaoren  路  5Comments

rubjo picture rubjo  路  4Comments