Class RangeBarSeries
Floating bars that span from a start value to an end value: schedules, temperature ranges,
price ranges. Combine with Chart.setRotated(true) for a timeline.
double[] lows = {4, 6, 9}, highs = {12, 15, 19};
new RangeBarSeries("Temperature").setRanges(null, lows, highs);

-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRange(double x, double start, double end) Appends one range.protected doubleauxDefault(int channel, double y) A range added byadd(x, y)orsetDatastarts at zero, so its bar spans0..y.protected booleanTrue for a series drawn on its stack base (an area or a bar), which a stack group lifts and whose layer shrinks with the fraction it is shown while it fades; false for marks that keep their own values (scatter, error bars, candles, boxes).formatTooltip(ChartContext ctx, ChartPoint p) The tooltip row for a point: the series or point name and its formatted value.doublegetBase(int i) The base this series' pointirests on: 0, or the stacked sum of the earlier series in its group.doublegetEnd(int i) The end of rangei.doublegetStart(int i) The start of rangei.double[]The extent of the data along y,{min, max}, or null when empty or not cartesian.protected booleanTrue for a series whose base is its own data (a range bar's start, a waterfall's running total) rather than a stack: it is drawn from that base but is no layer of a stack.setRanges(double[] x, double[] start, double[] end) Replaces all ranges.protected StringtableValue(int i) The text of pointiin the accessible data table.protected doubletargetBase(int i) The base pointisettles on once the running transition ends: the stack of the earlier layers weighted by the fraction each ends at, orXYSeries.getBase(int)outside a stack group.Methods inherited from class BarSeries
colorAt, getXBounds, hitTest, paint, setBarFraction, setCornerRadiusMethods inherited from class XYSeries
add, add, addRow, animatedAux, animatedBase, animatedY, captureEntryStart, captureTransitionStart, clear, collectTableRows, dataChanged, getAux, getMinXSpacing, getPoint, getPointCount, getStackGroup, getX, getXBoundsWithin, getY, isAscending, isAuxRelative, isCartesian, isGapAt, lowerBound, nearestIndexOfX, nearestScreenIndex, screenPosition, set, setData, setMaxPoints, setRows, setStackGroup, setValues, size, transitionEnded, visibleRangeMethods inherited from class Series
attached, detached, formatValue, getChart, getColor, getLegendEntryCount, getLegendEntryName, getName, getSelectablePointCount, getValueFormatter, getVisibilityFraction, handleTap, isGap, isLegendEntryVisible, isPointCountFromLayout, isSecondaryAxis, isShowValues, isVisible, lerp, paintLegendEntrySymbol, paintLegendSymbol, repaintChart, setColor, setName, setSecondaryAxis, setShowValues, setValueFormatter, setVisible, toggleLegendEntry
-
Constructor Details
-
RangeBarSeries
Creates an empty series.
Parameters
name: the series name
-
-
Method Details
-
auxDefault
protected double auxDefault(int channel, double y) A range added byadd(x, y)orsetDatastarts at zero, so its bar spans0..y.- Overrides:
auxDefaultin classXYSeries
-
setRanges
Replaces all ranges.
Parameters
-
x: the x value of each bar, or null for 0, 1, 2... -
start: where each bar starts -
end: where each bar ends
Returns
this series
-
-
addRange
Appends one range.
Parameters
-
x: the x value -
start: the start value -
end: the end value
Returns
this series
-
-
getStart
public double getStart(int i) The start of rangei. -
getEnd
public double getEnd(int i) The end of rangei. -
getBase
-
consumesStackBase
protected boolean consumesStackBase()Description copied from class:XYSeriesTrue for a series drawn on its stack base (an area or a bar), which a stack group lifts and whose layer shrinks with the fraction it is shown while it fades; false for marks that keep their own values (scatter, error bars, candles, boxes).
Returns
false by default
- Overrides:
consumesStackBasein classBarSeries
-
hasOwnBase
protected boolean hasOwnBase()Description copied from class:XYSeriesTrue for a series whose base is its own data (a range bar's start, a waterfall's running total) rather than a stack: it is drawn from that base but is no layer of a stack.
Returns
false by default
- Overrides:
hasOwnBasein classXYSeries
-
targetBase
protected double targetBase(int i) Description copied from class:XYSeriesThe base point
isettles on once the running transition ends: the stack of the earlier layers weighted by the fraction each ends at, orXYSeries.getBase(int)outside a stack group. A series whose base is its own data (a range bar's start, a waterfall's running total) overrides this to answer that, so the tween ends exactly where the settled value is.i: the point index
Returns
the settled base
- Overrides:
targetBasein classXYSeries
-
getYBounds
public double[] getYBounds()Description copied from class:SeriesThe extent of the data along y,{min, max}, or null when empty or not cartesian.- Overrides:
getYBoundsin classBarSeries
-
formatTooltip
Description copied from class:SeriesThe tooltip row for a point: the series or point name and its formatted value. Series with several values per point (open/high/low/close, ranges, box plots) override this.
Parameters
-
ctx: the last paint context -
p: the point
Returns
one line of text
- Overrides:
formatTooltipin classSeries
-
-
tableValue
Description copied from class:XYSeriesThe text of point
iin the accessible data table.Parameters
i: the point index
Returns
the formatted value
- Overrides:
tableValuein classXYSeries
-