use two lines for the xlabels instead of rotating it

We used to rotate the xlabels so that they would not intersect. A
solution that is easier to read is to add a newline between the date and
the time.
This commit is contained in:
2018-08-02 08:20:33 +02:00
parent 1567429b3a
commit 6871e250ad
2 changed files with 5 additions and 5 deletions

View File

@@ -180,10 +180,10 @@ public class ScatterPlot {
formatX = "%Y-%m-%d"; formatX = "%Y-%m-%d";
rotateX = 0; rotateX = 0;
} else if (minDate.until(maxDate, ChronoUnit.SECONDS) > 30) { } else if (minDate.until(maxDate, ChronoUnit.SECONDS) > 30) {
formatX = "%Y-%m-%d %H:%M:%S"; formatX = "%Y-%m-%d\\n%H:%M:%S";
rotateX = gnuplotSettings.getxAxisSettings().getRotateXAxisLabel(); rotateX = gnuplotSettings.getxAxisSettings().getRotateXAxisLabel();
} else { } else {
formatX = "%Y-%m-%d %H:%M:%.3S"; formatX = "%Y-%m-%d\\n%H:%M:%.3S";
rotateX = gnuplotSettings.getxAxisSettings().getRotateXAxisLabel(); rotateX = gnuplotSettings.getxAxisSettings().getRotateXAxisLabel();
} }
formattedMinDate = String.valueOf(minDate.toEpochSecond()); formattedMinDate = String.valueOf(minDate.toEpochSecond());

View File

@@ -6,13 +6,13 @@ public class XAxisSettings {
private boolean xDataTime = true; private boolean xDataTime = true;
// set format for x-axis // set format for x-axis
private String formatX = "%Y-%m-%d %H:%M:%S"; private String formatX = "%Y-%m-%d\\n%H:%M:%S";
// set xlabel // set xlabel
private String xlabel = "Time"; private String xlabel = "Time";
// set xtics rotate by 10 degree // set xtics rotation in degree
private int rotateXAxisLabel = -10; private int rotateXAxisLabel = 0;
private String from; private String from;
private String to; private String to;