histogram tick drawing - added format generation for optimum tick drawing
Fixes bug #45192 which showed up in the gtk3 branch on MacOS.
It replaces the decimal_xxx computations with a routine that computes a
formatting string and a scale factor for a given axis range and number of
bins. The formatting will switch between normal and scientific depending on
the length of the displayed label text. The formatting is such that no
rounded numbers like 3.
9999999 when in fact 4 is expected is shown.
Differences between bins remain visible in the tick labels.
In addition the width of the rendered labels is compared with the width
of the bins in the display such that the labels will automatically
switch between horizontal and 45 degree display.