evidence
evidence copied to clipboard
Documented sort default is not applied
Steps To Reproduce
Sample data: sample-data.csv
SQL:
select run, coalesce(failure, kind, cast(level as varchar)) as category, round(sum(duration) / 1000) as duration
from tasks
where duration > 0
group by run, category
order by run, category
Environment
- Node version (
node -v): 20.11.0 - npm version (
npm -v): 10.2.4 - OS: macOS 14.2.1 (23C71)
- Browser: Chrome 120.0.6099.216 (Official Build) (arm64).
- Database: DuckDB
Expected Behavior
The order of categories on the X-axis doesn't match the data order.
17 (1), 17 (2), 17 (3), 21 (1), 21 (2), 21 (3)
Actual Behaviour
21 (3), 21 (2), 21 (1), 17 (3), 17 (2), 17 (1)
Workarounds
I am sure I can find a workaround using the ECharts custom options :) Thanks for using this library.
By default series are ordered by size on the y axis. If you want to disable this behaviour, use
<BarChart
...
sort=false
/>
If you want to disable this behaviour, use
It is false by default, according to docs :)
Also, if the documentation is incorrect and true is the default, I would consider it an unusual default. Metabase uses data order, which is also the expected behavior. In my case, run represents a scenario name (with a suffix such as (N)). Consequently, I expect all my charts to maintain a consistent order that aligns with the data domain.
You are correct that the sort is true by default, and the docs are wrong.
I would consider it an unusual default
Thanks for this feedback, and I do agree - I think we have gone back and forth on this a bit
- https://github.com/evidence-dev/evidence/pull/542
- https://github.com/evidence-dev/evidence/issues/1134
I think it's slightly difficult to find a default that works as expected in all cases