public class RangeBarChart

  1. Object
  2. AbstractChart
  3. XYChart
  4. BarChart
  5. RangeBarChart

Known subtypesRangeStackedBarChart

Extends BarChart to support values that represent ranges rather than single points. Each bar is drawn from the lower value to the upper value in the dataset.

Use this chart with an XYMultipleSeriesDataset containing XYSeries instances where consecutive entries form the minimum/maximum pair for a category.

Fields

public static final String TYPE = "RangeBar"The chart type.

Constructors

public RangeBarChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, BarChart.Type type)Builds a new range bar chart instance.

Methods

public void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)The graphical representation of a series.
protected void drawChartValuesText(Canvas canvas, XYSeries series, XYSeriesRenderer renderer, Paint paint, List<Float> points, int seriesIndex, int startIndex)The graphical representation of the series values as text.
protected float getCoeficient()Returns the value of a constant used to calculate the half-distance.
public String getChartType()Returns the chart type identifier.

Inherited nested types

Inherited fields

Inherited methods

Field details

TYPE

public static final String TYPE = "RangeBar"
The chart type.

Constructor details

RangeBarChart

public RangeBarChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, BarChart.Type type)
Builds a new range bar chart instance.

Parameters

dataset XYMultipleSeriesDataset
the multiple series dataset
renderer XYMultipleSeriesRenderer
the multiple series renderer
type BarChart.Type
the range bar chart type

Method details

drawSeries

public void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)
The graphical representation of a series.

Parameters

canvas Canvas
the canvas to paint to
paint Paint
the paint to be used for drawing
points List<Float>
the array of points to be used for drawing the series
seriesRenderer XYSeriesRenderer
the series renderer
yAxisValue float
the minimum value of the y axis
seriesIndex int
the index of the series currently being drawn
startIndex int
the start index of the rendering points

drawChartValuesText

protected void drawChartValuesText(Canvas canvas, XYSeries series, XYSeriesRenderer renderer, Paint paint, List<Float> points, int seriesIndex, int startIndex)
The graphical representation of the series values as text.

Parameters

canvas Canvas
the canvas to paint to
series XYSeries
the series to be painted
renderer XYSeriesRenderer
the series renderer
paint Paint
the paint to be used for drawing
points List<Float>
the array of points to be used for drawing the series
seriesIndex int
the index of the series currently being drawn
startIndex int
the start index of the rendering points

getCoeficient

protected float getCoeficient()
Returns the value of a constant used to calculate the half-distance.

Returns

the constant value

getChartType

public String getChartType()
Returns the chart type identifier.

Returns

the chart type