# Display numbers on y-axis without metrics

**URL:** <https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057>\
**Category:** Kibana\
**Created:** [October 24, 2019, 12:05pm UTC](https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057 "2019-10-24T12:05:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maco](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@maco](https://discuss.elastic.co/u/maco)\
**Post date:** [October 24, 2019, 12:05pm UTC](https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057/1 "2019-10-24T12:05:13Z")

</div>

Hi,

I'm new to Kibana and i have a problem that i cant display just number on y-axis.  
So i want to have on y-axis numbers like state of device [0 = online,1 = shutdown, 2 = offline] and on x-axis time.  
I want to make area or line visualization that i will display change state of device depend of time.  
I dont know how to put on y-axis just [0,1,2] with no metrics.

 ![kibanaVisualization](https://us1.discourse-cdn.com/elastic/original/3X/8/c/8c8081fab2855b4ddde53dae6545dd2c5c14209d.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 24, 2019, 8:56pm UTC](https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057/2 "2019-10-24T20:56:09Z")

</div>

Hey @maco, Kibana's visualizations all operated based on "aggregations". It sounds like you're trying to create a chart from single document over time. If you have a field which is unique you can do a terms aggregation on that field and then the sum metric will display the data that you're looking for.

For an example, I've created the following 5 documents:

```auto

POST maco/_doc
{
  "field1": "a",
  "field2": 1
}

POST maco/_doc
{
  "field1": "b",
  "field2": 2
}

POST maco/_doc
{
  "field1": "c",
  "field2": 1
}

POST maco/_doc
{
  "field1": "d",
  "field2": 0
}

POST maco/_doc
{
  "field1": "e",
  "field2": 1
}

```

and then you can visualize it like so

 ![40%20PM](https://us1.discourse-cdn.com/elastic/original/3X/5/8/582150c6eb779b25a298fa7f6a9a78b606e5d770.png)

---

<div class="post-metadata">

**Author:** ![maco](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@maco](https://discuss.elastic.co/u/maco)\
**Post date:** [October 25, 2019, 1:52pm UTC](https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057/3 "2019-10-25T13:52:05Z")

</div>

Thank you @Brandon_Kobel for taking your time to answer my question.  
But I think i didn't explain it right. So this is my elastic documents

 ![elastic2](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca27c2c4c11fc7cd53208149837845def6e3eb9d.png)  
Those rows that are highlighted i want display. So i want to display changes of states depends on TimeFrom.DateTime in area plot. On y-axes i want to have states and on x-axes TimeFrom.DateTime. I dont know if is this posible in Kibana ?

 ![elasticgrapg](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a3a421e75e9453bedf2c9e5331b7bd79951c3c1.png)

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 25, 2019, 4:09pm UTC](https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057/4 "2019-10-25T16:09:17Z")

</div>

@maco I'm not aware of a way to create that exact graph you're looking for. You could potentially use a "Sum" of the State with a really small date histogram interval to get something close. However, if we get two documents whose date-times are close enough to each other, you could end up with an incorrect state.

You could create two x-axis aggregations, the first one being a date-historgram, and the second one splitting the series and doing a terms aggregation on state. This would give you with a graph similar to the following where the different colored bars would represent either State 1 or State 2:

 ![55%20AM](https://us1.discourse-cdn.com/elastic/original/3X/c/3/c3a63c41017edafdfebd466db0ecc2fb67854dde.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 22, 2019, 4:09pm UTC](https://discuss.elastic.co/t/display-numbers-on-y-axis-without-metrics/205057/5 "2019-11-22T16:09:20Z")

</div>

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