# Easy Chart pan/zoom commands

**URL:** <https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831>\
**Category:** General Discussion\
**Created:** [November 26, 2015, 11:41am UTC](https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831 "2015-11-26T11:41:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [November 26, 2015, 11:41am UTC](https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831/1 "2015-11-26T11:41:25Z")

</div>

Hi,  
I would like to hide the context menu of my Easy Chart component,  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5b42534aa9520f56ba78a22f47c0579e0d046678.jpg)  
  
but let the user enable/disable the zoom, pan, mark functions from buttons of my own. I let me print the methods of the EasyChart component in a python script, but I couldn’t find in there any method whose name hints to what I need.

Any help?

Thanks in advance,  
regards

---

<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:** [November 26, 2015, 3:27pm UTC](https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831/2 "2015-11-26T15:27:39Z")

</div>

EasyChart has a setMode(m) method that drives that behavior. Unfortunately, there’s no corresponding getMode() function to obtain the current state. Which you need to draw the radio buttons correctly, and otherwise adjust your GUI to interact with the chart. This annoyed me enough to include getMode() in the [NoteChart and EasyNoteChart components](https://inductiveautomation.com/forum/viewtopic.php?f=89&t=13874), for this same reason.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [November 26, 2015, 3:35pm UTC](https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831/3 "2015-11-26T15:35:06Z")

</div>

> [@pturmel](#):
>
> EasyChart has a setMode(m) method that drives that behavior.

Thanks pturmel. Is there any documentation about the codes needed by the setMode method to change the chart behaviour?

---

<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:** [November 26, 2015, 6:04pm UTC](https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831/4 "2015-11-26T18:04:41Z")

</div>

[quote=“pgmo”]Is there any documentation about the codes needed by the setMode method to change the chart behaviour?[/quote]Not documented that I can find. Can be introspected from com.inductiveautomation.factorypmi.application.components.chart.PMILineChartPanel.  
[ul][li]MODE\_ZOOM = 0[/li]  
[li]MODE\_PAN = 1[/li]  
[li]MODE\_MARK = 3[/li]  
[li]MODE\_XTRACE = 4[/li][/ul]

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [November 27, 2015, 9:15am UTC](https://forum.inductiveautomation.com/t/easy-chart-pan-zoom-commands/10831/5 "2015-11-27T09:15:10Z")

</div>

Ok, thank you so much pturmel.
