Is it possible to show Pie chart in such situation?


(Kacem Boukraa) #1

Hello everyone one,

So i have around 100 docs stored in Elasticsearch, each one have this following part:

page_storytellers_by_city: { USA: X, UK: Y, France: Z}

It indicates the number of visitor from many countries in a given day.

What i want to do is to SUM all numbers for each city in all docs then add them to an overall Pie Chart (that shows % for each city in all docs at once)?
If it's not possible. should i use the format of tables to achieve that ('i.e

page_storytellers_by_city: [ USA: X, UK: Y, France: Z] which i can do by restructuring the docs

)

Thanks in advance.


(Kacem Boukraa) #2

Any answer?


(Tanya Bragin) #3

As this is a nested structure, Kibana can't run aggregations over the values in the nested part of the doc (see here). I'd suggest denormalizing or using "include_in_parent" (1.x) or "copy_to" (2.x) Elasticsearch mapping to flatten the field, so that you can run aggregations on it.


(system) #4