This is my vega code:
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
url: {
%context%: true
%timefield%: "incident_date_time"
index: incident*
body: {
size: 10000
_source: ["incident_date_time"]
}
}
# We only need the content of hits.hits array
format: {property: "hits.hits"}
}
mark: bar
encoding: {
x: {field: "time", type: "temporal"}
}
}
I have index called incident* in the index pattern and I am trying to display number of incidents per day (count)
But I am getting empty chart.
I tired to build it using kibana vis. and it works.
This is the data form from dev tools when I run
GET incident*/_search
{
"size": 3,
"_source": ["incident_date_time"]
}
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 333,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "incident_data",
"_type" : "_doc",
"_id" : "2",
"_score" : 1.0,
"_source" : {
"incident_date_time" : "2020-03-19T18:45:31.000Z"
}
},
{
"_index" : "incident_data",
"_type" : "_doc",
"_id" : "3",
"_score" : 1.0,
"_source" : {
"incident_date_time" : "2020-03-19T18:45:51.000Z"
}
},
{
"_index" : "incident_data",
"_type" : "_doc",
"_id" : "4",
"_score" : 1.0,
"_source" : {
"incident_date_time" : "2020-03-19T18:46:23.000Z"
}
}
]
}
}
Any idea what's wrong

