# Changing the Axis Through Scripting

**URL:** <https://forum.inductiveautomation.com/t/changing-the-axis-through-scripting/56413>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [February 22, 2022, 4:07pm UTC](https://forum.inductiveautomation.com/t/changing-the-axis-through-scripting/56413 "2022-02-22T16:07:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Diaz](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@Jose\_Diaz](https://forum.inductiveautomation.com/u/Jose_Diaz)\
**Post date:** [February 22, 2022, 4:07pm UTC](https://forum.inductiveautomation.com/t/changing-the-axis-through-scripting/56413/1 "2022-02-22T16:07:02Z")

</div>

Hey y’all!

 ![multitrend_axis](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a3ebdb53771e4c6832d6a52525561d2ccedcd662.jpeg)

So I was put into a project that currently has these pens that are coming from a database. Although the Labels for each of the tags are given an an axis, specified by their SI Units, the y-axis are not set by the SI Units but rather the tags. So whenever I select/deselect the checkbox, their trend line goes away/reappears. What I wanted to do was instead of adding/removing the specific tag, I wanted to select/deselect which SI units I wanted to appear/disappear. Is there a way for me to set or change the axis for the tags through Scripting? If so, may someone point me into the right direction? I would gratefully appreciate it. Thank you!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 22, 2022, 4:19pm UTC](https://forum.inductiveautomation.com/t/changing-the-axis-through-scripting/56413/2 "2022-02-22T16:19:05Z")

</div>

There is a way to do it, though I'll say it is much easier to achieve with the standard chart component, but possible with the easy chart.

It is not trivial with the standard chart component, particularly if you've never dug around in the JFree Chart API. Utilizing the Easy chart is possible but you will continually run into road blocks particularly in this case where you want to respond to a check box being selected. You will need to add your own check box components outside of the easy chart, for this to work at all, as you cant change the function of the check boxes included with the component.

This thread goes through a solution to a different issue, but details changing the axis of the chart.

> [@Prevent Easy Chart Plot from Moving](https://forum.inductiveautomation.com/t/prevent-easy-chart-plot-from-moving/46289/4):
>
> So the simplest way to achieve this is to use the Standard Chart Components Chart Customizer. Add an additional Dataset Add an additional X-Axis Configure the Axis Location to be on the TOP Add an additional Y-Axis Configure the Axis Location to be on the Right Assign the X and Y axis to the dataset in the Dataset Properties Tab Once you’ve done this all you need to do is generate the two datasets of data and assign them. The new dataset will appear as a custom property on the chart com…

---

<div class="post-metadata">

**Author:** ![Jose\_Diaz](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@Jose\_Diaz](https://forum.inductiveautomation.com/u/Jose_Diaz)\
**Post date:** [February 22, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/changing-the-axis-through-scripting/56413/3 "2022-02-22T16:45:38Z")

</div>

I may need to take the second approach because I am not able to switch the type of chart, unfortunately. But your link does bring up an idea, so thank you so much for responding!
