Display a ratio of data

Hi guys,

I have some difficulties with Kibana.
My data contains IDs and links:

    {
        "_index": "debug_sample_data",
        "_type": "_doc",
        "_id": "rPeEz3cBYzpkMbM6YKCc",
        "_version": 1,
        "_score": null,
        "_source": {
            "datum": "2021-02-23",
            "id": "Egomotion_D_633",
            "links": [
                {
                    "id": "Egomotion_D_Link_0"
                },
                {
                    "id": "Egomotion_D_Link_1"
                }
            ]
       },
       "fields": {
           "datum": [
               "2021-02-23T00:00:00.000Z"
            ]
        },
       "highlight": {
            "id": [
               "@kibana-highlighted-field@Egomotion_D_633@/kibana-highlighted-field@"
            ]
        },
        "sort": [
            1614038400000
        ]
    }

Now I want a Pie chart or something similar, where 100% is my count of IDs. and X% is my number of IDs that have links.
Is there a way I can achieve that with Kibana?

The queries I'm using for

  • number of ids:
    id: Egomotion

  • number of ids with links:
    id: Egomotion and links.id: *

Thanks in advance. I couldn't find any solution so far.

You should be able to do this using the "filters" function.

For the "Size by" dimension, use the "Unique count of id" function, for the "slice by" dimension, use a filters function with these filters:
NOT links.id: *
links.id: *

1 Like

Great! Thanks flash1293!

Seems to work!
Is it possible to display the number as percentage in the middel of the donut?

There's no way to show a number in the donut hole, but the number should be shown in the slices as percentage like this, right?

Unfortunanetly, it doesn't. Although I have "Show values" siwtched on in the Options tab.
Only when I hover over it with the cursor.

Can you make a screenshot of your visualization? Which browser and which version of Kibana do you use?

Sure.
I'm using Chrome.
Version is 7.8.0 I think.

You can enable "Show labels" then it will look like this:

The screenshot I did is from Kibana >7.10 - by using the Lens visualization you can get a much better looking pie chart.

To be honest, I can't really figure out how to produce this donut chart with the lens visualization. Any suggestions would be appreciated!

As I mentioned, you need Kibana >=7.10 for that. In 7.8 the Filters aggregation is not supported.

1 Like

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