# Kibana: Line Graph from a JSON Array

**URL:** <https://discuss.elastic.co/t/kibana-line-graph-from-a-json-array/231591>\
**Category:** Kibana\
**Created:** [May 7, 2020, 4:51pm UTC](https://discuss.elastic.co/t/kibana-line-graph-from-a-json-array/231591 "2020-05-07T16:51:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mailinglists19](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@mailinglists19](https://discuss.elastic.co/u/mailinglists19)\
**Post date:** [May 7, 2020, 4:51pm UTC](https://discuss.elastic.co/t/kibana-line-graph-from-a-json-array/231591/1 "2020-05-07T16:51:23Z")

</div>

I’ve messages in Elasticsearch in the following format:

```auto
{
  "root": {
    "attributes": {
      "attribute1": {
        "trends": [47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 62.0, 62.0, 63.0, 63.0, 485.0]
      }, 
      "attribute2": {
        "trends": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 180.0]
      }
    },    
    "updateTimes": ["2020-05-03T13:08:08.967Z", "2020-05-03T13:08:09.217Z", "2020-05-03T13:08:09.234Z", "2020-05-03T13:08:09.116Z", "2020-05-03T13:08:08.889Z", "2020-05-03T13:08:09.766Z", "2020-05-03T13:08:09.783Z", "2020-05-03T13:08:09.486Z", "2020-05-03T13:08:37.594Z", "2020-05-03T13:08:37.750Z", "2020-05-03T13:09:11.378Z"],
    "id": "1234"
  }
}

```

I need to create a Line chart that shows trending values from the JSON array called, ‘trends’. In other words, ‘atrribute1’ will have its own Line Graph that shows trends & ‘attribute2’ will have its own. In the first version I don’t need to worry about the ‘updateTimes’ but if somehow I can show the value against its ‘updateTime’ that would be even better.

I tried using Line Graph but it only uses ‘aggregates’. Also tried ‘Timelion’ but couldn’t get it to work. Any help will be greatly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 11, 2020, 4:26pm UTC](https://discuss.elastic.co/t/kibana-line-graph-from-a-json-array/231591/2 "2020-05-11T16:26:29Z")

</div>

This is not possible in Kibana as it doesn't really support arrays. There is an open issue but there hasn't been any traction as Kibana fits more flattened data and it creates the aggregated data (like in your arrays) in ES by itself.  
You could probably display that data with a custom Vega visualization or with Canvas.

---

<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:** [June 8, 2020, 4:26pm UTC](https://discuss.elastic.co/t/kibana-line-graph-from-a-json-array/231591/3 "2020-06-08T16:26:32Z")

</div>

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