# Line chart from field values

**URL:** https://discuss.elastic.co/t/line-chart-from-field-values/124913
**Category:** Kibana
**Created:** [March 21, 2018, 6:40am UTC](https://discuss.elastic.co/t/line-chart-from-field-values/124913 "2018-03-21T06:40:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)
#### Post date: [March 21, 2018, 6:40am UTC](https://discuss.elastic.co/t/line-chart-from-field-values/124913/1 "2018-03-21T06:40:42Z")

</div>

Hi  
Is it possible to draw line chart from field values ? I want to plot following two fields -

error:1, time: 17/11/13-13:28:21.247  
error:0, time: 18/11/13-13:28:21.247  
error:1, time: 19/11/13-13:28:21.247  
error:0, time: 20/11/13-13:28:21.247  
error:0, time: 21/11/13-13:28:21.247

time in X-axis and error filed value which is either 1 or 0 in the Y-axis.

---

<div class="post-metadata">

### Author: ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)
#### Post date: [March 21, 2018, 7:05am UTC](https://discuss.elastic.co/t/line-chart-from-field-values/124913/2 "2018-03-21T07:05:54Z")

</div>

Hi  
Max(error) aggregation in Y-axis and Date Histogram @timestamp has plotted the values in the line chart but this is without time field from the event.

---

<div class="post-metadata">

### Author: ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)
#### Post date: [March 21, 2018, 1:38pm UTC](https://discuss.elastic.co/t/line-chart-from-field-values/124913/3 "2018-03-21T13:38:21Z")

</div>

> but this is without time field from the event.

Sounds like you have multiple time fields? Is that correct? You have an `@timestamp` field and then another `time` field that you have shown in the first post? So when you created your line chart, you used the @timestamp field, but you want to use the time field?

Does the time field not show up as an option for the Date Histogram? Perhaps it was not indexed as a time field? You can double check this under Management \> Index Patterns to see what type the time field has been indexed as.

---

<div class="post-metadata">

### Author: ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)
#### Post date: [March 21, 2018, 4:09pm UTC](https://discuss.elastic.co/t/line-chart-from-field-values/124913/4 "2018-03-21T16:09:25Z")

</div>

Yes, The time filed was in string format, so need to convert it in timestamp format using date filter.

```
date {
	match => ["dtimestamp", "yy/MM/dd-HH:mm:ss.SSS"]
        target => "dt"
}

```

After that i can choose the new filed "dt" in X-axis (datetime histogram) and max(error) in Y-axis.

Regards

---

<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: [April 18, 2018, 4:09pm UTC](https://discuss.elastic.co/t/line-chart-from-field-values/124913/5 "2018-04-18T16:09:36Z")

</div>

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