mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-05-26 09:45:38 +00:00
Replace old jrobin with rrd4j 3.5 (ticket #2684)
2019-02-10 From https://github.com/rrd4j/rrd4j/releases Copyright (c) 2001-2005 Sasa Markovic and Ciaran Treanor. Copyright (c) 2011 The OpenNMS Group, Inc. Copyright 2011 The RRD4J Authors. Apache 2.0 and LGPLv2.1 Unmodified as a base for future merges, except for omitted files listed below. This rev will not work; font patch to follow in next revision. Following directories and files omitted: converter/ core/RrdBerkeleyDbBackendFactory.java core/RrdBerkeleyDbBackend.java core/RrdMongoDBBackendFactory.java core/RrdMongoDBBackend.java demo/ graph/RrdGraphDefTemplate.java inspector/ eu/bengreen/data/utility/
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package org.rrd4j.graph;
|
||||
|
||||
import java.awt.Paint;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.rrd4j.data.DataProcessor;
|
||||
|
||||
public class ConstantArea extends Area {
|
||||
private final double value;
|
||||
|
||||
ConstantArea(double value, Paint color, SourcedPlotElement parent) {
|
||||
super(Double.toString(value), color, parent);
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
void assignValues(DataProcessor dproc) {
|
||||
values = new double[dproc.getTimestamps().length];
|
||||
Arrays.fill(values, value);
|
||||
if(parent != null) {
|
||||
double[] parentValues = parent.getValues();
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
if (! Double.isNaN(parentValues[i])){
|
||||
values[i] += parentValues[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user