Hello all,
I'm trying to create a gantt chart using vega but I'm facing issue to get what I want...
Here is my code :
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
title: Gantt test
data: {
url: {
%context%: true
%timefield%: startime
index: test*
body: {
size: 30
_source: [
"startime",
"endtime",
"job_name"
]
}
}
format: {property: "hits.hits"}
}
"mark": "bar",
transform: [
{ calculate: "toDate(datum._source['startime'])", as: "startime"}
{calculate : "toDate(datum._source['endtime'])", as: "endtime"}
]
"encoding": {
"y": {
"sort": {"op": "mean", "field": "startime"},
"field": "_source.job_name",
"type": "nominal",
"axis": {"title": "job name"}
},
"x": {
"timeUnit": "hoursminutes",
"field": "startime",
"type": "temporal",
"axis": {"title": "horaire"}
}
"x2": {
"timeUnit": "hoursminutes",
"field": "endtime",
"type": "temporal"}
}
}
and here is what I obtain :
It's not so bad but my main issue is that my job starting previous day and ending current day are displayed in the wrong way (see screenshot). I'd like the chart displaying from 19:00 to 05:00 the next day but can't figure out how to do this...
for exemple the job pxmur_q_eod_acc is starting around 22:00 and ending around 00:30 but the visualization is reversing the data...
Any idea would be very welcome,
Thanks in advance,