org.achartengine.chart
Class LineChart

java.lang.Object
  extended by org.achartengine.chart.AbstractChart
      extended by org.achartengine.chart.XYChart
          extended by org.achartengine.chart.LineChart
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CubicLineChart, TimeChart

public class LineChart
extends XYChart

The line chart rendering class.

See Also:
Serialized Form

Field Summary
static java.lang.String TYPE
          The constant to identify this chart type.
 
Fields inherited from class org.achartengine.chart.XYChart
mDataset, mRenderer
 
Constructor Summary
LineChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
          Builds a new line chart instance.
 
Method Summary
protected  ClickableArea[] clickableAreasForPoints(java.util.List<java.lang.Float> points, java.util.List<java.lang.Double> values, float yAxisValue, int seriesIndex, int startIndex)
          Returns the clickable areas for all passed points
 void drawLegendShape(android.graphics.Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, android.graphics.Paint paint)
          The graphical representation of the legend shape.
 void drawSeries(android.graphics.Canvas canvas, android.graphics.Paint paint, java.util.List<java.lang.Float> points, SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)
          The graphical representation of a series.
 java.lang.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.
 
Methods inherited from class org.achartengine.chart.XYChart
draw, drawChartValuesText, drawSeries, drawText, drawXLabels, drawXTextLabels, drawYLabels, getCalcRange, getDataset, getDefaultMinimum, getRenderer, getScreenR, getSeriesAndPointForScreenCoordinate, getXLabels, getYLabels, isRenderNullValues, setCalcRange, setScreenR, toRealPoint, toRealPoint, toScreenPoint, toScreenPoint
 
Methods inherited from class org.achartengine.chart.AbstractChart
drawBackground, drawLabel, drawLegend, drawPath, drawPath, drawString, getExceed, getLabel, getLegendSize, isNullValue, isVertical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
The constant to identify this chart type.

See Also:
Constant Field Values
Constructor Detail

LineChart

public LineChart(XYMultipleSeriesDataset dataset,
                 XYMultipleSeriesRenderer renderer)
Builds a new line chart instance.

Parameters:
dataset - the multiple series dataset
renderer - the multiple series renderer
Method Detail

setDatasetRenderer

protected void setDatasetRenderer(XYMultipleSeriesDataset dataset,
                                  XYMultipleSeriesRenderer renderer)
Sets the series and the renderer.

Overrides:
setDatasetRenderer in class XYChart
Parameters:
dataset - the series dataset
renderer - the series renderer

drawSeries

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

Specified by:
drawSeries in class XYChart
Parameters:
canvas - the canvas to paint to
paint - the paint to be used for drawing
points - the array of points to be used for drawing the series
seriesRenderer - the series renderer
yAxisValue - the minimum value of the y axis
seriesIndex - the index of the series currently being drawn
startIndex - the start index of the rendering points

clickableAreasForPoints

protected ClickableArea[] clickableAreasForPoints(java.util.List<java.lang.Float> points,
                                                  java.util.List<java.lang.Double> values,
                                                  float yAxisValue,
                                                  int seriesIndex,
                                                  int startIndex)
Description copied from class: XYChart
Returns the clickable areas for all passed points

Specified by:
clickableAreasForPoints in class XYChart
Parameters:
points - the array of points
values - the array of values of each point
yAxisValue - the minimum value of the y axis
seriesIndex - the index of the series to which the points belong
startIndex - the start index of the rendering points
Returns:
an array of rectangles with the clickable area

getLegendShapeWidth

public int getLegendShapeWidth(int seriesIndex)
Returns the legend shape width.

Specified by:
getLegendShapeWidth in class AbstractChart
Parameters:
seriesIndex - the series index
Returns:
the legend shape width

drawLegendShape

public void drawLegendShape(android.graphics.Canvas canvas,
                            SimpleSeriesRenderer renderer,
                            float x,
                            float y,
                            int seriesIndex,
                            android.graphics.Paint paint)
The graphical representation of the legend shape.

Specified by:
drawLegendShape in class AbstractChart
Parameters:
canvas - the canvas to paint to
renderer - the series renderer
x - the x value of the point the shape should be drawn at
y - the y value of the point the shape should be drawn at
seriesIndex - the series index
paint - the paint to be used for drawing

isRenderPoints

public boolean isRenderPoints(SimpleSeriesRenderer renderer)
Returns if the chart should display the points as a certain shape.

Overrides:
isRenderPoints in class XYChart
Parameters:
renderer - the series renderer

getPointsChart

public ScatterChart getPointsChart()
Returns the scatter chart to be used for drawing the data points.

Overrides:
getPointsChart in class XYChart
Returns:
the data points scatter chart

getChartType

public java.lang.String getChartType()
Returns the chart type identifier.

Specified by:
getChartType in class XYChart
Returns:
the chart type


Copyright © 2009 - 2011 4ViewSoft. All Rights Reserved.