# How does datehistogram auto interval value changes on changing the timefilter from top right in Charts

**URL:** <https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801>\
**Category:** Kibana\
**Created:** [December 21, 2018, 7:52am UTC](https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801 "2018-12-21T07:52:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gargPrateek](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@gargPrateek](https://discuss.elastic.co/u/gargPrateek)\
**Post date:** [December 21, 2018, 7:52am UTC](https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801/1 "2018-12-21T07:52:38Z")

</div>

Which file in kibana does changes the auto interval to 12 hours or 3 hours when changing the timefilter accordingly.

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [December 22, 2018, 1:04am UTC](https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801/2 "2018-12-22T01:04:54Z")

</div>

That would be [src/ui/public/time\_buckets/calc\_auto\_interval.ts](https://github.com/elastic/kibana/blob/facad810ad6a7ce4c01229ecad3447b74debdb28/src/ui/public/time_buckets/calc_auto_interval.ts)

---

<div class="post-metadata">

**Author:** ![gargPrateek](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@gargPrateek](https://discuss.elastic.co/u/gargPrateek)\
**Post date:** [December 24, 2018, 10:11am UTC](https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801/3 "2018-12-24T10:11:03Z")

</div>

you are right but how the code control flows when we change the timefilter value, how the control goes to calc\_auto\_interval, how it changes the auto interval before fetching the details,just need to know this much flow.  
thanks if anyone can help

---

<div class="post-metadata">

**Author:** ![sebastien](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien/32/36119_2.png) [@sebastien](https://discuss.elastic.co/u/sebastien)\
**Post date:** [December 24, 2018, 3:46pm UTC](https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801/4 "2018-12-24T15:46:06Z")

</div>

Hi @gargPrateek

This is the flow that happens when changing the time filter

1. Call the onFilterSelect() on the directive

> <https://github.com/elastic/kibana/blob/facad810ad6a7ce4c01229ecad3447b74debdb28/src/ui/public/timepicker/timepicker.js#L173>

1. Set the time on the`TimeFilter` instance

> <https://github.com/elastic/kibana/blob/facad810ad6a7ce4c01229ecad3447b74debdb28/src/ui/public/timepicker/kbn_global_timepicker.js#L82>

1. The Angular `globalState.time` is updated

> <https://github.com/elastic/kibana/blob/facad810ad6a7ce4c01229ecad3447b74debdb28/src/ui/public/timefilter/timefilter.js#L209>

---

<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 21, 2019, 3:46pm UTC](https://discuss.elastic.co/t/how-does-datehistogram-auto-interval-value-changes-on-changing-the-timefilter-from-top-right-in-charts/161801/5 "2019-01-21T15:46:08Z")

</div>

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