public class LineChart extends XYChart
Modifier and Type | Field and Description |
---|---|
static String |
TYPE
The constant to identify this chart type.
|
Constructor and Description |
---|
LineChart(XYMultipleSeriesDataset dataset,
XYMultipleSeriesRenderer renderer)
Builds a new line 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
|
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 renderer,
float yAxisValue,
int seriesIndex,
int startIndex)
The graphical representation of a series.
|
String |
getChartType()
Returns the chart type identifier.
|
int |
getLegendShapeWidth(int seriesIndex)
Returns the legend shape width.
|
ScatterChart |
getPointsChart()
Returns the scatter chart to be used for drawing the data points.
|
boolean |
isRenderPoints(SimpleSeriesRenderer renderer)
Returns if the chart should display the points as a certain shape.
|
protected void |
setDatasetRenderer(XYMultipleSeriesDataset dataset,
XYMultipleSeriesRenderer renderer)
Sets the series and the renderer.
|
draw, drawChartValuesText, drawPoints, drawSeries, drawText, drawXLabels, drawXTextLabels, drawYLabels, getCalcRange, getDataset, getDefaultMinimum, getRenderer, getScreenR, getSeriesAndPointForScreenCoordinate, getXLabels, getYLabels, isRenderNullValues, setCalcRange, setScreenR, toRealPoint, toRealPoint, toScreenPoint, toScreenPoint
drawBackground, drawLabel, drawLegend, drawPath, drawPath, drawString, getExceed, getLabel, getLegendSize, isNullValue, isVertical
public static final String TYPE
public LineChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
dataset
- the multiple series datasetrenderer
- the multiple series rendererprotected void setDatasetRenderer(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
setDatasetRenderer
in class XYChart
dataset
- the series datasetrenderer
- the series rendererpublic void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer renderer, 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 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 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 drawingpublic boolean isRenderPoints(SimpleSeriesRenderer renderer)
isRenderPoints
in class XYChart
renderer
- the series rendererpublic ScatterChart getPointsChart()
getPointsChart
in class XYChart
public String getChartType()
getChartType
in class XYChart