Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected offset of boxplots when filtering aggregated temporal data #4524

Closed
jwoLondon opened this issue Feb 8, 2019 · 1 comment · Fixed by #6755
Closed

Unexpected offset of boxplots when filtering aggregated temporal data #4524

jwoLondon opened this issue Feb 8, 2019 · 1 comment · Fixed by #6755

Comments

@jwoLondon
Copy link
Contributor

Using the Boxplot mark when aggregating and filtering temporal data produces an unexpected chart offset that varies depending on how far after 1970 values are filtered out. In the example below try changing 1985 to a later or earlier year.

The fact this only occurs beyond 1970 suggests there may be a time parsing issue somewhere. If the mark is changed to a primitive such as circle, there is no offset.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "width": 600,
  "data": {
    "url": "https://gicentre.github.io/data/temperatureAnomalies.json",
    "format": {"parse": {"Anomaly": "number"}}
  },
  "transform": [{"filter": "year(datum.Date) >= 1985"}],
  "encoding": {
    "x": {
      "field": "Date",
      "type": "temporal",
      "timeUnit": "year"
    },
    "y": {"field": "Anomaly", "type": "quantitative"}
  },
  "mark": "boxplot"
}
@kanitw
Copy link
Member

kanitw commented Feb 24, 2019

Related issue: Try changing temporal to ordinal breaks the chart entirely:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "width": 600,
  "data": {
    "url": "https://gicentre.github.io/data/temperatureAnomalies.json",
    "format": {"parse": {"Anomaly": "number"}}
  },
  "transform": [{"filter": "year(datum.Date) >= 1985"}],
  "encoding": {
    "x": {
      "field": "Date",
      "type": "ordinal",
      "timeUnit": "year"
    },
    "y": {"field": "Anomaly", "type": "quantitative"}
  },
  "mark": "boxplot"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment