fix axis labels when x2 axis is used
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisTime;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotLineType;
|
||||
@@ -42,7 +43,7 @@ public class BarChartHandler extends AggregateHandler {
|
||||
result.setLabel("Bar");
|
||||
result.setType(Type.Group);
|
||||
result.setAxis(getxAxis());
|
||||
result.setTicsEnabled(true);
|
||||
result.setTicsEnabled(false);
|
||||
result.setFrom("0");
|
||||
result.setTo(String.valueOf(dataSeries.size()));
|
||||
|
||||
@@ -59,15 +60,7 @@ public class BarChartHandler extends AggregateHandler {
|
||||
@Override
|
||||
AxisSettings createYAxisSettings(final GnuplotSettings settings, final Collection<DataSeries> dataSeries) {
|
||||
|
||||
final GnuplotAxis yAxis = getyAxis();
|
||||
|
||||
final AxisSettings result = new AxisSettings();
|
||||
result.setLabel("Count");
|
||||
result.setType(Type.Number);
|
||||
result.setAxis(yAxis);
|
||||
result.setTicsEnabled(true);
|
||||
result.setFrom("0");
|
||||
result.setLogscale(settings.getYAxisDefinition(yAxis).isLogscale());
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, getyAxis(), dataSeries);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -82,7 +75,8 @@ public class BarChartHandler extends AggregateHandler {
|
||||
appendln(result, "EOD");
|
||||
|
||||
if (settings.isRenderLabels()) {
|
||||
appendfln(result, "set label at %f, %d '%s' center front offset 0,0.3", // front
|
||||
appendfln(result, "set label at %s %f, %d '%s' center front offset 0,0.3", // front
|
||||
getxAxis() == GnuplotAxis.X1 ? "first" : "second", //
|
||||
barAggregator.getIndex() + 0.5, //
|
||||
barAggregator.getCount(), //
|
||||
String.format(Locale.US, "%,d", barAggregator.getCount()));
|
||||
@@ -101,8 +95,17 @@ public class BarChartHandler extends AggregateHandler {
|
||||
* aggregatedData.getDataFile(), // GnuplotLineType.Bar, // gnuplotXYAxis(), //
|
||||
* lineStyle// );
|
||||
*/
|
||||
return formatln("'%s' using 1:3:xtic(2) %s with %s axes %s fs solid %s, \\", //
|
||||
// return formatln("'%s' using 1:3:xtic(2) %s with %s axes %s fs solid %s, \\", //
|
||||
// barAggregator.getDataName(), //
|
||||
// gnuplotTitle(title), //
|
||||
// GnuplotLineType.Bar, //
|
||||
// gnuplotXYAxis(), //
|
||||
// lineStyle.asGnuplotLineStyleBright()//
|
||||
// );
|
||||
|
||||
return formatln("'%s' using 1:3:%stic(2) %s with %s axes %s fs solid %s, \\", //
|
||||
barAggregator.getDataName(), //
|
||||
getxAxis(), //
|
||||
gnuplotTitle(title), //
|
||||
GnuplotLineType.Bar, //
|
||||
gnuplotXYAxis(), //
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.lucares.recommind.logs.AxisSettings;
|
||||
import org.lucares.recommind.logs.AxisTime;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.GnuplotAxis;
|
||||
import org.lucares.recommind.logs.GnuplotSettings;
|
||||
@@ -44,13 +45,17 @@ public class HistogramHandler extends AggregateHandler {
|
||||
|
||||
@Override
|
||||
AxisSettings createYAxisSettings(final GnuplotSettings settings, final Collection<DataSeries> dataSeries) {
|
||||
final AxisSettings result = new AxisSettings();
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, getyAxis(), dataSeries);
|
||||
result.setLabel("Histogram - Count");
|
||||
result.setType(Type.HistogramCount);
|
||||
result.setAxis(getyAxis());
|
||||
result.setTicsEnabled(true);
|
||||
result.setFrom("0");
|
||||
return result;
|
||||
|
||||
// final AxisSettings result = new AxisSettings();
|
||||
// result.setLabel("Histogram - Count");
|
||||
// result.setType(Type.HistogramCount);
|
||||
// result.setAxis(getyAxis());
|
||||
// result.setTicsEnabled(true);
|
||||
// result.setFrom("0");
|
||||
// return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,22 +34,6 @@ public class ParallelRequestsAggregate extends AggregateHandler {
|
||||
|
||||
final AxisSettings result = AxisTime.createYAxis(settings, getyAxis(), dataSeries);
|
||||
return result;
|
||||
|
||||
// final YAxisDefinition yAxisDefinition = settings.getYAxisDefinition(getyAxis());
|
||||
//
|
||||
// final AxisSettings result = new AxisSettings();
|
||||
// result.setLabel("Parallel Requests");
|
||||
// result.setType(Type.Number);
|
||||
// result.setAxis(getyAxis());
|
||||
// result.setTicsEnabled(true);
|
||||
// if (yAxisDefinition.hasRange()) {
|
||||
// result.setFrom(String.valueOf(yAxisDefinition.getRangeMinForUnit()));
|
||||
// result.setTo(String.valueOf(yAxisDefinition.getRangeMaxForUnit()));
|
||||
// } else {
|
||||
// result.setFrom("0");
|
||||
// }
|
||||
// result.setLogscale(yAxisDefinition.isLogscale());
|
||||
// return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,7 @@ public class AxisSettings {
|
||||
|
||||
private String label = "";
|
||||
|
||||
private int rotateLabel = 0;
|
||||
private int rotateLabel = 0; // TODO remove rotate label
|
||||
|
||||
private String from;
|
||||
private String to;
|
||||
|
||||
Reference in New Issue
Block a user