Question

I get an error when trying to use such logic in a chart, but in the test drive it works without problems.

Answer

Groovy libs are a feature of the FormulaEngine, so from that perspective they should work all over the place.

What could help then is to verify: