Skip to content

Ordinal dates on x-axis off by one when using errorband marks #9657

@Prestaul

Description

@Prestaul

Bug Description

When displaying utc dates on the x-axis using type: ordinal, dates are rendered correctly unless we add an errorband mark. With an errorband mark the dates on the x-axis are one day early.

This is a minimal reproduction where the x-axis label should be for Jan 1st but it appears as Dec 31st unless you set the x encoding type to temporal or remove the errorband layer:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [{"date": "2025-01-01", "value": 1 }]
  },
  "encoding": {
    "x": {
      "field": "date",
      "type": "ordinal",
      "timeUnit": "utcyearmonthdate"
    },
    "y": {"field": "value", "type": "quantitative"}
  },
  "layer": [
    { "mark": "line" },
    { "mark": "errorband" }
  ]
}

Checklist

  • I checked for duplicate issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions