# Variable Min and Max date in Chart Component

**URL:** <https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976>\
**Category:** Ignition\
**Created:** [January 4, 2016, 2:22am UTC](https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976 "2016-01-04T02:22:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenko](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jenko](https://forum.inductiveautomation.com/u/Jenko)\
**Post date:** [January 4, 2016, 2:22am UTC](https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976/1 "2016-01-04T02:22:50Z")

</div>

Hi all,

I’m trying to programmatically change the Min and Max Date variables of my X-Axis in a Chart. (based on a user date selection) The property panel says that they have a property scripting name of “minimumDate” and “maximumDate” but I don’t know how to change them via a script.

Any help/examples would be greatly appreciated.

Cheers  
Dan

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 4, 2016, 8:27pm UTC](https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976/2 "2016-01-04T20:27:34Z")

</div>

Easiest way is to put a DateRange control on the window and then tie the MinDate and MaxDate properties to the .StartDate and .EndDate of the DateRange control.

You can also do this with 2 calendar controls as well.

---

<div class="post-metadata">

**Author:** ![Jenko](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jenko](https://forum.inductiveautomation.com/u/Jenko)\
**Post date:** [January 4, 2016, 11:59pm UTC](https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976/3 "2016-01-04T23:59:34Z")

</div>

Yeah I tried to do that but I can’t figure out how to bind the date range properties because the Chart’s MinDate and MaxDate aren’t exposed in the properties window.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 5, 2016, 12:51pm UTC](https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976/4 "2016-01-05T12:51:27Z")

</div>

How do you have the chart bound to data? With a Query? Tag History? To a Table?  
How you have it bound will determine how to set the date range.

---

<div class="post-metadata">

**Author:** ![Jenko](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jenko](https://forum.inductiveautomation.com/u/Jenko)\
**Post date:** [January 6, 2016, 10:42am UTC](https://forum.inductiveautomation.com/t/variable-min-and-max-date-in-chart-component/10976/5 "2016-01-06T10:42:36Z")

</div>

Thank you, I have it bound to tag history and I can see where to bind the date properties now. I was expecting it to be in the properties window but I was just looking in the wrong place turns out.

Thank you for your help MMaynardUSG
