You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by stockiNail December 12, 2022
Going to the last version, I have discovered that if you change the values of the tree (or data) without instantiating new object (or array), the chart will not be updated.
This is because the tree is stored in the controller and checked with new one at every update:
a problem I've encountered with this is that it's very hard to filter the data and have the treemap re-draw, without a more complex setup.
in my particular scenario my data has three categories (eg cars, motorbikes, trucks) and I want to be able to quickly filter, turning any category on/off. With some graph types I can just splice the data array, but with treemap I have to rebuild for each filter operation. Not a huge issue but would be nice to find a solution (would actually love to keep the current vals array and just replace elements in the array with NaN (or eg -1) to turn off the box and then on a chart.update() recalculate the layout (I'm lazy, means I can leave my tooltip arrays unfiltered as the indexes will stay matching!)
Discussed in #171
Originally posted by stockiNail December 12, 2022
Going to the last version, I have discovered that if you change the values of the tree (or data) without instantiating new object (or array), the chart will not be updated.
This is because the tree is stored in the controller and checked with new one at every update:
chartjs-chart-treemap/src/controller.js
Line 112 in f6a7af1
Maybe it's implemented as designed. But maybe it could be better to check not the instance but the content of the tree.
The text was updated successfully, but these errors were encountered: