Does somebody know why my data points are twisted at some positions? (fig.1)
I use the same data-set in Vega-Lite and it works there. But in Vega I'm missing someting.
Maybe someone can help me out in this regard because Im out of options in where to look for the error.
Datasample:
{
"score" : 18,
"time_out" : false
"hits" : {
"total" : {
"value" : 0123,
"relation" : "eq"
},
"max_score" : 1.8,
"hits" : [
{
"_index" : "dataIndex",
"_type" : "log",
"_source" :{
"@timestamp" : "2017-01-13345:00:16.0301135Z"
"numericValue" : 2.0
}
},
{
"_index" : "dataIndex",
"_type" : "log",
"_source" :{
"@timestamp" : "2017-02-20345:10:16.0301135Z"
"numericValue" : 3.0
}
}
]
}
}
Fig.1
Example in Vega - everything works as expected, except some points are skewed
{
$schema: https://vega.github.io/schema/vega/v5.json
data: [
{
name: table
url: {
%context%: true
%timefield%: @timestamp
index: dataIndex-*
body: {
size: 1000
aggs: {
hits: {
date_histogram: {
field: @timestamp
fixed_interval: 10m
extended_bounds: {
min: { %timefilter%: min}
max: { %timefilter%: max}
}
}
}
}
}
}
format: {
property: hits.hits
}
transform: [
{
type: formula
as: varTime
expr: toDate(datum._source['@timestamp'])
}
{
type: filter
expr: datum._source['@timestamp'] != null && datum._source['numericValue'] > 0
}
]
}
]
scales: [
{
name: xscale
type: time
range: width
domain: {
data: table
field: varTime
}
}
{
name: yscale
type: linear
range: height
domain: {
data: table
field: _source.numericValue
}
}
]
axes: [
{
orient: bottom
scale: xscale
format: %H:%M
}
{
orient: left
scale: yscale
}
]
marks: [
{
type: area
from: {
data: table
}
encode: {
enter: {
x: {
scale: xscale
field: varTime
}
y: {
scale: yscale
field: _source.numericValue
}
y2: {
scale: yscale
value: 0
}
fill: {
value: steelblue
}
}
update: {
fillOpacity: {
value: 1
}
}
hover: {
fillOpacity: {
value: 0.5
}
}
}
}
]
}