# Ignition - Graph mode selector / JFreeChart

**URL:** <https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219>\
**Category:** Module Development\
**Tags:** ignition81, vision\
**Created:** [April 2, 2024, 12:55pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219 "2024-04-02T12:55:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [April 2, 2024, 12:55pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/1 "2024-04-02T12:55:42Z")

</div>

Hi all,

I am starting develop some addons apps and modules for Ignition and was wondering if anyone could offer advise regarding JFreeChart.

With the Chart components in Ignition we have a mode switch, with different options - the main one I am interest in is X-Trace:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1ff2d0f2fadeba5daa650c78f1a15bed2fd65724.png)

But when creating a default test graphs in JFreeChart, the same is not available, I am unsure if this is part of the JFreeChart component or if it is added on by IA. I can't find source code for the Ignition Chart components, so I assume it is not shared.

I wanted to replicate the XTrace feature in a Java Swing test app, before going further with my projects. See swing test app below (using TimeSeriesChart):

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37eb35b7f5c43835cba498c9ef829f9fa7030cf4.png)

Any advice on how this can be accomplished, whether it is built into JFreeChart (and i have missed the documentation) and any other comments are appreciated.

Many thanks,

MG

---

<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:** [April 2, 2024, 3:11pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/2 "2024-04-02T15:11:19Z")

</div>

In XTrace mode we're (essentially) just adding a bunch of `org.jfree.chart.annotations.XYTextAnnotation` markers (really fast) whenever the mouse position changes.

@pturmel may also have some advice, possibly free or possibly not, given his NoteChart module.

---

<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:** [April 2, 2024, 3:41pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/3 "2024-04-02T15:41:10Z")

</div>

I completely rewrote X-Trace for my NoteChart module (because the IA implementation was too lame for my needs).

You would need to use reflection and access overrides to get at the mode switch current state.

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [April 2, 2024, 4:25pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/4 "2024-04-02T16:25:27Z")

</div>

In that case are you able to recommend a better way of implementing. I have only just started using JFreeChart, so I am a little new. Any help or recommendations for modules is appreciated.

---

<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:** [April 2, 2024, 4:33pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/5 "2024-04-02T16:33:09Z")

</div>

Not really. My "secret sauce" would not stay secret if I show you how to do this. (FWIW, I did **not** reimplement the menu.)

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [April 2, 2024, 10:04pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/6 "2024-04-02T22:04:23Z")

</div>

Ah no worries completely understandable, I don't need anything special so I will try have a look at the .XYTextAnnotation markers that Paul mentioned. Thanks!

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [April 10, 2024, 12:00pm UTC](https://forum.inductiveautomation.com/t/ignition-graph-mode-selector-jfreechart/88219/7 "2024-04-10T12:00:46Z")

</div>

Hi Paul,

any chance you can expand on this by providing an example?

Cheers
