# Variety of data in Y axis

**URL:** <https://discuss.elastic.co/t/variety-of-data-in-y-axis/363701>\
**Category:** Kibana\
**Tags:** visualisation\
**Created:** [July 24, 2024, 11:33am UTC](https://discuss.elastic.co/t/variety-of-data-in-y-axis/363701 "2024-07-24T11:33:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juandres117](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@juandres117](https://discuss.elastic.co/u/juandres117)\
**Post date:** [July 24, 2024, 11:33am UTC](https://discuss.elastic.co/t/variety-of-data-in-y-axis/363701/1 "2024-07-24T11:33:02Z")

</div>

Hi! I have downloaded the data from: [Democracy index - Our World in Data](https://ourworldindata.org/grapher/democracy-index-eiu?tab=chart&country=~ESP#reuse-this-work)

Which has the democracy index for countries and different years. I would like to represent something similar like this photo

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2e028f2b7bf69e1b60044dacb666364d0a4a773a.png)

However I cannot because Kibana just breakdown the results to the average or another metric.

Can someone please help me?

Thank you a lot!!

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [July 25, 2024, 8:13am UTC](https://discuss.elastic.co/t/variety-of-data-in-y-axis/363701/2 "2024-07-25T08:13:43Z")

</div>

Hi @juandres117

what's the mapping of your data?  
Also, can you post an example of a record?

---

<div class="post-metadata">

**Author:** ![juandres117](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@juandres117](https://discuss.elastic.co/u/juandres117)\
**Post date:** [July 29, 2024, 6:30am UTC](https://discuss.elastic.co/t/variety-of-data-in-y-axis/363701/3 "2024-07-29T06:30:25Z")

</div>

Hi! Sorry to answer now. I send to you an image of the mapping:

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/2/8207e1d93f4d7ba06eaf1318afee38ec5dc01369.png)

And the records are like these

```auto
{
        "_index": "democracy_index",
        "_id": "DMd85JABaAYfS6nxnRVY",
        "_score": 1,
        "_source": {
          "Entity": "Afghanistan",
          "Year": 2014,
          "Code": "AFG",
          "Democracy score": 2.77
        }
      },
      {
        "_index": "democracy_index",
        "_id": "Dcd85JABaAYfS6nxnRVY",
        "_score": 1,
        "_source": {
          "Entity": "Afghanistan",
          "Year": 2015,
          "Code": "AFG",
          "Democracy score": 2.77
        }
      },
      {
        "_index": "democracy_index",
        "_id": "Dsd85JABaAYfS6nxnRVY",
        "_score": 1,
        "_source": {
          "Entity": "Afghanistan",
          "Year": 2016,
          "Code": "AFG",
          "Democracy score": 2.55
        }
      },
      {
        "_index": "democracy_index",
        "_id": "D8d85JABaAYfS6nxnRVY",
        "_score": 1,
        "_source": {
          "Entity": "Afghanistan",
          "Year": 2017,
          "Code": "AFG",
          "Democracy score": 2.55
        }
      }

```

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 5, 2024, 8:41am UTC](https://discuss.elastic.co/t/variety-of-data-in-y-axis/363701/4 "2024-08-05T08:41:29Z")

</div>

Ok, so I think the challenging part is the `Year` mapping, set as `long` instead of `date`.  
I think creating a runtime field in this case should do the trick, something like `year_as_date` would work.  
`YYYY` is already a valid date value, so no even need to transform it.

Once created the runtime field create a date histogram vs the metric value, with a breakdown on `Entity`.
