# \[IGN-7244\]Easy Chart ExportDatasets

**URL:** <https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [February 21, 2023, 4:14pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118 "2023-02-21T16:14:03Z")\
**Posts on this page:** 10\
**Page:** 1

<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:** [February 21, 2023, 4:14pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/1 "2023-02-21T16:14:03Z")

</div>

Hi all,  
Can someone tell me if the exportDataSets function on the easy chart reissues the underlying query against historical tags?  
We are working with extremely large datasets at times and I am working on trimming down any extraneous data calls.  
The Adhoc Trend template was issuing the underlying query X number of times where X is the number of tags in the chart due to the MIN/MAX/AVG calculations being done.  
So I removed those calls and now I want to just script gathering those values on the underlying datasets.  
BUT... it does appear to me that the exportDataSets call does in fact reissue the query ☹

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 21, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/2 "2023-02-21T16:50:59Z")

</div>

Hm. A glance at the code suggests that it shouldn't be issuing new queries.

---

<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:** [February 21, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/3 "2023-02-21T17:51:07Z")

</div>

Could it be causing a binding refresh that then triggers the query?  
When you call the exportDataSets(), the entire chart refreshes on the screen.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 21, 2023, 5:55pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/4 "2023-02-21T17:55:26Z")

</div>

Try setting `com.inductiveautomation.factorypmi.application.components.PMIEasyChart` to trace (in the client/designer) and exporting; that should have some logging info that helps confirm what's going on.

The implementation of `exportDatasets` is basically just collecting all of the 'pens' you have, and asking each pen for its data. All of the pens _should_ just be handing back the datasets they already have, so I'm not sure what's causing the chart to refresh.

---

<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:** [February 21, 2023, 6:50pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/5 "2023-02-21T18:50:38Z")

</div>

As soon as I went to set the logging I realized what is going on.  
The AdHoc Trend template writes the values back to the tagPens binding on the Easy Chart.  
Which then triggers the bindings on the easy chart.  
So now I need to figure out another way to display those values without writing back to the dataset.

Just a heads up but someone should update the documentation on the adHoc Trend template to reference how many queries are issued against the historian when you use it.  
It isn't noticeable when the tag count is low or the date range isn't very large.  
But if you get say 6 tags and a few months of data it is definitely noticeable.

---

<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:** [February 23, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/6 "2023-02-23T15:09:08Z")

</div>

@paul-griffith , could you verify something else for me?  
I have been running the chart in debug and noticed that if you put pens on different AXIS, the queries get split for some reason and you end up with multiple queries hitting the historian and they are returning different numbers of records even with the density set to Fixed 1900.

Why would it be splitting it into separate queries when it is just the Y AXIS range that is different?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 23, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/7 "2023-02-23T16:44:58Z")

</div>

It's probably an implementation thing with the chart. I don't know for sure without doing a deeper analysis of the code, but it's possible there's something to improve there. I'll file a ticket to investigate.

---

<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:** [February 23, 2023, 6:05pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/8 "2023-02-23T18:05:14Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 2, 2023, 4:49pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/9 "2023-03-02T16:49:33Z")

</div>

> [@MMaynard](#):
>
> Why would it be splitting it into separate queries when it is just the Y AXIS range that is different?

For posterity: Do these different pens have different aggregation modes? The way the chart is written, that's the first chance things have to be separated into different groups. That is - we _can't_ issue a min/max, average, and natural aggregation mode query simultaneously; they have to be issued as separated queries.

---

<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:** [March 2, 2023, 6:33pm UTC](https://forum.inductiveautomation.com/t/ign-7244-easy-chart-exportdatasets/70118/10 "2023-03-02T18:33:59Z")

</div>

No they do not.  
We have it coded to always use Closest Value.
