Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ public BufferedImage createChart(@Nullable String serviceId, @Nullable String th
}
styler.setYAxisTickMarkSpacingHint(yAxisSpacing);
styler.setYAxisLabelAlignment(TextAlignment.Right);
// 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());
styler.setXAxisTickMarkSpacingHint(xAxisSpacing);
// chart
styler.setChartBackgroundColor(chartTheme.getChartBackgroundColor());
styler.setChartFontColor(chartTheme.getChartFontColor());
Expand Down