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

UTC date labels do not display properly, seem to be using local browser timezone #7795

Open
mjtribble opened this issue Nov 10, 2021 · 7 comments · Fixed by #7815 · May be fixed by #9265
Open

UTC date labels do not display properly, seem to be using local browser timezone #7795

mjtribble opened this issue Nov 10, 2021 · 7 comments · Fixed by #7815 · May be fixed by #9265
Labels

Comments

@mjtribble
Copy link

Date labels are shifted one day when viewed in mountain time. Updating browser timezone to UTC shows correct labels

Open in editor

{
  "data": {
    "format": {
      "type": "csv"
    },
    "values": "dt,value\n2021-10-09,450.0,\n2021-10-10,0.0,\n2021-10-11,410.0,\n"
  },
  "mark": {
    "tooltip": true,
    "type": "bar",
    "line": {
      "color": "darkgreen"
    },
    "point": false
  },
  "encoding": {
    "x": {
      "field": "dt",
      "timeUnit": "utcyearmonthdate",
      "title": "Day",
      "type": "ordinal",
      "axis": {
        "grid": false,
        "labelAngle": 0,
        "labelFont": "AgrilystApercu",
        "format": "%b %d",
        "ticks": true,
        "labelPadding": 6,
        "titlePadding": 15
      }
    },
    "y": {
      "field": "value",
      "type": "quantitative",
      "title": "count",
      "axis": {
        "grid": true,
        "domainColor": "white"
      }
    },
    "color": {
      "value": "#5391f5"
    },
    "opacity": {
      "value": 0.4
    }
  }
}

Screen Shot 2021-11-10 at 10 37 31 AM

@domoritz
Copy link
Member

Simplified example: Open the Chart in the Vega Editor

@domoritz
Copy link
Member

This issue looks a lot like #4044.

I wonder whether we changed something in #5780. @haldenl @kanitw do you see what's wrong here?

@domoritz
Copy link
Member

I think formatType on the y-axis should be utc but it's time.

@domoritz
Copy link
Member

#7815 fixes the issue.

image

@AndrewRybka
Copy link

The same issue affects the labels of nominal fields:

Open the Chart in the Vega Editor

Is it possible to add support for formatType: "utc" which is supported by Vega?

@domoritz
Copy link
Member

I don't see an issue with that. Can you send a pull request?

@AndrewRybka AndrewRybka linked a pull request Feb 17, 2024 that will close this issue
@AndrewRybka
Copy link

@domoritz Sure. Here it is: #9265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants