Fix chart export in case of missing gloss (LT-14663)

* Minor refactoring
* Adjust export test to catch problem
* Fix export

Change-Id: I145dd7c2d31bb059a1f40189df6b306b86e07de5