# Scripting on the Chart Range Selector

**URL:** <https://forum.inductiveautomation.com/t/scripting-on-the-chart-range-selector/45320>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [April 7, 2021, 2:28am UTC](https://forum.inductiveautomation.com/t/scripting-on-the-chart-range-selector/45320 "2021-04-07T02:28:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [April 7, 2021, 2:28am UTC](https://forum.inductiveautomation.com/t/scripting-on-the-chart-range-selector/45320/1 "2021-04-07T02:28:49Z")

</div>

I have a Chart Range Selector that polls every 5 seconds to get new data and to move the selection window to the newest time. However, I only want it to do that if the user has not moved the brush to a different time. I was going to set up some logic for this in scripting, but I don’t see an event for when the brush start and end times are changed. I tried using OnClick, but it doesn’t seem to work consistently. Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [April 7, 2021, 2:43am UTC](https://forum.inductiveautomation.com/t/scripting-on-the-chart-range-selector/45320/2 "2021-04-07T02:43:03Z")

</div>

Upon further testing, using OnClick does seem to work.
