The tooltip does not appear as I expect. The date "2018-01-01" appears as "2017-12-31". Please note that my computer is in the "America/Chicago"
time zone, so at "2018-01-01" UTC, it was "2017-12-31" in my timezone.
I am using a toy dataset with dates 2018-01-01 to 2018-01-07, inclusive.
The x scale is UTC, and I expect the tooltip to parse date
as UTC because the date string is in ISO format.
If I specify the date in the tooltip as a nominal variable, it works as I expect.
"tooltip": [
{
"field": "date",
"type": "nominal"
},
{
"field": "value",
"type": "quantitative"
}
]
A solution to the problem is to put a UTC scale with the tooltip: https://bl.ocks.org/ijlyttle/bccff7673c98e61b887684dbe597cbd3
xxxxxxxxxx
<html>
<head>
<!-- uploaded using vegawidget -->
<script src="https://cdn.jsdelivr.net/npm/vega@4"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3"></script>
<link rel="stylesheet" type="text/css" href="vega-embed.css">
</head>
<body>
<div id="vis"></div>
<script type="text/javascript">
const spec = "spec.json";
const opt = {"defaultStyle":true,"renderer":"canvas"};
vegaEmbed('#vis', spec, opt).then(function(result) {
// access view as result.view
}).catch(console.error);
</script>
</body>
</html>
https://cdn.jsdelivr.net/npm/vega@4
https://cdn.jsdelivr.net/npm/vega-lite@2
https://cdn.jsdelivr.net/npm/vega-embed@3