# APEX Chart Slowness in DATA

**URL:** <https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676>\
**Category:** General Discussion\
**Created:** [January 31, 2025, 2:39pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676 "2025-01-31T14:39:16Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind\_Babu\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Arvind\_Babu\_K](https://forum.inductiveautomation.com/u/Arvind_Babu_K)\
**Post date:** [January 31, 2025, 2:39pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/1 "2025-01-31T14:39:16Z")

</div>

Hi Team,

We are currently using the **Apex Stacked Chart** for our dashboard view, but we have observed significant delays in data rendering. For example, when executing the named query directly, it runs in milliseconds. However, when linked to the Apex chart, it takes around **10 seconds** for the data to appear.

Additionally, when we link the Apex chart data with a table, we notice performance issues affecting both components. However, when tested separately (writing data to a table vs. appending it to the Apex chart), the dataset retrieval from the database occurs instantly, suggesting that the delay is primarily due to chart rendering.

### **Looking for Solutions:**

1. **Optimizing Data Processing** – Is there a way to speed up data handling before passing it to the Apex chart?
2. **Alternative Charting Options** – Are there other chart libraries that integrate well with Ignition and perform better?
3. **Ignition Built-in Charts** – Would it be feasible to replace Apex charts with Ignition’s inbuilt chart components for improved performance?

Any suggestions or recommendations to enhance chart responsiveness would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![jalal.a](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jalal.a](https://forum.inductiveautomation.com/u/jalal.a)\
**Post date:** [January 31, 2025, 2:49pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/2 "2025-01-31T14:49:36Z")

</div>

In our project, we have observed the same issue. If data processing is handled through Ignition’s built-in model, it is expected to be fast. However, we suspect this could be contributing to data slowness. We have also noticed similar slowdowns when using Sepasoft’s MES model, indicating that it might be a broader issue with data handling.

I believe this is the right time for Ignition to develop a built-in model to address this pain point effectively and structure it properly for optimal performance.

---

<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:** [January 31, 2025, 3:04pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/3 "2025-01-31T15:04:32Z")

</div>

> [@Arvind\_Babu\_K](#):
>
> speed up data handling before passing it to the Apex chart?

I created a large collection of expression functions that allow you to make complex data manipulations without the overhead of scripts. While not using Apex Stacked charts, my Tag Report Utility includes high-performance use of Apex charts with high-density historian data. (The speed contrast with IA's native TS chart is astonishing.)

> [@Tag Report Utility](https://forum.inductiveautomation.com/t/tag-report-utility/95299):
>
> New resource just uploaded to the Exchange (pending review). Also available here: [https://www.automation-pros.com/TagReportUtility/](https://www.automation-pros.com/TagReportUtility/) I intend to publish at this link as well as in the Exchange going forward. Announcements will be in this topic. (: Highlights: Provides a Perspective Popup View that provides a user interface to system.tag.query() that entirely replicates the functionality of the Designer's Tag Report Tool. Provides a Perspective Embedded View that provides Time Span selectio…

---

<div class="post-metadata">

**Author:** ![Arvind\_Babu\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Arvind\_Babu\_K](https://forum.inductiveautomation.com/u/Arvind_Babu_K)\
**Post date:** [January 31, 2025, 5:58pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/4 "2025-01-31T17:58:52Z")

</div>

Hi Pturmel, I saw your project—it's really insightful! However, I need this data in a stacked chart format.

---

<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:** [January 31, 2025, 6:11pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/5 "2025-01-31T18:11:55Z")

</div>

I haven't had to use the Apex stacked chart format, but the techniques should be similar.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 31, 2025, 6:22pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/6 "2025-01-31T18:22:22Z")

</div>

How are you doing the bindings for the series?  
I have found that it greatly helps the stacked bar rendering when I do a single query on series[0].data and then use a transform on that to build out the other series

---

<div class="post-metadata">

**Author:** ![Arvind\_Babu\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Arvind\_Babu\_K](https://forum.inductiveautomation.com/u/Arvind_Babu_K)\
**Post date:** [January 31, 2025, 6:39pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/7 "2025-01-31T18:39:44Z")

</div>

HI @MMaynard, i to bind the data in series the result after append the data, The data series binds directly to the SQL query it works fine, but performance is significantly slower when using the dropdown box with if condition on it

---

<div class="post-metadata">

**Author:** ![Arvind\_Babu\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Arvind\_Babu\_K](https://forum.inductiveautomation.com/u/Arvind_Babu_K)\
**Post date:** [January 31, 2025, 6:46pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/8 "2025-01-31T18:46:09Z")

</div>

Hi @pturmel, I understand your point, but I'm experiencing slowness even when following similar techniques. The key issue is that it works fine when directly connected to the Apex chart without any Ignition objects, but performance slows down significantly when linked to the dropdown box.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 31, 2025, 6:47pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/9 "2025-01-31T18:47:17Z")

</div>

Can you show your queries and how you are filtering with the dropdown?  
It sounds like you might be lacking some indexes on the tables if it slows down after applying a filter.

---

<div class="post-metadata">

**Author:** ![Arvind\_Babu\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Arvind\_Babu\_K](https://forum.inductiveautomation.com/u/Arvind_Babu_K)\
**Post date:** [January 31, 2025, 6:59pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/10 "2025-01-31T18:59:17Z")

</div>

This Script is written in on action performed in dropdown function

'''DropDownvalue = self.props.value  
parameter = {'Start\_Date': self.getSibling("DateTimeInput").props.value, 'End\_Date': self.getSibling("DateTimeInput\_0").props.value}  
if DropDownvalue == 1:  
DataSet = system.db.runNamedQuery('Apex\_Chart\_E\_D/Operation data \_TotalCount1', parameter)

elif DropDownvalue == 2:  
DataSet = system.db.runNamedQuery('Apex\_Chart\_E\_D/Operation data \_TotalCount2', parameter)

elif DropDownvalue == 3:  
DataSet = system.db.runNamedQuery('Apex\_Chart\_E\_D/Operation data \_TotalCount3', parameter)

self.getSibling("Table").props.data = DataSet  
data\_dict = {  
"AB": {"data": , "name": "AB","type":"bar"},  
"CD": {"data": , "name": "CD","type":"bar"},  
"QR": {"data": , "name": "QR","type":"bar"},  
"TE": {"data": , "name": "TE,"type":"bar"},  
"Target": {"data": , "name": "YE","type":"line"}  
}

# Iterate through the dataset and populate the data\_dict with values

for row in range(DataSet.getRowCount()):  
data\_dict["AB"]["data"].append(DataSet.getValueAt(row, 'AB\_count'))  
data\_dict["CD"]["data"].append(DataSet.getValueAt(row, 'CD\_count'))  
data\_dict["QR"]["data"].append(DataSet.getValueAt(row, 'QR\_count'))  
data\_dict["TE"]["data"].append(DataSet.getValueAt(row, 'TE\_count'))  
data\_dict["Target"]["data"].append(100)

# Create the result list ensuring the order is AB, CD, QR, TE

result = [  
data\_dict["AB"],  
data\_dict["CD"],  
data\_dict["QR"],  
data\_dict["TE"],  
data\_dict["Target"]  
]  
dates\_list =   
for row in range(DataSet.getRowCount()):  
date\_value = DataSet.getValueAt(row, 'Date')  
formatted\_date = system.date.format(date\_value, 'dd/MM')  
dates\_list.append(formatted\_date)  
result1 = [date for date in dates\_list]  
self.getSibling("apexchart").props.options.xaxis.categories = result1  
self.getSibling("apexchart").props.series = result'''

---

<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:** [January 31, 2025, 7:28pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/11 "2025-01-31T19:28:10Z")

</div>

Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831). Then hit the pencil icon / edit button below your question to fix it. Thanks.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 31, 2025, 7:53pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/12 "2025-01-31T19:53:21Z")

</div>

I do it slightly different, my query is using unions to gather the data for the bars  
I have this binding on the data of series one, script transform.Where value is bound to the query.  
I then write directly to the series properties on the chart.

```python
> 
> def transform(self, value, quality, timestamp):
> ds7 = []
> ds30 = []
> ds90 = []
> cds = []
> pds = system.dataset.toPyDataSet(value)
> for row in pds:
> if row[0]=='7':
> rcol = "#095E22"
> ds7.append({"x":str(row[1]),"y":round(row[2],1),"fillColor":rcol,"strokeColor":rcol})
> if row[0]=='30':
> rcol = "#75B108"
> ds30.append({"x":str(row[1]),"y":round(row[2],1),"fillColor":rcol,"strokeColor":rcol})
> if row[0]=='90':
> rcol = "#00FF0A"
> ds90.append({"x":str(row[1]),"y":round(row[2],1),"fillColor":rcol,"strokeColor":rcol})
> if str(row[1]) not in cds:
> cds.append(str(row[1]))
> self.props.series[1].data=ds30
> self.props.series[2].data=ds90
> self.props.options.xaxis.categories=cds
> return ds7

```

---

<div class="post-metadata">

**Author:** ![Arvind\_Babu\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@Arvind\_Babu\_K](https://forum.inductiveautomation.com/u/Arvind_Babu_K)\
**Post date:** [February 4, 2025, 6:26am UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/13 "2025-02-04T06:26:47Z")

</div>

Hi @MMaynard, thanks for your script. Unfortunately, I haven't seen any improvement in the chart performance. I reached out to Ignition support, and they were a bit surprised that it was functioning correctly without any components. However, when I connect it to a dropdown or button, it takes significantly longer to respond. i am waiting for the their solution regarding this once i get it i will update you

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 4, 2025, 12:59pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/14 "2025-02-04T12:59:54Z")

</div>

I would be looking at the database design then, do you have indexes on the fields you are using for filter parameters?

---

<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:** [February 4, 2025, 2:33pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/15 "2025-02-04T14:33:14Z")

</div>

Please fix the formatting on your script in post #9 as requested in post #11. We'll help you but you need to put some effort in on the forum.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 4, 2025, 6:57pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/16 "2025-02-04T18:57:18Z")

</div>

I think he tried to, but used single quotes instead of backticks ( ``` )

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 4, 2025, 8:39pm UTC](https://forum.inductiveautomation.com/t/apex-chart-slowness-in-data/101676/17 "2025-02-04T20:39:04Z")

</div>

A bit of optimizing can be done here, although I'm not a fan of hitting the database upon a change in the dropdown selection.

```python
DropDownvalue = self.props.value
parameter = {'Start_Date': self.getSibling("DateTimeInput").props.value, 'End_Date': self.getSibling("DateTimeInput_0").props.value}

DataSet = system.db.runNamedQuery('Apex_Chart_E_D/Operation data _TotalCount{}'.format(DropDownValue), parameter)

result = [
          {"name": "AB", "type": "bar"},
          {"name": "CD", "type": "bar"},
          {"name": "QR", "type": "bar"},
          {"name": "TE", "type": "bar"},
         ]

# Add data for each result.
for row in result:
	row["data"] = DataSet.getColumnAsList(DataSet.getColumnIndex('{}_count'.format(row['name']))

# Add Target line
result.append({"data": [100]*DataSet.rowCount, "name": "YE", "type": "line"})

# Create date categories
date_values = DataSet.getgetColumnAsList(DataSet.getColumnIndex('Date'))
dates_list = [system.date.format(date, 'dd/MM') for date in date_values] 
					 
self.getSibling("apexchart").props.options.xaxis.categories = date_list
self.getSibling("apexchart").props.series = result

```
