# Handle line chart missing values

**URL:** <https://discuss.elastic.co/t/handle-line-chart-missing-values/210149>\
**Category:** Kibana\
**Created:** [December 2, 2019, 9:46am UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149 "2019-12-02T09:46:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MogK1llaa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mogk1llaa/32/58621_2.png) [@MogK1llaa](https://discuss.elastic.co/u/MogK1llaa)\
**Post date:** [December 2, 2019, 9:46am UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149/1 "2019-12-02T09:46:58Z")

</div>

Hello, I'm trying to visualize the price of gold through a month but I only have values for weekdays, so the value for weekends is null. Using min\_doc\_count I can take out the nulls but I want the weekend to have the same value as friday without creating new logs. How can I do this?  
Thank you!

 ![kibana](https://us1.discourse-cdn.com/elastic/original/3X/d/b/dbfabe1c1731991c650e415a1786ca823a386921.png)

---

<div class="post-metadata">

**Author:** ![Liza\_Katz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liza_katz/32/52358_2.png) [@Liza\_Katz](https://discuss.elastic.co/u/Liza_Katz)\
**Post date:** [December 2, 2019, 1:43pm UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149/2 "2019-12-02T13:43:11Z")

</div>

I think you should be able to create this behavior using **timelion**.

Try something like this:

```
.es(index=logstash*,
    timefield='data',
    metric='min:cena').fit(carry)

```

The [carry option](https://www.elastic.co/blog/sparse-timeseries-and-timelion) interpolates missing data using the latest available data.

If you need to apply additional filtering, you may use the [timelion if function](https://www.elastic.co/blog/timeseries-if-then-else-with-timelion) as well.

Hope this helps,

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [December 2, 2019, 3:33pm UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149/3 "2019-12-02T15:33:12Z")

</div>

We are working on enabling this in other visualization types, a change was recently merged to our charting library which will hopefully make its way into various editors soon: [https://github.com/elastic/kibana/issues/17717](https://github.com/elastic/kibana/issues/17717)

---

<div class="post-metadata">

**Author:** ![MogK1llaa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mogk1llaa/32/58621_2.png) [@MogK1llaa](https://discuss.elastic.co/u/MogK1llaa)\
**Post date:** [December 2, 2019, 5:21pm UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149/4 "2019-12-02T17:21:58Z")

</div>

I tried to use Timelion but I can't define the timefield to be "data". With .es(\*) I can see that all the logs are being read correctly but timefield='data' does nothing

---

<div class="post-metadata">

**Author:** ![Liza\_Katz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liza_katz/32/52358_2.png) [@Liza\_Katz](https://discuss.elastic.co/u/Liza_Katz)\
**Post date:** [December 9, 2019, 5:00pm UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149/5 "2019-12-09T17:00:00Z")

</div>

Hey,

The timefield is just a way to specify the name of the field according to which the timeseries is measured. Just put the column name of the timefield you have.

Thanks,

---

<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:** [January 6, 2020, 5:00pm UTC](https://discuss.elastic.co/t/handle-line-chart-missing-values/210149/6 "2020-01-06T17:00:02Z")

</div>

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