Vega Boxplot


(Carlosvega) #1

Hi,

I'm trying to make this example work with elasticsearch data but I can't manage to do it.
https://vega.github.io/editor/#/examples/vega/box-plot

My documents are of the form:

"properties" : {
	"timestamp" : "date",
	"geo" : "geopoint",
	"ip"  : "ip",
	"name" : "keyword",
	"description" : "text",
	"age" : "integer",
	"size" : "float"
},

and I would like to have a boxplot of age and size variables. Any help? Is there any documentation about how to adapt the vega syntax to kibana/elasticsearch.


(Yuri Astrakhan) #2

@carlosvega hi, I assume you want to draw two bars - one for the age variable, and one for the size? To do this, you need to calculate 5 values for each of the variables: "min", "q1", "median", "q3", "max". All of them can be computed by ElasticSearch, e.g. by using percentile aggregation, min aggregation, etc. Basically construct a query that will give you all 10 values back, and you can draw them directly with Vega. I would recommend starting with the dev console to construct the query. There are some blog posts I have written, e.g. this one that explain how to approach such problems (you need Vega, not Vega Lite, because you need full control of your drawing surface)


(system) #3

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