# Easy Chart - How to keep a constant sample rate for exports

**URL:** <https://forum.inductiveautomation.com/t/easy-chart-how-to-keep-a-constant-sample-rate-for-exports/9789>\
**Category:** Ignition\
**Created:** [March 10, 2015, 10:49pm UTC](https://forum.inductiveautomation.com/t/easy-chart-how-to-keep-a-constant-sample-rate-for-exports/9789 "2015-03-10T22:49:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccarruthers](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@ccarruthers](https://forum.inductiveautomation.com/u/ccarruthers)\
**Post date:** [March 10, 2015, 10:49pm UTC](https://forum.inductiveautomation.com/t/easy-chart-how-to-keep-a-constant-sample-rate-for-exports/9789/1 "2015-03-10T22:49:33Z")

</div>

We use the ‘Save Data For Excel’ feature on Easy Chart. We have a 2 second sample rate, unless the user changes the range of data displayed. Is there a way to maintain the sample rate for data exports even with variable sample size?

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [March 19, 2015, 6:56pm UTC](https://forum.inductiveautomation.com/t/easy-chart-how-to-keep-a-constant-sample-rate-for-exports/9789/2 "2015-03-19T18:56:05Z")

</div>

You can create a consistent sample rate by capturing the data by another means. I would take a look at the system.tag.queryTagHistory function. You can write a script with this function and have it return a set amount of data each time. This could be executed from a button press.

---

<div class="post-metadata">

**Author:** ![matsons](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@matsons](https://forum.inductiveautomation.com/u/matsons)\
**Post date:** [April 28, 2015, 6:47pm UTC](https://forum.inductiveautomation.com/t/easy-chart-how-to-keep-a-constant-sample-rate-for-exports/9789/3 "2015-04-28T18:47:16Z")

</div>

To follow up on the queryTagHistory() function solution. Is there a trick to use if we want data returned at a frequency less than 1 minute, like every 10 seconds? Right now the function will only allow specify the intervals in hours and minutes.

Thank you for any pointers.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [April 29, 2015, 1:59pm UTC](https://forum.inductiveautomation.com/t/easy-chart-how-to-keep-a-constant-sample-rate-for-exports/9789/4 "2015-04-29T13:59:16Z")

</div>

Yes you can. Specify a range and then specify your return size.

For example if you specified 1 minute for rangeMinutes and specified a returnSize of 6 then you would return data with a sample rate of 10 seconds.

Best,
