# Access to chart zoom data?

**URL:** <https://forum.inductiveautomation.com/t/access-to-chart-zoom-data/6912>\
**Category:** Ignition\
**Created:** [July 23, 2013, 1:49pm UTC](https://forum.inductiveautomation.com/t/access-to-chart-zoom-data/6912 "2013-07-23T13:49:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![narodauhsoj](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@narodauhsoj](https://forum.inductiveautomation.com/u/narodauhsoj)\
**Post date:** [July 23, 2013, 1:49pm UTC](https://forum.inductiveautomation.com/t/access-to-chart-zoom-data/6912/1 "2013-07-23T13:49:59Z")

</div>

Using the classic chart component, a user can draw a box with the mouse on the chart after it is drawn and it will zoom in on the data to allow the user to see more detail of the data.

My question is…after the user zooms in, am I able to get access to the zoom level, or more specifically the relative axes? I would like to be able to know what data the user has zoomed in on so that I can export it as CSV, or even use that data to run another SQL query with constraints.

Thanks!

-narodauhsoj

---

<div class="post-metadata">

**Author:** ![dep05d](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dep05d](https://forum.inductiveautomation.com/u/dep05d)\
**Post date:** [July 23, 2013, 3:40pm UTC](https://forum.inductiveautomation.com/t/access-to-chart-zoom-data/6912/2 "2013-07-23T15:40:23Z")

</div>

This should give you the zoomed date range that could be used to build an export query.

```auto
chart = event.source.parent.getComponent('Chart')
print chart.getChart().getPlot().getDomainAxis().getMinimumDate()
print chart.getChart().getPlot().getDomainAxis().getMaximumDate()
```

Dan

---

<div class="post-metadata">

**Author:** ![narodauhsoj](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@narodauhsoj](https://forum.inductiveautomation.com/u/narodauhsoj)\
**Post date:** [July 23, 2013, 4:23pm UTC](https://forum.inductiveautomation.com/t/access-to-chart-zoom-data/6912/3 "2013-07-23T16:23:50Z")

</div>

Thank you so much!

Where is the reference that contains that kind of stuff?

-narodauhsoj

---

<div class="post-metadata">

**Author:** ![dep05d](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dep05d](https://forum.inductiveautomation.com/u/dep05d)\
**Post date:** [July 23, 2013, 5:20pm UTC](https://forum.inductiveautomation.com/t/access-to-chart-zoom-data/6912/4 "2013-07-23T17:20:02Z")

</div>

I’m glad that helped!

Most, if not all, of the chart components in Ignition are based off of the JFreeChart library. I remembered .getChart() from some other forum post here to get the actual JFreeChart object, and from there it’s just surfing through the documentation to find out how to get the axes and their respective values.

You can see what classes you are working with using .getClass()

```auto
print chart.getChart().getClass()
print chart.getChart().getPlot().getClass()
print chart.getChart().getPlot().getDomainAxis().getClass()
```

The class names don’t exactly match JFreeChart, likely because Ignition uses wrapper objects to allow bindings, etc. I may not even be looking at the correct classes (I’m not really a java guy, so I have to wing it), but it’s usually close enough to figure it out. I assumed these were the corresponding classes:

object returned from getChart()  
[http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html)

object returned from getChart().getPlot()  
[http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/Plot.html](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/Plot.html)  
subclass:  
[http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html)

object returned from getChart().getPlot().getDomainAxis().  
[http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/ValueAxis.html](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/ValueAxis.html)  
subclass:  
[http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/DateAxis.html](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/DateAxis.html)

Dan
