Perspective: Hide element from PieChart


So, I have a page that I use as a template, right now I have 2 Piecharts for each group of values to chart.
Let’s say that I have 6 groups of values, where in one I have 9 values, and the rest has less and less.

Now, my template has a pair of PCs for each group but only shows them when the template is configured for said group, this, while simple, takes a heavy CPU toll because the PCs are there, but hidden, they still update as the any of their values do.

So, one of my ideas was to dynamize the values using the case() command in expression language, but during proof of concept tests, I noticed that the data element won’t disappear when using either double quote or deleting the nametag whatsoever, see the example:


So, without doing a page for each group containing their couple of PCs (because, that’s the whole point of the template), how do I dynamize the PieChart to hide the unused data values?

Or, conversely, is there a way to DISABLE the autoupdate on the Pie Charts (so I can just hide them without using CPU power)?

So, I found a way to circumvent this and I’ll put it here for everyone to know:

What I did was create several views containing each pair of Piecharts and in the template page I mentioned (let’s call it the parent page) I put an Embedded view Component.

In the embedded view component, I used an expression binding with case() at the “path” property, this way I could achieve the dynamization I wanted and reduce the CPU usage.

I also dynamized the visibility for when a parent page was from a “group” with only one component and no PieChart was needed. This way it hid the Embedded view component and the path property had a default vaule of “true”, which also reduced CPU usage and hid the error message for the user. :face_with_hand_over_mouth:

However, it would be better if the objects (flavors) on the PieChart could be hidden, instead of having different Piecharts for each differently-sized group.