Cannot see data from an index based url - why isn't this scatterchart working?

vega
(Michael Golubov) #1

No errors reported - I just cannot see the data.
A similar chart works for the same index in Vega-Lite (????)

{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"width": 499,
"height": 499,
"padding": 5,
"autosize": "pad",

"data": [
{
"name": "source",

  url: {
  # The %-enclosed keys are handled by Kibana to modify the query
  # before it gets sent to Elasticsearch. Context is the search
  # filter as shown above the dashboard. Timefield uses the value 
  # of the time picker from the upper right corner.
  %context%: true
  %timefield%: @timestamp
  index: pricescattertest-*
  body: {
    size: 10000
    _source: ["@timestamp", "price", "quantity", "cluster"]
  }
}
   "format": { "property": "hits.hits" }

}

],

"scales": [
{
"name": "x",
"type": "linear",
"round": true,
"nice": true,
"zero": true,
"domain": {"data": "source", "field": "price"},
"range": "width"
},
{
"name": "y",
"type": "linear",
"round": true,
"nice": true,
"zero": true,
"domain": {"data": "source", "field": "quantity"},
"range": "height"
},
{
"name": "size",
"type": "linear",
"round": true,
"nice": false,
"zero": true,
"domain": {"data": "source", "field": "cluster"},
"range": [4,361]
}
],

"axes": [
{
"scale": "x",
"grid": true,
"domain": false,
"orient": "bottom",
"tickCount": 20,
"title": "Price"
},
{
"scale": "y",
"grid": true,
"domain": false,
"orient": "left",
"titlePadding": 5,
"title": "Quantity"
}
],

"legends": [
{
"size": "size",
"title": "Clusters",
"format": "s",
"encode": {
"symbols": {
"update": {
"strokeWidth": {"value": 2},
"opacity": {"value": 0.5},
"stroke": {"value": "#4682b4"},
"shape": {"value": "circle"}
}
}
}
}
],

"marks": [
{
"name": "marks",
"type": "symbol",
"from": {"data": "source"},
"encode": {
"update": {
"x": {"scale": "x", "field": "price"},
"y": {"scale": "y", "field": "quantity"},
"size": {"scale": "size", "field": "cluster"},
"shape": {"value": "circle"},
"strokeWidth": {"value": 2},
"opacity": {"value": 0.5},
"stroke": {"value": "#4682b4"},
"fill": {"value": "transparent"}
}
}
}
]
}

(system) closed #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.