# Ign 8.0 Vision Bar chart changing query sequence order for hour by hour

**URL:** <https://forum.inductiveautomation.com/t/ign-8-0-vision-bar-chart-changing-query-sequence-order-for-hour-by-hour/35919>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [June 23, 2020, 3:09pm UTC](https://forum.inductiveautomation.com/t/ign-8-0-vision-bar-chart-changing-query-sequence-order-for-hour-by-hour/35919 "2020-06-23T15:09:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mason.Younger](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Mason.Younger](https://forum.inductiveautomation.com/u/Mason.Younger)\
**Post date:** [June 23, 2020, 3:09pm UTC](https://forum.inductiveautomation.com/t/ign-8-0-vision-bar-chart-changing-query-sequence-order-for-hour-by-hour/35919/1 "2020-06-23T15:09:42Z")

</div>

I’m trying to show a bar chart hour by hour, I’m using a named query ordered by t\_stamp. When looking at the order, everything is correct, but when the chart is rendered the order is changed.

How can I fix this? The right side of the chart should show the most recent hour ‘10’ but is showing 22?  
Running the Query in SQL the results are in the correct aces order.

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

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

---

<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:** [June 23, 2020, 3:16pm UTC](https://forum.inductiveautomation.com/t/ign-8-0-vision-bar-chart-changing-query-sequence-order-for-hour-by-hour/35919/2 "2020-06-23T15:16:22Z")

</div>

Try returning the hours column as strings, rather than numeric values - the chart is auto-sorting them for rendering.

---

<div class="post-metadata">

**Author:** ![Mason.Younger](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Mason.Younger](https://forum.inductiveautomation.com/u/Mason.Younger)\
**Post date:** [June 23, 2020, 4:32pm UTC](https://forum.inductiveautomation.com/t/ign-8-0-vision-bar-chart-changing-query-sequence-order-for-hour-by-hour/35919/3 "2020-06-23T16:32:01Z")

</div>

This should return a string, but the same thing happens on the bar chart.

Select concat(‘H-’,datepart(hour,dt)) as hour, hbh from #tmp order by dt

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/e/fed4e3e987cc34cf152c618840e3df0c591bca47.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/f/5fe589bff7b118cec9275a2784c3ec49dc72edb7.png)
