first step to show plot on dashboard
This commit is contained in:
@@ -45,8 +45,8 @@ public class ScatterAggregator implements CustomAggregator {
|
||||
final YAxisDefinition yAxisDefinition = plotSettings.getyAxisDefinition(yAxis);
|
||||
|
||||
final boolean automaticRange = yAxisDefinition.getRangeUnit().isAutomatic();
|
||||
minValue = automaticRange ? 0 : yAxisDefinition.getRangeMinForUnit();
|
||||
maxValue = automaticRange ? Long.MAX_VALUE : yAxisDefinition.getRangeMaxForUnit();
|
||||
minValue = automaticRange ? 0 : yAxisDefinition.rangeMinForUnit();
|
||||
maxValue = automaticRange ? Long.MAX_VALUE : yAxisDefinition.rangeMaxForUnit();
|
||||
valuesPerPixel = yAxisDefinition.getAxisScale() == AxisScale.LINEAR && !automaticRange
|
||||
? Math.max(1, (maxValue - minValue) / plotAreaHeightInPx)
|
||||
: 1;
|
||||
|
||||
@@ -15,11 +15,11 @@ public class YAxisDefinition {
|
||||
this.axisScale = axisScale;
|
||||
}
|
||||
|
||||
public long getRangeMinForUnit() {
|
||||
public long rangeMinForUnit() {
|
||||
return rangeUnit.valueForUnit(rangeMin);
|
||||
}
|
||||
|
||||
public long getRangeMaxForUnit() {
|
||||
public long rangeMaxForUnit() {
|
||||
return rangeUnit.valueForUnit(rangeMax);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,4 @@ public class YAxisDefinition {
|
||||
this.rangeUnit = rangeUnit;
|
||||
}
|
||||
|
||||
public boolean isLogscale() {
|
||||
return axisScale == AxisScale.LOG10;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,15 +52,15 @@ public class AxisTime {
|
||||
|
||||
final int graphOffset = yAxisDefinition.getAxisScale() == AxisScale.LINEAR ? 0 : 1;
|
||||
if (yAxisDefinition.hasRange()) {
|
||||
final long min = Math.max(yAxisDefinition.getRangeMinForUnit(), graphOffset);
|
||||
final long max = yAxisDefinition.getRangeMaxForUnit();
|
||||
final long min = Math.max(yAxisDefinition.rangeMinForUnit(), graphOffset);
|
||||
final long max = yAxisDefinition.rangeMaxForUnit();
|
||||
result.setFrom(String.valueOf(min));
|
||||
result.setTo(String.valueOf(max));
|
||||
} else {
|
||||
result.setFrom(String.valueOf(graphOffset));
|
||||
}
|
||||
|
||||
result.setLogscale(yAxisDefinition.isLogscale());
|
||||
result.setLogscale(yAxisDefinition.getAxisScale() == AxisScale.LOG10);
|
||||
|
||||
result.setTics(YAxisTicks.computeYTicks(settings, yAxis, dataSeries));
|
||||
result.setShowGrid(yAxis == GnuplotAxis.Y1);
|
||||
|
||||
@@ -25,8 +25,8 @@ class YAxisTicks {
|
||||
final long yRangeMax;
|
||||
final long yRangeMin;
|
||||
if (yAxisDefinition.hasRange()) {
|
||||
yRangeMin = yAxisDefinition.getRangeMinForUnit();
|
||||
yRangeMax = yAxisDefinition.getRangeMaxForUnit();
|
||||
yRangeMin = yAxisDefinition.rangeMinForUnit();
|
||||
yRangeMax = yAxisDefinition.rangeMaxForUnit();
|
||||
} else {
|
||||
yRangeMin = 0;
|
||||
yRangeMax = DataSeries.maxValue(dataSeries);
|
||||
|
||||
Reference in New Issue
Block a user