# Power Chart Export Configuration

**URL:** <https://forum.inductiveautomation.com/t/power-chart-export-configuration/55007>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [January 13, 2022, 11:34pm UTC](https://forum.inductiveautomation.com/t/power-chart-export-configuration/55007 "2022-01-13T23:34:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![isabellapitco](https://avatars.discourse-cdn.com/v4/letter/i/ebca7d/32.png) [@isabellapitco](https://forum.inductiveautomation.com/u/isabellapitco)\
**Post date:** [January 13, 2022, 11:34pm UTC](https://forum.inductiveautomation.com/t/power-chart-export-configuration/55007/1 "2022-01-13T23:34:12Z")

</div>

Hi all,

I wonder if anyone knows how (or if its even possible) to alter the data that can be exported from a powerchart. Our tags store history on change, so the time stamps of those changes are super variable. Instead, I would like to just export the values of all tags every 30 seconds, rather than every change. Any advice?

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [January 14, 2022, 12:37am UTC](https://forum.inductiveautomation.com/t/power-chart-export-configuration/55007/2 "2022-01-14T00:37:28Z")

</div>

I don’t know if you can alter the behavior of the power chart. You can put this script in a separate button. It will query the tag historian and return a dataset with a value every 30 seconds. You can use either [system.dataset.exportExcel](https://docs.inductiveautomation.com/display/DOC81/system.dataset.exportExcel) or [system.dataset.toExcel](https://docs.inductiveautomation.com/display/DOC81/system.dataset.toExcel) + [system.perspective.download](https://docs.inductiveautomation.com/display/DOC81/system.perspective.download) to ‘export’ to the user.

Note: Property names are vision syntax. Replace these properties with the appropriate Perspective properties and you can use it there too.

Script:

```auto
data = system.tag.queryTagHistory(
	# you can have more than one tag path in the list. They'll show up as separate columns
	['tagPath'],
	startDate=event.source.parent.getComponent('Easy Chart').startDate, # replace
	endDate=event.source.parent.getComponent('Easy Chart').endDate, #replace
	aggregationMode='Average', #read about various aggregation modes. Pick the one you like
	columnNames=['tagValue'],
	intervalSeconds=30, # only available in 8.1.0 or later
	noInterpolation=0 # Investigate whether you want this on or off
)
# this line is for testing. You'd actually want to do something with the dataset.
event.source.parent.getComponent('Table').data = data

```

For more, see docs on **[system.tag.queryTagHistory](https://docs.inductiveautomation.com/display/DOC81/system.tag.queryTagHistory).**

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [January 14, 2022, 12:40pm UTC](https://forum.inductiveautomation.com/t/power-chart-export-configuration/55007/3 "2022-01-14T12:40:22Z")

</div>

I’m not used to Perspective, but perhaps you could change the Power Chart mode to “historical” and then use a script that just updates the start date and end date properties of it.
