{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
url: {
name: table
%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
from: {"data": "table"},
encoding: {
x: {field: "time", type: "temporal"}
}
}
You can see your data in your browsers dev tools console. On the console you can run VEGA_DEBUG.view.data('data') and it will show you what's in the data set. This is an easy way to troubleshoot if the data or marks is your issue.
Your vega-lite spec looks totally fine to me, except that you are encoding a field that doesn't exist: x: {field: "time", type: "temporal"} doesn't make sense, because the documents you have don't have a field called time. Since your documents contain an ISO 8601 timestamp, you may want to apply a transform section above the encodings:
Thank you. The issue was in mixing vega and vega-lite and not adding a name for the data. Also, transform-calculate in vega-lite is transform-formula in vega.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.