# XY chart binding & customize

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612>\
**Category:** Ignition\
**Tags:** perspective, ignition83\
**Created:** [May 20, 2026, 3:44am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612 "2026-05-20T03:44:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonilham307](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@antonilham307](https://forum.inductiveautomation.com/u/antonilham307)\
**Post date:** [May 20, 2026, 3:44am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/1 "2026-05-20T03:44:25Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e62c6644e6bb57567bb0ba70335c6056bb5ede9a.png)

I'm trying to create a bar chart with an xy chart, the problem is that I want to create a category for each machine with data from the historian tag where the data is kWh which continues to increase in value without resetting. 1 bar represents 1 month of kWh usage so the data is kWh now-kwh prev, is it possible?, I'm still new to ignition

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 20, 2026, 7:08am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/2 "2026-05-20T07:08:20Z")

</div>

You may want something like this

> [@Project screenshots - share yours](https://forum.inductiveautomation.com/t/project-screenshots-share-yours/513/277):
>
> Thanks, i did that using a XY chart on render line mode using two different datasource for each year with 2 different series you can customize, once you have different seriex you create different xAxes and yAxes for each of them . Is important also to calculate the range minimum and maximum ob both charts, First calculate the maximum and minimum of each chart so later you calculate the max and min of both. This way you can overlap as many charts ad yo…

you have to play with the datasources ans series to get familiar with the xy charts for multiple values

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 20, 2026, 10:49am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/3 "2026-05-20T10:49:50Z")

</div>

The main thing is to get your data into the right format - with the SQL query if possible. Where's the data coming from and what database engine are you using?

---

<div class="post-metadata">

**Author:** ![antonilham307](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@antonilham307](https://forum.inductiveautomation.com/u/antonilham307)\
**Post date:** [May 21, 2026, 2:03am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/4 "2026-05-21T02:03:01Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/c/2ca4db81d6be0abf58644986dbf76f3b37a81c75.png)

I want to create an output like this: the data comes from historical tags. I'm using SSMS. The tag's value keeps increasing without resetting, so I want to know the monthly increase.

What binding type is recommended? And how do I implement it?

---

<div class="post-metadata">

**Author:** ![antonilham307](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@antonilham307](https://forum.inductiveautomation.com/u/antonilham307)\
**Post date:** [May 21, 2026, 2:16am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/5 "2026-05-21T02:16:18Z")

</div>

Thank you, that helps, but I've encountered a new problem: if the series is in bar format, and for example, I have three series and three data sources, the bar charts don't appear simultaneously but one by one.

One solution I found was to make the data look like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/c/2ca4db81d6be0abf58644986dbf76f3b37a81c75.png)

And I found a new problem. how to make the data like that. I used data from the historian tag where the value continues to increase, so I had to do data retrieval like last month = end of last month - beginning of last month

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 21, 2026, 5:52am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/6 "2026-05-21T05:52:53Z")

</div>

For that you shoule prepare your data before showing it, with a transform script in jython for example. You bind the data to a custom property custom.dataretrieval then inside you do the operation last month = end of last month - beginning of last mont , then you bind the output to the serie you want it into.

```python
from java.util import Calendar

# End of last month
end = Calendar.getInstance()
end.set(Calendar.DAY_OF_MONTH, 1)
end.add(Calendar.DAY_OF_MONTH, -1)

# Beginning of last month
start = Calendar.getInstance()
start.set(Calendar.DAY_OF_MONTH, 1)
start.add(Calendar.MONTH, -1)

# Optional: normalize times
start.set(Calendar.HOUR_OF_DAY, 0)
start.set(Calendar.MINUTE, 0)
start.set(Calendar.SECOND, 0)

end.set(Calendar.HOUR_OF_DAY, 23)
end.set(Calendar.MINUTE, 59)
end.set(Calendar.SECOND, 59)

print start.getTime()
print end.getTime()

```

or the code that may suit you

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 21, 2026, 7:06pm UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/7 "2026-05-21T19:06:47Z")

</div>

Alejandro, why are you recommending a Java library when Ignition scripting has a pretty full set of [system.date | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-date) functions which will be more efficient?

---

<div class="post-metadata">

**Author:** ![antonilham307](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@antonilham307](https://forum.inductiveautomation.com/u/antonilham307)\
**Post date:** [June 15, 2026, 8:16am UTC](https://forum.inductiveautomation.com/t/xy-chart-binding-customize/115612/8 "2026-06-15T08:16:08Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/d/cd34f1b2de9eb1184d2a118a037f1b548e5e18f1.png)

Update: It turns out the query binding method is more useful, just a few adjustments needed. The downside is that I need to know the tag ID I want to query by looking at the dbo.sqlth\_te table.

Thanks, @Alejandro_Alaco and @Transistor for your help in solving this.
