mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Tweak x-axis labels of charts (#4830)
* More tuning to avoid overlapping of labels,
follow-up to #4733
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+2
-1
@@ -209,7 +209,8 @@ public class DefaultChartProvider implements ChartProvider {
|
||||
// avoid overlapping labels on x-axis;
|
||||
// Font.getSize() is related to font height, but will also give an indication of the width;
|
||||
// pattern is not the actual label, but also gives a rough estimation of the width of the label
|
||||
int xAxisSpacing = Math.max(width / 15, chartTheme.getAxisTickLabelsFont(dpi).getSize() * pattern.length());
|
||||
int xAxisSpacing = Math.max(width / 15,
|
||||
chartTheme.getAxisTickLabelsFont(dpi).getSize() * pattern.length() * 4 / 3);
|
||||
styler.setXAxisTickMarkSpacingHint(xAxisSpacing);
|
||||
// chart
|
||||
styler.setChartBackgroundColor(chartTheme.getChartBackgroundColor());
|
||||
|
||||
Reference in New Issue
Block a user