use enum for line type instead of string
This commit is contained in:
@@ -12,10 +12,10 @@ public class FileBackedDataSeries implements DataSeries {
|
|||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
private String linetype;
|
private GnuplotLineType linetype;
|
||||||
|
|
||||||
|
|
||||||
public FileBackedDataSeries(String id, String title, CsvSummary csvSummary, String linetype) {
|
public FileBackedDataSeries(String id, String title, CsvSummary csvSummary, GnuplotLineType linetype) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.csvSummary = csvSummary;
|
this.csvSummary = csvSummary;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.lucares.recommind.logs;
|
||||||
|
|
||||||
|
public enum GnuplotLineType {
|
||||||
|
LINE("line"),
|
||||||
|
|
||||||
|
Points("points");
|
||||||
|
|
||||||
|
private String gnuplotLineType;
|
||||||
|
|
||||||
|
GnuplotLineType(String gnuplotLineType) {
|
||||||
|
this.gnuplotLineType = gnuplotLineType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return gnuplotLineType;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ public class PercentilePlot implements ConcretePlotter {
|
|||||||
values.size());
|
values.size());
|
||||||
|
|
||||||
CsvSummary csvSummary = new CsvSummary(dataFile, values.size(), maxValue, null);
|
CsvSummary csvSummary = new CsvSummary(dataFile, values.size(), maxValue, null);
|
||||||
return new FileBackedDataSeries(id, title, csvSummary, "line");
|
return new FileBackedDataSeries(id, title, csvSummary, GnuplotLineType.LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void defineXAxis(GnuplotSettings gnuplotSettings) {
|
private void defineXAxis(GnuplotSettings gnuplotSettings) {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class ScatterPlot implements ConcretePlotter {
|
|||||||
|
|
||||||
final int id = idCounter.getAndIncrement();
|
final int id = idCounter.getAndIncrement();
|
||||||
final String title = ConcretePlotter.title(groupResult.getGroupedBy(), csvSummary.getValues());
|
final String title = ConcretePlotter.title(groupResult.getGroupedBy(), csvSummary.getValues());
|
||||||
final DataSeries dataSerie = new FileBackedDataSeries("id"+id, title, csvSummary, "points");
|
final DataSeries dataSerie = new FileBackedDataSeries("id"+id, title, csvSummary, GnuplotLineType.Points);
|
||||||
if (dataSerie.getValues() > 0) {
|
if (dataSerie.getValues() > 0) {
|
||||||
dataSeries.add(dataSerie);
|
dataSeries.add(dataSerie);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user