# Dashboard-2: bar chart x-axis data order

**URL:** <https://discourse.nodered.org/t/dashboard-2-bar-chart-x-axis-data-order/100832>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [23 April 2026 18:38 UTC](https://discourse.nodered.org/t/dashboard-2-bar-chart-x-axis-data-order/100832 "2026-04-23T18:38:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhl](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@mhl](https://discourse.nodered.org/u/mhl)\
**Post date:** [23 April 2026 18:38 UTC](https://discourse.nodered.org/t/dashboard-2-bar-chart-x-axis-data-order/100832/1 "2026-04-23T18:38:04Z")

</div>

I have bar chart using "categorical" x-axis type and group-by "stacks". I use a function to pre-sort the data in the order that I want it to appear on the x-axis. This worked fine in dashboard-1, but not in dashboard-2: the x-axis values are not showing in the order I provide.

I have verified the data being passed into the chart node, and it is in the order I want -- but the chart is not using that order.

Here's the chart configuration:

 ![Screenshot 2026-04-23 at 11.28.56 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1fa12be75ef098d5103e8d324acb547ec13f734d.png)

The last few entries in the chart input, taken from node-red's debug output:

```auto
100: object
101: object
102: object
    type: "person"
    date: "2026-04-23T18:00:00.000Z"
    count: 17
    hour: "Thu 11:00 AM"
103: object
    type: "car"
    date: "2026-04-23T18:00:00.000Z"
    count: 6
    hour: "Thu 11:00 AM"
104: object
    type: "dog"
    date: "2026-04-23T18:00:00.000Z"
    count: 2
    hour: "Thu 11:00 AM"

```

And the chart itself - notice how the last few x-axis values do not match the input:

 ![Screenshot 2026-04-23 at 11.35.02 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c378d7ecc41a0a5e9eb04729aee4ecfc4b6c409.png)

A colleague has discovered that we can force the chart to display in the expected order by providing dummy 0-value entries for any "missing" y-values for each x-value. Why should that be needed?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 May 2026 18:38 UTC](https://discourse.nodered.org/t/dashboard-2-bar-chart-x-axis-data-order/100832/2 "2026-05-23T18:38:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
