Display numbers on y-axis without metrics

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.

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:


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

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


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 ?

@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:

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