kurkle / chartjs-chart-treemap

Chart.js module for creating treemap charts
MIT License
137 stars 34 forks source link

add unsorted option #238

Closed ogom closed 1 week ago

ogom commented 2 months ago

Treemap is a visually easy-to-understand chart based on area. We want to rendering charts that are not sorted by value, so we added an RTL-like option: Unsorted.

Issue #187 is related.

An Unsorted example is available here. https://codepen.io/ogom-the-sasster/pen/PorbLgL

ogom commented 2 months ago

The Stacked Bar Chart does not sort, so when viewing it together with a treemap, it seems better to render it as Unsorted.

image

The default for Unsorted is false, which means the data will be rendered sorted in the following order: Dataset 1, Dataset 3, Dataset 2.

image

When you set Unsorted to true, the data will be rendered in Dataset 1, Dataset 2, Dataset 3.

image

kurkle commented 3 weeks ago

Hi @ogom, thank you for the contribution!

Would you be able to add a little bit of documentation to it?

ogom commented 3 weeks ago

Thank you. Added it to usage.md like rtl.