Vega Visualization with nested Hashes

Hello ES Team. :slight_smile:

I would like to visualize my data from ES with Vega-lite.

My fields are:
data_field which is an array of nested hashes.
data_number which is just a number representing each of the data_field

My Example:

number : 4

data_field:

{
  "data": [
    {
      "val": 824.924,
      "string": "important"
    },
    {
      "val": 12.23,
      "string": "not_important"
    }
  ],
  "element": "first",
},
{
  "data": [
    {
      "val": 123.456,
      "string": "important"
    },
    {
      "val": 12.23,
      "string": "not_important"
    }
  ],
  "element": "second",
}

My Goal:
I would like to create a Visualization with Vega Lite.

Is it possible to get the field number on the x Axis..
and from my_data the first value of val on the y Axis**?

         ^
         |
         |
val      |                     .
         |          .     .         .
         |      .                        .
         |_______________________________________> 
                1    2    3    4    5    6
                         number

My Problem:
I am not sure which aggregation I should use, to get only the first num value of my Data.
I would need something like the max aggregation, which returns me one of those values.. but I need not the bigger one, but the first.

Can some help me with that? :slight_smile:

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