add histogram plots

This commit is contained in:
2019-12-27 12:25:25 +01:00
parent 2268ab40b3
commit 19e6dd1102
8 changed files with 207 additions and 24 deletions

View File

@@ -4,6 +4,7 @@ import org.lucares.pdb.plot.api.Aggregate;
import org.lucares.pdb.plot.api.AggregateHandlerCollection;
import org.lucares.pdb.plot.api.AxisScale;
import org.lucares.pdb.plot.api.CumulativeDistributionHandler;
import org.lucares.pdb.plot.api.HistogramHandler;
import org.lucares.pdb.plot.api.ParallelRequestsAggregate;
import org.lucares.pdb.plot.api.PlotSettings;
import org.lucares.pdb.plot.api.ScatterAggregateHandler;
@@ -55,11 +56,11 @@ class PlotSettingsTransformer {
throw new IllegalStateException("unhandled enum value: " + yRangeUnit);
}
static AggregateHandlerCollection toAggregateInternal(TimeRangeUnitInternal yRangeUnit, AxisScale yAxisScale,
final Iterable<Aggregate> aggregates) {
static AggregateHandlerCollection toAggregateInternal(final TimeRangeUnitInternal yRangeUnit,
final AxisScale yAxisScale, final Iterable<Aggregate> aggregates) {
final AggregateHandlerCollection aggregateHandlerCollection = new AggregateHandlerCollection();
for (Aggregate aggregate : aggregates) {
for (final Aggregate aggregate : aggregates) {
switch (aggregate) {
case CUM_DISTRIBUTION:
@@ -78,6 +79,9 @@ class PlotSettingsTransformer {
aggregateHandlerCollection.add(new ScatterAggregateHandler());
}
break;
case HISTOGRAM:
aggregateHandlerCollection.add(new HistogramHandler());
break;
default:
throw new IllegalStateException("unhandled enum: " + aggregate);
}