Backported a bugfix where the aggregation function of a bar chart was not correctly loaded/saved to XML. Added a JUnit test for it