I am trying to use Vega to plot a scatter drawing, but always get a warning "Infinite extent for field "times": [Infinity, -Infinity]" when I set the data size as 0 or a number larger than 10000.Any help would be appreciated. Below is my code:
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
data: {
// Get 10000 documents from ES
url: {
%context%: true
%timefield%: BAR_DATE
index: perf*
body: {
size: 0
_source: [
BAC_DATE
BAR_DATE
ID
LOT#
L_OHV_ASS_TIME
L_OHV_LOAD_TIME
SRC_MDI
SRC_BAY
DES_MDI
DES_BAY
]
}
}
format: {
property: hits.hits
} // {"parse": {[datum._source[BAC_DATE]: "utc:'%d %b //%Y %H:%M:%S'"]}
//}]
}
// Parse timestamp and copy extension into new variables
transform: [
{
calculate: toDate(datum._source['BAR_DATE'])
as: time
}
{
fold: [
_source[L_OHV_ASS_TIME]
]
}
{
timeUnit: utcdayhoursminutesseconds
field: time
as: times
}
]
// Draw results as colored circles
mark: point
encoding: {
x: {
field: times
maxbins: 50
type: temporal
axis: {
title: null
labelAngle: 30
}
}
y: {
field: value
type: quantitative
axis: {
title: null
}
}
color: {
field: _source[SRC_MDI]
type: nominal
}
tooltip: [
{
field: value
type: quantitative
}
{
field: _source[BAC_DATE]
type: nominal
}
{
field: _source[LOT#]
type: nominal
}
{
field: _source[SRC_MDI]
type: nominal
}
]
}
}Preformatted text