public class BarChart extends XYChart
Modifier and Type | Class and Description |
---|---|
static class |
BarChart.Type
The bar chart type enum.
|
Modifier and Type | Field and Description |
---|---|
protected BarChart.Type |
mType
The chart type.
|
static String |
TYPE
The constant to identify this chart type.
|
Constructor and Description |
---|
BarChart(XYMultipleSeriesDataset dataset,
XYMultipleSeriesRenderer renderer,
BarChart.Type type)
Builds a new bar chart instance.
|
Modifier and Type | Method and Description |
---|---|
protected ClickableArea[] |
clickableAreasForPoints(List<Float> points,
List<Double> values,
float yAxisValue,
int seriesIndex,
int startIndex)
Returns the clickable areas for all passed points
|
protected void |
drawBar(Canvas canvas,
float xMin,
float yMin,
float xMax,
float yMax,
float halfDiffX,
int seriesNr,
int seriesIndex,
Paint paint)
Draws a bar.
|
protected void |
drawBar(Canvas canvas,
float xMin,
float yMin,
float xMax,
float yMax,
int scale,
int seriesIndex,
Paint paint)
Draws a bar.
|
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.
|
void |
drawLegendShape(Canvas canvas,
SimpleSeriesRenderer renderer,
float x,
float y,
int seriesIndex,
Paint paint)
The graphical representation of the legend shape.
|
void |
drawSeries(Canvas canvas,
Paint paint,
List<Float> points,
XYSeriesRenderer seriesRenderer,
float yAxisValue,
int seriesIndex,
int startIndex)
The graphical representation of a series.
|
String |
getChartType()
Returns the chart type identifier.
|
protected float |
getCoeficient()
Returns the value of a constant used to calculate the half-distance.
|
double |
getDefaultMinimum()
Returns the default axis minimum.
|
protected int |
getGradientPartialColor(int minColor,
int maxColor,
float fraction) |
protected float |
getHalfDiffX(List<Float> points,
int length,
int seriesNr)
Calculates and returns the half-distance in the graphical representation of
2 consecutive points.
|
int |
getLegendShapeWidth(int seriesIndex)
Returns the legend shape width.
|
protected boolean |
isRenderNullValues()
Returns if the chart should display the null values.
|
draw, drawPoints, drawSeries, drawText, drawXLabels, drawXTextLabels, drawYLabels, getCalcRange, getDataset, getPointsChart, getRenderer, getScreenR, getSeriesAndPointForScreenCoordinate, getXLabels, getYLabels, isRenderPoints, setCalcRange, setDatasetRenderer, setScreenR, toRealPoint, toRealPoint, toScreenPoint, toScreenPoint
drawBackground, drawLabel, drawLegend, drawPath, drawPath, drawString, getExceed, getLabel, getLegendSize, isNullValue, isVertical
public static final String TYPE
protected BarChart.Type mType
public BarChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, BarChart.Type type)
dataset
- the multiple series datasetrenderer
- the multiple series renderertype
- the bar chart typeprotected ClickableArea[] clickableAreasForPoints(List<Float> points, List<Double> values, float yAxisValue, int seriesIndex, int startIndex)
XYChart
clickableAreasForPoints
in class XYChart
points
- the array of pointsvalues
- the array of values of each pointyAxisValue
- the minimum value of the y axisseriesIndex
- the index of the series to which the points belongstartIndex
- the start index of the rendering pointspublic void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)
drawSeries
in class XYChart
canvas
- the canvas to paint topaint
- the paint to be used for drawingpoints
- the array of points to be used for drawing the seriesseriesRenderer
- the series rendereryAxisValue
- the minimum value of the y axisseriesIndex
- the index of the series currently being drawnstartIndex
- the start index of the rendering pointsprotected void drawBar(Canvas canvas, float xMin, float yMin, float xMax, float yMax, float halfDiffX, int seriesNr, int seriesIndex, Paint paint)
canvas
- the canvasxMin
- the X axis minimumyMin
- the Y axis minimumxMax
- the X axis maximumyMax
- the Y axis maximumhalfDiffX
- half the size of a barseriesNr
- the total number of seriesseriesIndex
- the current series indexpaint
- the paintprotected void drawBar(Canvas canvas, float xMin, float yMin, float xMax, float yMax, int scale, int seriesIndex, Paint paint)
canvas
- the canvasxMin
- the X axis minimumyMin
- the Y axis minimumxMax
- the X axis maximumyMax
- the Y axis maximumscale
- the scale indexseriesIndex
- the current series indexpaint
- the paintprotected int getGradientPartialColor(int minColor, int maxColor, float fraction)
protected void drawChartValuesText(Canvas canvas, XYSeries series, XYSeriesRenderer renderer, Paint paint, List<Float> points, int seriesIndex, int startIndex)
drawChartValuesText
in class XYChart
canvas
- the canvas to paint toseries
- the series to be paintedrenderer
- the series rendererpaint
- the paint to be used for drawingpoints
- the array of points to be used for drawing the seriesseriesIndex
- the index of the series currently being drawnstartIndex
- the start index of the rendering pointspublic int getLegendShapeWidth(int seriesIndex)
getLegendShapeWidth
in class AbstractChart
seriesIndex
- the series indexpublic void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint)
drawLegendShape
in class AbstractChart
canvas
- the canvas to paint torenderer
- the series rendererx
- the x value of the point the shape should be drawn aty
- the y value of the point the shape should be drawn atseriesIndex
- the series indexpaint
- the paint to be used for drawingprotected float getHalfDiffX(List<Float> points, int length, int seriesNr)
points
- the pointslength
- the points lengthseriesNr
- the series numberprotected float getCoeficient()
protected boolean isRenderNullValues()
isRenderNullValues
in class XYChart
public double getDefaultMinimum()
getDefaultMinimum
in class XYChart
public String getChartType()
getChartType
in class XYChart