# Chart Component select X-trace mode as defualy

**URL:** <https://forum.inductiveautomation.com/t/chart-component-select-x-trace-mode-as-defualy/15011>\
**Category:** Ignition\
**Created:** [August 8, 2017, 1:42pm UTC](https://forum.inductiveautomation.com/t/chart-component-select-x-trace-mode-as-defualy/15011 "2017-08-08T13:42:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanko26](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@vanko26](https://forum.inductiveautomation.com/u/vanko26)\
**Post date:** [August 8, 2017, 1:42pm UTC](https://forum.inductiveautomation.com/t/chart-component-select-x-trace-mode-as-defualy/15011/1 "2017-08-08T13:42:56Z")

</div>

Hi all,  
Is there a way through scripting to select the X-trace mode of a chart on opening of a window? Thanks in advance!

---

<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:** [August 8, 2017, 4:07pm UTC](https://forum.inductiveautomation.com/t/chart-component-select-x-trace-mode-as-defualy/15011/2 "2017-08-08T16:07:30Z")

</div>

In scripting, go to the `configureChart` extension function, and enter this code:  
`self.setMode(4)`

- 0 : Zoom Mode. This is the default mode, where the user can draw a zoom rectangle with the mouse pointer.
- 1 : Pan Mode. This mode lets the user use the mouse pointer to pan the chart to the left and right.
- 3 : Mark mode. This mode lets the user click near a datapoint to annotate the point with its X and Y value.
- 4 : X-Trace mode. This mode lets the user click and drag on the chart to see all values that fall along that X value.

---

<div class="post-metadata">

**Author:** ![vanko26](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@vanko26](https://forum.inductiveautomation.com/u/vanko26)\
**Post date:** [August 8, 2017, 7:09pm UTC](https://forum.inductiveautomation.com/t/chart-component-select-x-trace-mode-as-defualy/15011/3 "2017-08-08T19:09:00Z")

</div>

> [@paul-griffith](#):
>
> self.setMode(4)

Thanks Paul!  
It worked as a dream!
