KIbana - pie chart splitting by value of fields

This sounds quite stupid.

I usually got data from json like
{ "name":"john","category":"A"}
{ "name":"paul","category":"B"}
{ "name":"henry","category":"A"}
{"name:"jane","category":"C"}
I easily manage to get the percentage of category A and percentage of category B in a pie chart with an index made of two fields : name and category.

My problem is that I now have a json that comes with the percentage being already processed. something like :
{"categoryA":50}
{"categoryB":25}
{"categoryC":25}
My index is therefore made of 3 fields : categoryA, category B, categoryC
How do I make a pie chart that will take into account the categories value?

I should be so simple and I don't see how.

Thanks for your help

You can use top hits metric to use a value from the document as the pie slice percentage

In the screen shot below, the pie slice percentage is from the hour_of_day field for the first matching document for each split.

.

That means i would have to change a bit the structure of the json I receive, so that I get something like this :
{"category":"A","percentage":50}
{"category":"B","percentage":25}
{"category":"C","percentage":25}

Thanks.

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