java.lang.Object
org.rrd4j.graph.PlotElement
org.rrd4j.graph.Span
org.rrd4j.graph.HSpan
Represents a horizontal span in RRD graphs. Draws a colored rectangular region spanning a range of values on the y-axis.
Field Summary
FieldsFields inherited from class Span
legendModifier and TypeFieldDescription(package private) final LegendTextThe legend entry describing this span.Fields inherited from class PlotElement
colorConstructor Summary
ConstructorsConstructorDescriptionHSpan(double start, double end, Paint color, LegendText legend) Create a span covering the given value range.Method Summary
Private MethodsModifier and TypeMethodDescriptionprivate booleancheckRange(double v, double min, double max) Returns true when the value lies between the bounds, inclusive.(package private) voidsetLegendVisibility(double min, double max, boolean forceLegend) Control legend visibility based on current axis range.
Field Details
start
final double startValue at which the span begins.end
final double endValue at which the span ends.
Constructor Details
HSpan
HSpan(double start, double end, Paint color, LegendText legend) Create a span covering the given value range.- Parameters:
start- value at which the span beginsend- value at which the span ends, which must be greater than startcolor- the fill color of the spanlegend- the legend entry describing the span
Method Details
checkRange
private boolean checkRange(double v, double min, double max) Returns true when the value lies between the bounds, inclusive.- Parameters:
v- the value to testmin- the lower boundmax- the upper bound- Returns:
- true if the value lies between the bounds, inclusive
setLegendVisibility
void setLegendVisibility(double min, double max, boolean forceLegend) Control legend visibility based on current axis range.- Parameters:
min- the lower bound of the visible y-axis rangemax- the upper bound of the visible y-axis rangeforceLegend- when true, keep the legend shown whatever the span's overlap