I have been working through simple scatter plots, boxplots in Kibana with Vega. Now I'm getting to what I actually need to render.
Each document from elastic has an array of points. From a query, I will likely have up to 10 documents. Ideally what I'm after is an x,y scatter plot for each document and then layer those on top of each other.
Some of the features / docs I have been looking into:
- Layering
- Repeating - although this looks like it's one chart per PROPERTY on a document
- Flatten transform - but this seems to work on single element arrays and makes objects out of them. I already have objects with X, Y in each.
I'm struggling to come up with an approach, or to know if Kibana + Vega can do this.
One layer per document.
Each layer is a scatter plot (data series based on x,y object array in the document)
This is a crude rendering from Excel that hopes to get the point across (3 series are from each of the 3 documents in the sample data below)
Here is an example of my data
{
"values" : [
{
"_id" : "3gvR138B1LivDftAs_NA",
"_score" : 1.0,
"_source" : {
"date" : "2022-01-31T18:26:27",
"points" : [
{
"x" : 0,
"y" : 100
},
{
"x" : 1,
"y" : 120
},
{
"x" : 2,
"y" : 105
},
{
"x" : 3,
"y" : 108
},
{
"x" : 4,
"y" : 117
}
]
}
},
{
"_id" : "3wvR138B1LivDftAs_NA",
"_score" : 1.0,
"_source" : {
"date" : "2022-01-31T18:26:27",
"points" : [
{
"x" : 0,
"y" : 98
},
{
"x" : 1,
"y" : 105
},
{
"x" : 2,
"y" : 110
},
{
"x" : 3,
"y" : 115
},
{
"x" : 4,
"y" : 113
}
]
}
},
{
"_id" : "4AvR138B1LivDftAs_NA",
"_score" : 1.0,
"_source" : {
"date" : "2022-01-31T18:26:27",
"points" : [
{
"x" : 0,
"y" : 115
},
{
"x" : 1,
"y" : 120
},
{
"x" : 2,
"y" : 113
},
{
"x" : 3,
"y" : 122
},
{
"x" : 4,
"y" : 130
}
]
}
}
]
}
I do have an ability to transform the JSON into some other format if it will be easier to plot in Vega(-lite) as desired.
Clear as mud? Thank you in advance for any brainstorming thoughts.