# How to get the X and Y axis value during in Zoom/Pan mode of Easy Chart

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [October 26, 2022, 6:35am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693 "2022-10-26T06:35:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![June\_Zhu](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@June\_Zhu](https://forum.inductiveautomation.com/u/June_Zhu)\
**Post date:** [October 26, 2022, 6:35am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/1 "2022-10-26T06:35:44Z")

</div>

How to get the X and Y axis value/range during in Zoom/Pan mode of Easy Chart.  
When we zoomed into a rectangle using mouse, how do we get the X axis (date-time) range and Y axis (value) range of that rectangle so that I can save that X/Y axis range and enter into that rectangle range easily? thanks in advance.

---

<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:** [October 26, 2022, 9:12am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/2 "2022-10-26T09:12:59Z")

</div>

The date range can be obtained this way:

```auto
print event.source.getZoomedStartDate()
print event.source.getZoomedEndDate()

```

---

<div class="post-metadata">

**Author:** ![June\_Zhu](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@June\_Zhu](https://forum.inductiveautomation.com/u/June_Zhu)\
**Post date:** [November 2, 2022, 6:29am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/3 "2022-11-02T06:29:45Z")

</div>

Thanks man for your helps. This will only get the date range(X-axis), however, would you tell me how can I get the value range (Y-axis)?

---

<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:** [November 2, 2022, 6:54am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/4 "2022-11-02T06:54:36Z")

</div>

I'm not sure. What I can tell you is that I checked every method listed in the [PMIEasyChart documentation](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.20/com/inductiveautomation/factorypmi/application/components/PMIEasyChart.html), and so far, I have been unable to find it:  
Just in case it could help you in some way, here is my cheat sheet for experimenting with the Easy Chart methods:

> **Code List**
>
> ```auto
> print 'getAppContext : '+str(event.source.getAppContext())
> print 'getAutoColorList : '+str(event.source.getAutoColorList())
> print 'getAxes : '+str(event.source.getAxes())
> print 'getAxisLabelFont : '+str(event.source.getAxisLabelFont())
> print 'getAxisTickLabelFont : '+str(event.source.getAxisTickLabelFont())
> print 'getBarMargin : '+str(event.source.getBarMargin())
> print 'getBoxFill : '+str(event.source.getBoxFill())
> print 'getCalcPens : '+str(event.source.getCalcPens())
> print 'getChartBorder : '+str(event.source.getChartBorder())
> print 'getChartMode : '+str(event.source.getChartMode())
> print 'getCursorCode : '+str(event.source.getCursorCode())
> print 'getDatapoints : '+str(event.source.getDatapoints())
> print 'getDataQuality: '+str(event.source.getDataQuality())
> print 'getDateRange : '+str(event.source.getDateRange())
> print 'getDateRangeBorder : '+str(event.source.getDateRangeBorder())
> print 'getDateRangeLocation : '+str(event.source.getDateRangeLocation())
> print 'getDateStyle : '+str(event.source.getDateStyle())
> print 'getDigitalGap : '+str(event.source.getDigitalGap())
> print 'getEditorBackgroundColor : '+str(event.source.getEditorBackgroundColor())
> print 'getEditorForegroundColor : '+str(event.source.getEditorForegroundColor())
> print 'getEffectivePollRate: '+str(event.source.getEffectivePollRate())
> print 'getEmptyGroupName : '+str(event.source.getEmptyGroupName())
> print 'getEndDate : '+str(event.source.getEndDate())
> print 'getExtensionFunctions : '+str(event.source.getExtensionFunctions())
> print 'getGapThreshold : '+str(event.source.getGapThreshold())
> print 'getGlobalWhereClause : '+str(event.source.getGlobalWhereClause())
> print 'getGridlineColor : '+str(event.source.getGridlineColor())
> print 'getGridlineDashPattern : '+str(event.source.getGridlineDashPattern())
> print 'getGridlineWidth : '+str(event.source.getGridlineWidth())
> print 'getGroupWheres : '+str(event.source.getGroupWheres())
> print 'gethGap : '+str(event.source.gethGap())
> print 'getHGap : '+str(event.source.getHGap())
> print 'getHighDensityColor : '+str(event.source.getHighDensityColor())
> print 'getHistogramEndDate : '+str(event.source.getHistogramEndDate())
> print 'getHistogramStartDate : '+str(event.source.getHistogramStartDate())
> print 'getHorizontalResolution: '+str(event.source.getHorizontalResolution())
> print 'getLegend : '+str(event.source.getLegend())
> print 'getMaxSelectionSize : '+str(event.source.getMaxSelectionSize())
> print 'getOuterRangeEnd : '+str(event.source.getOuterRangeEnd())
> print 'getOuterRangeStart : '+str(event.source.getOuterRangeStart())
> print 'getPenBorder : '+str(event.source.getPenBorder())
> print 'getPenControlMode : '+str(event.source.getPenControlMode())
> print 'getPens : '+str(event.source.getPens())
> print 'getPlotBackground : '+str(event.source.getPlotBackground())
> print 'getPlotOrientation : '+str(event.source.getPlotOrientation())
> print 'getPlotOutlineColor : '+str(event.source.getPlotOutlineColor())
> print 'getPollRate : '+str(event.source.getPollRate())
> print 'getProperties : '+str(event.source.getProperties())
> print 'getPropertiesLoading : '+str(event.source.getPropertiesLoading())
> print 'getRtDateRange : '+str(event.source.getRtDateRange())
> print 'getRtLabel : '+str(event.source.getRtLabel())
> print 'getSelectedXValue : '+str(event.source.getSelectedXValue())
> print 'getSelectionHighlight : '+str(event.source.getSelectionHighlight())
> print 'getStartDate : '+str(event.source.getStartDate())
> print 'getStartupRange : '+str(event.source.getStartupRange())
> print 'getStartupSelection : '+str(event.source.getStartupSelection())
> print 'getSubplotGap : '+str(event.source.getSubplotGap())
> print 'getSubplots : '+str(event.source.getSubplots())
> print 'getTagHistoryAllowInterpolation : '+str(event.source.getTagHistoryAllowInterpolation())
> print 'getTagHistoryBypassCache : '+str(event.source.getTagHistoryBypassCache())
> print 'getTagHistoryIgnoreBadData : '+str(event.source.getTagHistoryIgnoreBadData())
> print 'getTagHistoryResolution : '+str(event.source.getTagHistoryResolution())
> print 'getTagHistoryResolutionMode : '+str(event.source.getTagHistoryResolutionMode())
> print 'getTagHistoryValidateScanclass : '+str(event.source.getTagHistoryValidateScanclass())
> print 'getTagPens : '+str(event.source.getTagPens())
> print 'getTickDensity : '+str(event.source.getTickDensity())
> print 'getTimeStyle : '+str(event.source.getTimeStyle())
> print 'getTitle : '+str(event.source.getTitle())
> print 'getTitleFont : '+str(event.source.getTitleFont())
> print 'getTodayIndicatorColor : '+str(event.source.getTodayIndicatorColor())
> print 'getToolTipText : '+str(event.source.getToolTipText())
> print 'getTrackMargin : '+str(event.source.getTrackMargin())
> print 'getUnit : '+str(event.source.getUnit())
> print 'getUnitCount : '+str(event.source.getUnitCount())
> print 'getUtilityButtonSize : '+str(event.source.getUtilityButtonSize())
> print 'getvGap : '+str(event.source.getvGap())
> print 'getVGap : '+str(event.source.getVGap())
> print 'getxAxisLabel : '+str(event.source.getxAxisLabel())
> print 'getXAxisLabel : '+str(event.source.getXAxisLabel())
> print 'getxAxisMargin : '+str(event.source.getxAxisMargin())
> print 'getXAxisMargin : '+str(event.source.getXAxisMargin())
> print 'getxOffset3D : '+str(event.source.getxOffset3D())
> print 'getXOffset3D : '+str(event.source.getXOffset3D())
> print 'getxTraceLargeNumberFormat : '+str(event.source.getxTraceLargeNumberFormat())
> print 'getXTraceLargeNumberFormat : '+str(event.source.getXTraceLargeNumberFormat())
> print 'getxTraceNumberFormatThreshold : '+str(event.source.getxTraceNumberFormatThreshold())
> print 'getXTraceNumberFormatThreshold : '+str(event.source.getXTraceNumberFormatThreshold())
> print 'getxTraceSmallNumberFormat : '+str(event.source.getxTraceSmallNumberFormat())
> print 'getXTraceSmallNumberFormat : '+str(event.source.getXTraceSmallNumberFormat())
> print 'getyOffset3D : '+str(event.source.getyOffset3D())
> print 'getYOffset3D : '+str(event.source.getYOffset3D())
> print 'getZoomedEndDate : '+str(event.source.getZoomedEndDate())
> print 'getZoomedStartDate : '+str(event.source.getZoomedStartDate())
> 
> ```

~~If I ever figure it out, I will let you know.~~ [See below](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/5)

**Edit:** Updated documentation link

---

<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:** [November 10, 2022, 3:01am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/5 "2022-11-10T03:01:13Z")

</div>

@June_Zhu - I finally figured this out. I was able to get all four parameter values in an easy chart from a test button using the following script:

```auto
chart = event.source.parent.getComponent('Easy Chart')
leftDomainX = chart.getZoomedStartDate()
rightDomainX = chart.getZoomedEndDate()
lowerRangeY = chart.getComponent(0).getComponent(0).chart.getPlot().getRangeAxis().getLowerBound()
upperRangeY = chart.getComponent(0).getComponent(0).chart.getPlot().getRangeAxis().getUpperBound()
print "Current Y-Axis visible range = " + str(lowerRangeY) + " - " + str(upperRangeY)
print "Current X-Axis visible range = " + str(leftDomainX) + " - " + str(rightDomainX)

```

**Output prior to zoom:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/57a6c42bcd04a9f116e7dc63f03b4fc9bcd3578b.png)

```auto
Current Y-Axis visible range = -0.1 - 200.0
Current X-Axis visible range = Tue Nov 08 20:00:00 CST 2022 - Wed Nov 09 20:59:59 CST 2022

```

**Output after zoom:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/6/56ab987a812781b1e5cad6d87a8231b920887b8d.png)

```auto
Current Y-Axis visible range = 53.600332834 - 108.341278965
Current X-Axis visible range = Tue Nov 08 20:39:49 CST 2022 - Wed Nov 09 02:24:57 CST 2022

```

---

<div class="post-metadata">

**Author:** ![June\_Zhu](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@June\_Zhu](https://forum.inductiveautomation.com/u/June_Zhu)\
**Post date:** [March 2, 2023, 6:11am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/6 "2023-03-02T06:11:05Z")

</div>

> [@justinedwards.jle](#):
>
> ```auto
> print 'getAppContext : '+str(event.source.getAppContext())
> print 'getAutoColorList : '+str(event.source.getAutoColorList())
> print 'getAxes : '+str(event.source.getAxes())
> print 'getAxisLabelFont : '+str(event.source.getAxisLabelFont())
> print 'getAxisTickLabelFont : '+str(event.source.getAxisTickLabelFont())
> print 'getBarMargin : '+str(event.source.getBarMargin())
> print 'getBoxFill : '+str(event.source.getBoxFill())
> print 'getCalcPens : '+str(event.source.getCalcPens())
> print 'getChartBorder : '+str(event.source.getChartBorder())
> print 'getChartMode : '+str(event.source.getChartMode())
> print 'getCursorCode : '+str(event.source.getCursorCode())
> print 'getDatapoints : '+str(event.source.getDatapoints())
> print 'getDataQuality: '+str(event.source.getDataQuality())
> print 'getDateRange : '+str(event.source.getDateRange())
> print 'getDateRangeBorder : '+str(event.source.getDateRangeBorder())
> print 'getDateRangeLocation : '+str(event.source.getDateRangeLocation())
> print 'getDateStyle : '+str(event.source.getDateStyle())
> print 'getDigitalGap : '+str(event.source.getDigitalGap())
> print 'getEditorBackgroundColor : '+str(event.source.getEditorBackgroundColor())
> print 'getEditorForegroundColor : '+str(event.source.getEditorForegroundColor())
> print 'getEffectivePollRate: '+str(event.source.getEffectivePollRate())
> print 'getEmptyGroupName : '+str(event.source.getEmptyGroupName())
> print 'getEndDate : '+str(event.source.getEndDate())
> print 'getExtensionFunctions : '+str(event.source.getExtensionFunctions())
> print 'getGapThreshold : '+str(event.source.getGapThreshold())
> print 'getGlobalWhereClause : '+str(event.source.getGlobalWhereClause())
> print 'getGridlineColor : '+str(event.source.getGridlineColor())
> print 'getGridlineDashPattern : '+str(event.source.getGridlineDashPattern())
> print 'getGridlineWidth : '+str(event.source.getGridlineWidth())
> print 'getGroupWheres : '+str(event.source.getGroupWheres())
> print 'gethGap : '+str(event.source.gethGap())
> print 'getHGap : '+str(event.source.getHGap())
> print 'getHighDensityColor : '+str(event.source.getHighDensityColor())
> print 'getHistogramEndDate : '+str(event.source.getHistogramEndDate())
> print 'getHistogramStartDate : '+str(event.source.getHistogramStartDate())
> print 'getHorizontalResolution: '+str(event.source.getHorizontalResolution())
> print 'getLegend : '+str(event.source.getLegend())
> print 'getMaxSelectionSize : '+str(event.source.getMaxSelectionSize())
> print 'getOuterRangeEnd : '+str(event.source.getOuterRangeEnd())
> print 'getOuterRangeStart : '+str(event.source.getOuterRangeStart())
> print 'getPenBorder : '+str(event.source.getPenBorder())
> print 'getPenControlMode : '+str(event.source.getPenControlMode())
> print 'getPens : '+str(event.source.getPens())
> print 'getPlotBackground : '+str(event.source.getPlotBackground())
> print 'getPlotOrientation : '+str(event.source.getPlotOrientation())
> print 'getPlotOutlineColor : '+str(event.source.getPlotOutlineColor())
> print 'getPollRate : '+str(event.source.getPollRate())
> print 'getProperties : '+str(event.source.getProperties())
> print 'getPropertiesLoading : '+str(event.source.getPropertiesLoading())
> print 'getRtDateRange : '+str(event.source.getRtDateRange())
> print 'getRtLabel : '+str(event.source.getRtLabel())
> print 'getSelectedXValue : '+str(event.source.getSelectedXValue())
> print 'getSelectionHighlight : '+str(event.source.getSelectionHighlight())
> print 'getStartDate : '+str(event.source.getStartDate())
> print 'getStartupRange : '+str(event.source.getStartupRange())
> print 'getStartupSelection : '+str(event.source.getStartupSelection())
> print 'getSubplotGap : '+str(event.source.getSubplotGap())
> print 'getSubplots : '+str(event.source.getSubplots())
> print 'getTagHistoryAllowInterpolation : '+str(event.source.getTagHistoryAllowInterpolation())
> print 'getTagHistoryBypassCache : '+str(event.source.getTagHistoryBypassCache())
> print 'getTagHistoryIgnoreBadData : '+str(event.source.getTagHistoryIgnoreBadData())
> print 'getTagHistoryResolution : '+str(event.source.getTagHistoryResolution())
> print 'getTagHistoryResolutionMode : '+str(event.source.getTagHistoryResolutionMode())
> print 'getTagHistoryValidateScanclass : '+str(event.source.getTagHistoryValidateScanclass())
> print 'getTagPens : '+str(event.source.getTagPens())
> print 'getTickDensity : '+str(event.source.getTickDensity())
> print 'getTimeStyle : '+str(event.source.getTimeStyle())
> print 'getTitle : '+str(event.source.getTitle())
> print 'getTitleFont : '+str(event.source.getTitleFont())
> print 'getTodayIndicatorColor : '+str(event.source.getTodayIndicatorColor())
> print 'getToolTipText : '+str(event.source.getToolTipText())
> print 'getTrackMargin : '+str(event.source.getTrackMargin())
> print 'getUnit : '+str(event.source.getUnit())
> print 'getUnitCount : '+str(event.source.getUnitCount())
> print 'getUtilityButtonSize : '+str(event.source.getUtilityButtonSize())
> print 'getvGap : '+str(event.source.getvGap())
> print 'getVGap : '+str(event.source.getVGap())
> print 'getxAxisLabel : '+str(event.source.getxAxisLabel())
> print 'getXAxisLabel : '+str(event.source.getXAxisLabel())
> print 'getxAxisMargin : '+str(event.source.getxAxisMargin())
> print 'getXAxisMargin : '+str(event.source.getXAxisMargin())
> print 'getxOffset3D : '+str(event.source.getxOffset3D())
> print 'getXOffset3D : '+str(event.source.getXOffset3D())
> print 'getxTraceLargeNumberFormat : '+str(event.source.getxTraceLargeNumberFormat())
> print 'getXTraceLargeNumberFormat : '+str(event.source.getXTraceLargeNumberFormat())
> print 'getxTraceNumberFormatThreshold : '+str(event.source.getxTraceNumberFormatThreshold())
> print 'getXTraceNumberFormatThreshold : '+str(event.source.getXTraceNumberFormatThreshold())
> print 'getxTraceSmallNumberFormat : '+str(event.source.getxTraceSmallNumberFormat())
> print 'getXTraceSmallNumberFormat : '+str(event.source.getXTraceSmallNumberFormat())
> print 'getyOffset3D : '+str(event.source.getyOffset3D())
> print 'getYOffset3D : '+str(event.source.getYOffset3D())
> print 'getZoomedEndDate : '+str(event.source.getZoomedEndDate())
> print 'getZoomedStartDate : '+str(event.source.getZoomedStartDate())
> 
> ```

That is amazing!!! This really helps me a lots, very apprecite your helps!

---

<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:** [March 2, 2023, 1:20pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/7 "2023-03-02T13:20:57Z")

</div>

> [@justinedwards.jle](#):
>
> checked every method listed in the [PMIEasyChart documentation](https://files.inductiveautomation.com/sdk/javadoc/ignition784rc1/com/inductiveautomation/factorypmi/application/components/PMIEasyChart.html)

Probably want to fix your bookmarks to point to the v8.1.x javadocs instead of v7.8.

When exploring and you don't yet know where to look in the javadocs, you might find my [introspection script](https://www.automation-pros.com/ignition/inspect.py) helpful. (It has been around for a very long time.)

You can feed it pretty much any Ignition or java component or window or exotic object and it will point you in the right direction. You would do something like:

```auto
print inspect.introspect(chart)
print inspect.introspect(chart.subplots)

```

Et cetera. (Oh, lots of property shortcuts applicable to that cheat sheet code. Replacing getter/setter methods with the jython automatic property makes your code more efficient, and easier to read.)

---

<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:** [March 3, 2023, 1:18am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-x-and-y-axis-value-during-in-zoom-pan-mode-of-easy-chart/65693/8 "2023-03-03T01:18:18Z")

</div>

> [@pturmel](#):
>
> Probably want to fix your bookmark

Thanks, I have made the correction.  
,

> [@pturmel](#):
>
> [introspection script](https://www.automation-pros.com/ignition/inspect.py)

Double Thanks!  
,

> [@pturmel](#):
>
> lots of property shortcuts applicable to that cheat sheet code

I made that post quite some time ago. If I remember correctly, I copied all of the get methods out of the docs, dumped them into a spreadsheet and did some fill down formula magic to automatically generate the exploratory code. This is not something I do anymore. It's amazing the effect six months of developing solutions to novel forum problems has had on the way I approach problems. For example, here are a couple of the things that I have learned along the way:  
• ALWAYS resist the urge to script. Make a serious effort to find a built in solution first because often times there is one.  
• Use dir() and look for built in properties that can be used in place of methods because they are more efficient.  
• [...].getComponent(int) is unreliable for many components due to variations in the way a component can be configured. If a subcomponent must be obtained, use a recursive function to find it and return it.

This is my current cheat sheet for the base Easy Chart component:  
[Easy Chart\_Map.txt](https://forum.inductiveautomation.com/uploads/short-url/r2gHqGUdqrNgHGJVMFNyqihQNsC.txt) (1.3 MB)

It'll be interesting to see how I do things years from now when I've been doing this for as long as you! Thanks again Mr. Turmel for your continuous guidance and instruction. It is genuinely appreciated.
