Fix number formatting in chart classes

Use explizit number formatting instead of implicit type conversions when
rendering SVGs, to prevent a change of the locale from breaking the charts.

fixes #6585
Fix coding style
Determine the scale factor correctly

Fix error in the logic of the context renderer, that lead to a wrong scale factor
when the width was bigger than the height
Translate labels in the ChartController