# Vision chart: Resampling on zoom

**URL:** <https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 5, 2024, 7:59am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392 "2024-06-05T07:59:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Overcraft31](https://avatars.discourse-cdn.com/v4/letter/o/5f9b8f/32.png) [@Overcraft31](https://forum.inductiveautomation.com/u/Overcraft31)\
**Post date:** [June 5, 2024, 7:59am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/1 "2024-06-05T07:59:29Z")

</div>

Hello,

I want to display 100 000 points of data in a chart. With easy chart is very simple to parameter the number of points I want to display (for exemple 2 000) and if I zoom in the chart resample the data in the zoom range: So if I zoom enought, I can see the raw data on the chart.  
THat's exactly what I want 🙂

My question is: If I want to do that kind of behavior with regular Chart module, is it possible and how can I do that please?  
I've found some info about resampling on zoom with Jchartfree API but maybe there is a better way to do that?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 5, 2024, 8:15am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/2 "2024-06-05T08:15:53Z")

</div>

How are you getting the data for the chart component?

---

<div class="post-metadata">

**Author:** ![Overcraft31](https://avatars.discourse-cdn.com/v4/letter/o/5f9b8f/32.png) [@Overcraft31](https://forum.inductiveautomation.com/u/Overcraft31)\
**Post date:** [June 5, 2024, 9:32am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/3 "2024-06-05T09:32:40Z")

</div>

I'm using Tag Historian 🙂

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 5, 2024, 11:38am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/4 "2024-06-05T11:38:30Z")

</div>

Just supply the 100000 points to the chart in a dataset. No need to resample.

---

<div class="post-metadata">

**Author:** ![Overcraft31](https://avatars.discourse-cdn.com/v4/letter/o/5f9b8f/32.png) [@Overcraft31](https://forum.inductiveautomation.com/u/Overcraft31)\
**Post date:** [June 5, 2024, 12:31pm UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/5 "2024-06-05T12:31:01Z")

</div>

I said 100 000 points just to give the main idea. In fact it's more like 3 000 000 points per plot (up to 20 plots on the chart).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 5, 2024, 12:55pm UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/6 "2024-06-05T12:55:39Z")

</div>

> [@Overcraft31](#):
>
> it's more like

Been there, done that. Just give the chart the whole thing. Allow your client more RAM (in project properties) if necessary.

(You might find my [Time Series Database Cache module](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-time-series-database-cache) helpful to get such large history datasets into Vision without query timeouts.)

---

<div class="post-metadata">

**Author:** ![Overcraft31](https://avatars.discourse-cdn.com/v4/letter/o/5f9b8f/32.png) [@Overcraft31](https://forum.inductiveautomation.com/u/Overcraft31)\
**Post date:** [June 6, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/7 "2024-06-06T12:58:52Z")

</div>

I've tryed the sample size "On change" on the chart dataset: My client crashes.  
I really need to resample the data on zoom. To implement the same resampling mode like Easy Chart, it seems difficult to you?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 7, 2024, 3:16am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/8 "2024-06-07T03:16:28Z")

</div>

> [@Overcraft31](#):
>
> per plot

Do you mean per pen? How many datasets are being updated?

---

<div class="post-metadata">

**Author:** ![Overcraft31](https://avatars.discourse-cdn.com/v4/letter/o/5f9b8f/32.png) [@Overcraft31](https://forum.inductiveautomation.com/u/Overcraft31)\
**Post date:** [June 7, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/9 "2024-06-07T06:56:19Z")

</div>

Yes sorry it's per pen. I got only 1 dataset filled by Tag Historian.

If I try to display raw data the client freezes.

I'd like to catch the zoom event but as far as I can see, I only can catch the mouse events (it's a start but maybe not the best way....) and capture the new bounds during this event and use  
[system.tag.queryTagHistory | Ignition User Manual (inductiveautomation.com)](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-queryTagHistory) to resample the data.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 7, 2024, 8:33am UTC](https://forum.inductiveautomation.com/t/vision-chart-resampling-on-zoom/91392/10 "2024-06-07T08:33:35Z")

</div>

> [@Overcraft31](#):
>
> mouse events

I suppose it would be simple enough to store the visible start and end domain somewhere, and check to see if it's changed on the mouse released event.

```python
dateAxis = event.source.chart.plot.domainAxis
startDate = event.source.chart.plot.domainAxis.lowerBound
endDate = event.source.chart.plot.domainAxis.upperBound
print startDate, endDate

```

...and the unzooming behavior could probably mimicked using the mouse dragged event if its right to left, but perhaps it would be simpler to just use a date range component to set the visible area?
