Hi,
I have successfully created a stacked column graph following the instructions here:
https://docs.nocobase.com/handbook/data-visualization/antd-charts/column
However, the stacks are randomly stacked instead of each series maintaining its position in the stack as expected.
Any help appreciated,
Kevin
Sort the data by time and category, and check if the problem has been resolved.
Hi!
I have tested a few things and ran the equivalent SQL queries directly on the database. The problem with the ordering of the stack is that it is sorting on the timestamp and not the column range (i.e. that month). The graph shows one column per month because the “created” column is formatted as “YYYY-MM” , but the sorting is still done on the original timestamp value. I can illustrate the problem using SQL (with dummy column names). The expected behaviour is:
SELECT
xfield,
created,
to_char(created, ‘YYYY-MM’) AS created_month,
series_field
FROM table1
ORDER BY created_month, series_field ASC
but the actual behaviour is
SELECT
xfield,
created,
to_char(created, ‘YYYY-MM’) AS created_month,
series_field
FROM table1
ORDER BY created, series_field ASC
Technically the UI is doing what it says which is sorting on “created”, but the expected behaviour is that it sorts on formatted value. Otherwise the graph is not very usable.

After sorting by time, add sorting by category, setting two sorting methods, and check if the problem is resolved.
I meant to say that I had also tested that and it made no difference to the result.
Please set both time and category sorting on the chart. After it runs successfully, please send me a screenshot.
I attach a screenshot with the additional sorting which has no effect. I can also confirm that the sorting is the same as using SQL to sort by “created” rather than “created_month”.
What is the version number of NocoBase?
From the CHANGELOG.md file it says v1.9.17.
Please upgrade to the latest version and check if the problem persists.
Sorry, I was looking at the code base. I am running Nocobase using the docker-compose.yml file which pulls “nocobase/nocobase:latest-full”. However, I cannot see any version information in the container.
The version number can be viewed in the upper right corner of the NocoBase application in the browser.
OK, I pulled down the latest image and it booted up with version v1.9.23. I reran the query in the chart. Same problem.