|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.achartengine.chart.AbstractChart
org.achartengine.chart.XYChart
public abstract class XYChart
The XY chart rendering class.
Field Summary | |
---|---|
protected XYMultipleSeriesDataset |
mDataset
The multiple series dataset. |
protected XYMultipleSeriesRenderer |
mRenderer
The multiple series renderer. |
Constructor Summary | |
---|---|
protected |
XYChart()
|
|
XYChart(XYMultipleSeriesDataset dataset,
XYMultipleSeriesRenderer renderer)
Builds a new XY chart instance. |
Method Summary | |
---|---|
protected abstract android.graphics.RectF[] |
clickableAreasForPoints(float[] points,
float yAxisValue,
int seriesIndex)
Returns the clickable areas for all passed points |
void |
draw(android.graphics.Canvas canvas,
int x,
int y,
int width,
int height,
android.graphics.Paint paint)
The graphical representation of the XY chart. |
protected void |
drawChartValuesText(android.graphics.Canvas canvas,
XYSeries series,
SimpleSeriesRenderer renderer,
android.graphics.Paint paint,
float[] points,
int seriesIndex)
The graphical representation of the series values as text. |
abstract void |
drawSeries(android.graphics.Canvas canvas,
android.graphics.Paint paint,
float[] points,
SimpleSeriesRenderer seriesRenderer,
float yAxisValue,
int seriesIndex)
The graphical representation of a series. |
protected void |
drawSeries(XYSeries series,
android.graphics.Canvas canvas,
android.graphics.Paint paint,
java.util.List<java.lang.Float> pointsList,
SimpleSeriesRenderer seriesRenderer,
float yAxisValue,
int seriesIndex,
XYMultipleSeriesRenderer.Orientation or)
|
protected void |
drawText(android.graphics.Canvas canvas,
java.lang.String text,
float x,
float y,
android.graphics.Paint paint,
float extraAngle)
The graphical representation of a text, to handle both HORIZONTAL and VERTICAL orientations and extra rotation angles. |
protected void |
drawXLabels(java.util.List<java.lang.Double> xLabels,
java.lang.Double[] xTextLabelLocations,
android.graphics.Canvas canvas,
android.graphics.Paint paint,
int left,
int top,
int bottom,
double xPixelsPerUnit,
double minX,
double maxX)
The graphical representation of the labels on the X axis. |
protected void |
drawXTextLabels(java.lang.Double[] xTextLabelLocations,
android.graphics.Canvas canvas,
android.graphics.Paint paint,
boolean showLabels,
int left,
int top,
int bottom,
double xPixelsPerUnit,
double minX,
double maxX)
The graphical representation of the text labels on the X axis. |
double[] |
getCalcRange(int scale)
|
abstract java.lang.String |
getChartType()
Returns the chart type identifier. |
XYMultipleSeriesDataset |
getDataset()
|
double |
getDefaultMinimum()
Returns the default axis minimum. |
protected java.lang.String |
getLabel(double label)
Makes sure the fraction digit is not displayed, if not needed. |
ScatterChart |
getPointsChart()
Returns the scatter chart to be used for drawing the data points. |
XYMultipleSeriesRenderer |
getRenderer()
|
protected android.graphics.Rect |
getScreenR()
|
SeriesSelection |
getSeriesAndPointForScreenCoordinate(Point screenPoint)
Given screen coordinates, returns the series and point indexes of a chart element. |
protected boolean |
isRenderNullValues()
Returns if the chart should display the null values. |
boolean |
isRenderPoints(SimpleSeriesRenderer renderer)
Returns if the chart should display the points as a certain shape. |
void |
setCalcRange(double[] range,
int scale)
|
protected void |
setDatasetRenderer(XYMultipleSeriesDataset dataset,
XYMultipleSeriesRenderer renderer)
|
protected void |
setScreenR(android.graphics.Rect screenR)
|
double[] |
toRealPoint(float screenX,
float screenY)
|
double[] |
toRealPoint(float screenX,
float screenY,
int scale)
Transforms a screen point to a real coordinates point. |
double[] |
toScreenPoint(double[] realPoint)
|
double[] |
toScreenPoint(double[] realPoint,
int scale)
|
Methods inherited from class org.achartengine.chart.AbstractChart |
---|
drawBackground, drawLabel, drawLegend, drawLegendShape, drawPath, getExceed, getLegendShapeWidth, getLegendSize, isVertical |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected XYMultipleSeriesDataset mDataset
protected XYMultipleSeriesRenderer mRenderer
Constructor Detail |
---|
protected XYChart()
public XYChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
dataset
- the multiple series datasetrenderer
- the multiple series rendererMethod Detail |
---|
protected void setDatasetRenderer(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
public void draw(android.graphics.Canvas canvas, int x, int y, int width, int height, android.graphics.Paint paint)
draw
in class AbstractChart
canvas
- the canvas to paint tox
- the top left x value of the view to draw toy
- the top left y value of the view to draw towidth
- the width of the view to draw toheight
- the height of the view to draw topaint
- the paintprotected android.graphics.Rect getScreenR()
protected void setScreenR(android.graphics.Rect screenR)
protected void drawSeries(XYSeries series, android.graphics.Canvas canvas, android.graphics.Paint paint, java.util.List<java.lang.Float> pointsList, SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, XYMultipleSeriesRenderer.Orientation or)
protected void drawChartValuesText(android.graphics.Canvas canvas, XYSeries series, SimpleSeriesRenderer renderer, android.graphics.Paint paint, float[] points, int seriesIndex)
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 drawnprotected void drawText(android.graphics.Canvas canvas, java.lang.String text, float x, float y, android.graphics.Paint paint, float extraAngle)
canvas
- the canvas to paint totext
- the text to be renderedx
- the X axis location of the texty
- the Y axis location of the textpaint
- the paint to be used for drawingextraAngle
- the text angleprotected java.lang.String getLabel(double label)
label
- the input label value
protected void drawXLabels(java.util.List<java.lang.Double> xLabels, java.lang.Double[] xTextLabelLocations, android.graphics.Canvas canvas, android.graphics.Paint paint, int left, int top, int bottom, double xPixelsPerUnit, double minX, double maxX)
xLabels
- the X labels valuesxTextLabelLocations
- the X text label locationscanvas
- the canvas to paint topaint
- the paint to be used for drawingleft
- the left value of the labels areatop
- the top value of the labels areabottom
- the bottom value of the labels areaxPixelsPerUnit
- the amount of pixels per one unit in the chart labelsminX
- the minimum value on the X axis in the chartmaxX
- the maximum value on the X axis in the chartprotected void drawXTextLabels(java.lang.Double[] xTextLabelLocations, android.graphics.Canvas canvas, android.graphics.Paint paint, boolean showLabels, int left, int top, int bottom, double xPixelsPerUnit, double minX, double maxX)
xTextLabelLocations
- the X text label locationscanvas
- the canvas to paint topaint
- the paint to be used for drawingleft
- the left value of the labels areatop
- the top value of the labels areabottom
- the bottom value of the labels areaxPixelsPerUnit
- the amount of pixels per one unit in the chart labelsminX
- the minimum value on the X axis in the chartmaxX
- the maximum value on the X axis in the chartpublic XYMultipleSeriesRenderer getRenderer()
public XYMultipleSeriesDataset getDataset()
public double[] getCalcRange(int scale)
public void setCalcRange(double[] range, int scale)
public double[] toRealPoint(float screenX, float screenY)
public double[] toScreenPoint(double[] realPoint)
public double[] toRealPoint(float screenX, float screenY, int scale)
screenX
- the screen x axis valuescreenY
- the screen y axis value
public double[] toScreenPoint(double[] realPoint, int scale)
public SeriesSelection getSeriesAndPointForScreenCoordinate(Point screenPoint)
AbstractChart
getSeriesAndPointForScreenCoordinate
in class AbstractChart
public abstract void drawSeries(android.graphics.Canvas canvas, android.graphics.Paint paint, float[] points, SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex)
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 drawnprotected abstract android.graphics.RectF[] clickableAreasForPoints(float[] points, float yAxisValue, int seriesIndex)
points
- the array of pointsyAxisValue
- the minimum value of the y axisseriesIndex
- the index of the series to which the points belong
protected boolean isRenderNullValues()
public boolean isRenderPoints(SimpleSeriesRenderer renderer)
renderer
- the series rendererpublic double getDefaultMinimum()
public ScatterChart getPointsChart()
public abstract java.lang.String getChartType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |