# Re-sorting XY chart if query parameters update

**URL:** <https://forum.inductiveautomation.com/t/re-sorting-xy-chart-if-query-parameters-update/80226>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [October 9, 2023, 7:08pm UTC](https://forum.inductiveautomation.com/t/re-sorting-xy-chart-if-query-parameters-update/80226 "2023-10-09T19:08:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DCross](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@DCross](https://forum.inductiveautomation.com/u/DCross)\
**Post date:** [October 9, 2023, 7:08pm UTC](https://forum.inductiveautomation.com/t/re-sorting-xy-chart-if-query-parameters-update/80226/1 "2023-10-09T19:08:41Z")

</div>

Hello everyone!

I have an XY chart component I modified into a downtime pareto chart for our production team to use on a dashboard. By default, the graph shows the downtime root causes in descending order of duration across all manufacturing shifts:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a840590d24027f4d239f86f9dd9fe58847489c4e.png)

I got some feedback from the production team that they would like to have the ability to filter by shift (see only results from 1st shift, 2nd shift, etc.), so I added in a dropdown selector and updated the named query to take in the shift as an argument. When I test this solution in the Named Query section of the Designer software, it works exactly as intended.

However, I am having issues when I use the dropdown in a Perspective session. The data itself updates, but the X axis still uses the sorting order from the original query and it looks like a mess:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89742c3f07a52750add88caad1cae99258664ab2.png)

I tried using the .refreshBinding() method when the dropdown selection changes, and also tried changing the dataSource binding from a property binding to a query binding that polls every 5 seconds. Neither option worked, and I need to roll out similar changes to other graphs so I would like to find the "best practice" way of doing this...

What is the best way to "refresh" the X axis sort order?

Thanks in advance!

---

<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:** [October 9, 2023, 8:38pm UTC](https://forum.inductiveautomation.com/t/re-sorting-xy-chart-if-query-parameters-update/80226/2 "2023-10-09T20:38:48Z")

</div>

Can you post the chart JSON and the alternate datasets for us to experiment with? (You might need to remove the binding so that we don't just get a binding rather than the dataset.) Format it correctly using the \</\> button and, if you want to be cool, select it all and use the gear icon | Hide Details to make them collapsible.

---

<div class="post-metadata">

**Author:** ![DCross](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@DCross](https://forum.inductiveautomation.com/u/DCross)\
**Post date:** [October 11, 2023, 7:30pm UTC](https://forum.inductiveautomation.com/t/re-sorting-xy-chart-if-query-parameters-update/80226/3 "2023-10-11T19:30:06Z")

</div>

Resolved, documenting for others who may see a similar issue.

I had a second datasource that I was using to generate the 80% line (the dashed red line in the screenshots). That particular datasource was overriding the X-axis columns; I updated the named query for that datasource to match the one generating the bar graph and it immediately fixed the issue.

---

<div class="post-metadata">

**Author:** ![GOKULAKANNAN\_P](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@GOKULAKANNAN\_P](https://forum.inductiveautomation.com/u/GOKULAKANNAN_P)\
**Post date:** [November 8, 2024, 5:03am UTC](https://forum.inductiveautomation.com/t/re-sorting-xy-chart-if-query-parameters-update/80226/4 "2024-11-08T05:03:39Z")

</div>

Hello @DCross ,

I'm trying to replicate your Similar Downtime Pareto Chart. Could you provide the chart JSON as a reference?

Thanks!
