AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Protected 成员函数 | Protected 属性 | Private 成员函数 | Private 属性 | 所有成员列表
com.ab.view.chart.XYChart类 参考abstract
类 com.ab.view.chart.XYChart 继承关系图:
com.ab.view.chart.AbstractChart com.ab.view.chart.BarChart com.ab.view.chart.LineChart com.ab.view.chart.ScatterChart com.ab.view.chart.AreaChart com.ab.view.chart.TimeChart

Public 成员函数

 XYChart (XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
 
void draw (Canvas canvas, int x, int y, int width, int height, Paint paint)
 
XYMultipleSeriesRenderer getRenderer ()
 
XYMultipleSeriesDataset getDataset ()
 
double[] getCalcRange (int scale)
 
void setCalcRange (double[] range, int scale)
 
double[] toRealPoint (float screenX, float screenY)
 
double[] toScreenPoint (double[] realPoint)
 
double[] toRealPoint (float screenX, float screenY, int scale)
 
double[] toScreenPoint (double[] realPoint, int scale)
 
SeriesSelection getSeriesAndPointForScreenCoordinate (final Point screenPoint)
 
abstract void drawSeries (Canvas canvas, Paint paint, float[] points, int[] colors, SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex)
 
boolean isRenderPoints (SimpleSeriesRenderer renderer)
 
double getDefaultMinimum ()
 
ScatterChart getPointsChart ()
 
abstract String getChartType ()
 
Map< Integer, List< Float > > getPoints ()
 
Map< Integer, List< Double > > getValues ()
 
Map< Integer, List< String > > getExplains ()
 
- Public 成员函数 继承自 com.ab.view.chart.AbstractChart
abstract void draw (Canvas canvas, int x, int y, int width, int height, Paint paint)
 
boolean isVertical (DefaultRenderer renderer)
 
abstract int getLegendShapeWidth (int seriesIndex)
 
abstract void drawLegendShape (Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint)
 
boolean isNullValue (double value)
 
SeriesSelection getSeriesAndPointForScreenCoordinate (Point screenPoint)
 

Protected 成员函数

 XYChart ()
 
void setDatasetRenderer (XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)
 
List< Double > getXLabels (double min, double max, int count)
 
Map< Integer, List< Double > > getYLabels (double[] minY, double[] maxY, int maxScaleNumber)
 
Rect getScreenR ()
 
void setScreenR (Rect screenR)
 
void drawSeries (XYSeries series, Canvas canvas, Paint paint, List< Float > pointsList, List< Integer > colorsList, SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, Orientation or, int startIndex)
 
void drawChartValuesText (Canvas canvas, XYSeries series, SimpleSeriesRenderer renderer, Paint paint, float[] points, int seriesIndex, int startIndex)
 
void drawText (Canvas canvas, String text, float x, float y, Paint paint, float extraAngle)
 
void drawXLabels (List< Double > xLabels, Double[] xTextLabelLocations, Canvas canvas, Paint paint, int left, int top, int bottom, double xPixelsPerUnit, double minX, double maxX)
 
void drawYLabels (Map< Integer, List< Double >> allYLabels, Canvas canvas, Paint paint, int maxScaleNumber, int left, int right, int bottom, double[] yPixelsPerUnit, double[] minY)
 
void drawXTextLabels (Double[] xTextLabelLocations, Canvas canvas, Paint paint, boolean showLabels, int left, int top, int bottom, double xPixelsPerUnit, double minX, double maxX)
 
abstract ClickableArea[] clickableAreasForPoints (float[] points, double[] values, float yAxisValue, int seriesIndex, int startIndex)
 
boolean isRenderNullValues ()
 
- Protected 成员函数 继承自 com.ab.view.chart.AbstractChart
void drawBackground (DefaultRenderer renderer, Canvas canvas, int x, int y, int width, int height, Paint paint, boolean newColor, int color)
 
int drawLegend (Canvas canvas, DefaultRenderer renderer, String[] titles, int left, int right, int y, int width, int height, int legendSize, Paint paint, boolean calculate)
 
void drawString (Canvas canvas, String text, float x, float y, Paint paint)
 
boolean getExceed (float currentWidth, DefaultRenderer renderer, int right, int width)
 
String getLabel (double label)
 
void drawPath (Canvas canvas, float[] points, Paint paint, boolean circular)
 
int getLegendSize (DefaultRenderer renderer, int defaultHeight, float extraHeight)
 
void drawLabel (Canvas canvas, String labelText, DefaultRenderer renderer, List< RectF > prevLabelsBounds, int centerX, int centerY, float shortRadius, float longRadius, float currentAngle, float angle, int left, int right, int color, Paint paint, boolean line)
 

Protected 属性

XYMultipleSeriesDataset mDataset
 
XYMultipleSeriesRenderer mRenderer
 

Private 成员函数

List< Double > getValidLabels (List< Double > labels)
 
void setStroke (Cap cap, Join join, float miter, Style style, PathEffect pathEffect, Paint paint)
 
void transform (Canvas canvas, float angle, boolean inverse)
 
int getLabelLinePos (Align align)
 

Private 属性

float mScale
 
float mTranslate
 
Point mCenter
 
Rect mScreenR
 
final Map< Integer, double[]> mCalcRange = new HashMap<Integer, double[]>()
 
Map< Integer, List
< ClickableArea > > 
clickableAreas = new HashMap<Integer, List<ClickableArea>>()
 
Map< Integer, List< Double > > values = new HashMap<Integer, List<Double>>()
 
Map< Integer, List< Float > > points = new HashMap<Integer, List<Float>>()
 
final Map< Integer, List
< Integer > > 
colors = new HashMap<Integer, List<Integer>>()
 
final Map< Integer, List
< String > > 
explains = new HashMap<Integer, List<String>>()
 

详细描述

The XY chart rendering class.

构造及析构函数说明

com.ab.view.chart.XYChart.XYChart ( )
inlineprotected

Instantiates a new xY chart.

com.ab.view.chart.XYChart.XYChart ( XYMultipleSeriesDataset  dataset,
XYMultipleSeriesRenderer  renderer 
)
inline

Builds a new XY chart instance.

参数
datasetthe multiple series dataset
rendererthe multiple series renderer

成员函数说明

abstract ClickableArea [] com.ab.view.chart.XYChart.clickableAreasForPoints ( float[]  points,
double[]  values,
float  yAxisValue,
int  seriesIndex,
int  startIndex 
)
abstractprotected

Returns the clickable areas for all passed points.

参数
pointsthe array of points
valuesthe array of values of each point
yAxisValuethe minimum value of the y axis
seriesIndexthe index of the series to which the points belong
startIndexthe start index of the rendering points
返回
an array of rectangles with the clickable area
void com.ab.view.chart.XYChart.draw ( Canvas  canvas,
int  x,
int  y,
int  width,
int  height,
Paint  paint 
)
inline

The graphical representation of the XY chart.

参数
canvasthe canvas to paint to
xthe top left x value of the view to draw to
ythe top left y value of the view to draw to
widththe width of the view to draw to
heightthe height of the view to draw to
paintthe paint
void com.ab.view.chart.XYChart.drawChartValuesText ( Canvas  canvas,
XYSeries  series,
SimpleSeriesRenderer  renderer,
Paint  paint,
float[]  points,
int  seriesIndex,
int  startIndex 
)
inlineprotected

The graphical representation of the series values as text. 绘制点上的文本 显示的文本判断两点之间距离100以内不显示中间的点的文本

参数
canvasthe canvas to paint to
seriesthe series to be painted
rendererthe series renderer
paintthe paint to be used for drawing
pointsthe array of points to be used for drawing the series
seriesIndexthe index of the series currently being drawn
startIndexthe start index of the rendering points
void com.ab.view.chart.XYChart.drawSeries ( XYSeries  series,
Canvas  canvas,
Paint  paint,
List< Float >  pointsList,
List< Integer >  colorsList,
SimpleSeriesRenderer  seriesRenderer,
float  yAxisValue,
int  seriesIndex,
Orientation  or,
int  startIndex 
)
inlineprotected

Draws the series.

参数
seriesthe series
canvasthe canvas
paintthe paint object
pointsListthe points to be rendered
colorsListthe colors list
seriesRendererthe series renderer
yAxisValuethe y axis value in pixels
seriesIndexthe series index
orthe orientation
startIndexthe start index of the rendering points
abstract void com.ab.view.chart.XYChart.drawSeries ( Canvas  canvas,
Paint  paint,
float[]  points,
int[]  colors,
SimpleSeriesRenderer  seriesRenderer,
float  yAxisValue,
int  seriesIndex,
int  startIndex 
)
abstract

The graphical representation of a series.

参数
canvasthe canvas to paint to
paintthe paint to be used for drawing
pointsthe array of points to be used for drawing the series
colorsthe colors
seriesRendererthe series renderer
yAxisValuethe minimum value of the y axis
seriesIndexthe index of the series currently being drawn
startIndexthe start index of the rendering points
void com.ab.view.chart.XYChart.drawText ( Canvas  canvas,
String  text,
float  x,
float  y,
Paint  paint,
float  extraAngle 
)
inlineprotected

The graphical representation of a text, to handle both HORIZONTAL and VERTICAL orientations and extra rotation angles.

参数
canvasthe canvas to paint to
textthe text to be rendered
xthe X axis location of the text
ythe Y axis location of the text
paintthe paint to be used for drawing
extraAnglethe text angle
void com.ab.view.chart.XYChart.drawXLabels ( List< Double >  xLabels,
Double[]  xTextLabelLocations,
Canvas  canvas,
Paint  paint,
int  left,
int  top,
int  bottom,
double  xPixelsPerUnit,
double  minX,
double  maxX 
)
inlineprotected

The graphical representation of the labels on the X axis.

参数
xLabelsthe X labels values
xTextLabelLocationsthe X text label locations
canvasthe canvas to paint to
paintthe paint to be used for drawing
leftthe left value of the labels area
topthe top value of the labels area
bottomthe bottom value of the labels area
xPixelsPerUnitthe amount of pixels per one unit in the chart labels
minXthe minimum value on the X axis in the chart
maxXthe maximum value on the X axis in the chart
void com.ab.view.chart.XYChart.drawXTextLabels ( Double[]  xTextLabelLocations,
Canvas  canvas,
Paint  paint,
boolean  showLabels,
int  left,
int  top,
int  bottom,
double  xPixelsPerUnit,
double  minX,
double  maxX 
)
inlineprotected

The graphical representation of the text labels on the X axis.

参数
xTextLabelLocationsthe X text label locations
canvasthe canvas to paint to
paintthe paint to be used for drawing
showLabelsthe show labels
leftthe left value of the labels area
topthe top value of the labels area
bottomthe bottom value of the labels area
xPixelsPerUnitthe amount of pixels per one unit in the chart labels
minXthe minimum value on the X axis in the chart
maxXthe maximum value on the X axis in the chart
void com.ab.view.chart.XYChart.drawYLabels ( Map< Integer, List< Double >>  allYLabels,
Canvas  canvas,
Paint  paint,
int  maxScaleNumber,
int  left,
int  right,
int  bottom,
double[]  yPixelsPerUnit,
double[]  minY 
)
inlineprotected

The graphical representation of the labels on the X axis.

参数
allYLabelsthe Y labels values
canvasthe canvas to paint to
paintthe paint to be used for drawing
maxScaleNumberthe maximum scale number
leftthe left value of the labels area
rightthe right value of the labels area
bottomthe bottom value of the labels area
yPixelsPerUnitthe amount of pixels per one unit in the chart labels
minYthe minimum value on the Y axis in the chart
double [] com.ab.view.chart.XYChart.getCalcRange ( int  scale)
inline

Gets the calc range.

参数
scalethe scale
返回
the calc range
abstract String com.ab.view.chart.XYChart.getChartType ( )
abstract

Returns the chart type identifier.

返回
the chart type
XYMultipleSeriesDataset com.ab.view.chart.XYChart.getDataset ( )
inline

Gets the dataset.

返回
the dataset
double com.ab.view.chart.XYChart.getDefaultMinimum ( )
inline

Returns the default axis minimum.

返回
the default axis minimum
Map<Integer, List<String> > com.ab.view.chart.XYChart.getExplains ( )
inline

描述:获取点的说明.

返回
the explains
int com.ab.view.chart.XYChart.getLabelLinePos ( Align  align)
inlineprivate

Gets the label line pos.

参数
alignthe align
返回
the label line pos
Map<Integer, List<Float> > com.ab.view.chart.XYChart.getPoints ( )
inline

描述:获取点的坐标值 形如(1,2,2,3) 标示2个点,x=1 y=2是一个点 ,另一个点是x=2 y=3.

返回
the points
ScatterChart com.ab.view.chart.XYChart.getPointsChart ( )
inline

Returns the scatter chart to be used for drawing the data points.

返回
the data points scatter chart
XYMultipleSeriesRenderer com.ab.view.chart.XYChart.getRenderer ( )
inline

描述:获取这个XY复合渲染器.

返回
the renderer
Rect com.ab.view.chart.XYChart.getScreenR ( )
inlineprotected

Gets the screen r.

返回
the screen r
SeriesSelection com.ab.view.chart.XYChart.getSeriesAndPointForScreenCoordinate ( final Point  screenPoint)
inline

描述:TODO.

版本
v1.0
参数
screenPointthe screen point
返回
the series and point for screen coordinate
参见
com.ab.view.chart.AbstractChart::getSeriesAndPointForScreenCoordinate(com.ab.view.chart.Point)
作者
: amsoft.cn
日期
:2013-6-17 上午9:04:49
List<Double> com.ab.view.chart.XYChart.getValidLabels ( List< Double >  labels)
inlineprivate

Gets the valid labels.

参数
labelsthe labels
返回
the valid labels
Map<Integer, List<Double> > com.ab.view.chart.XYChart.getValues ( )
inline

描述:获取点的值.

返回
the values
List<Double> com.ab.view.chart.XYChart.getXLabels ( double  min,
double  max,
int  count 
)
inlineprotected

Gets the x labels.

参数
minthe min
maxthe max
countthe count
返回
the x labels
Map<Integer, List<Double> > com.ab.view.chart.XYChart.getYLabels ( double[]  minY,
double[]  maxY,
int  maxScaleNumber 
)
inlineprotected

Gets the y labels.

参数
minYthe min y
maxYthe max y
maxScaleNumberthe max scale number
返回
the y labels
boolean com.ab.view.chart.XYChart.isRenderNullValues ( )
inlineprotected

Returns if the chart should display the null values.

返回
if null values should be rendered
boolean com.ab.view.chart.XYChart.isRenderPoints ( SimpleSeriesRenderer  renderer)
inline

Returns if the chart should display the points as a certain shape.

参数
rendererthe series renderer
返回
true, if is render points
void com.ab.view.chart.XYChart.setCalcRange ( double[]  range,
int  scale 
)
inline

Sets the calc range.

参数
rangethe range
scalethe scale
void com.ab.view.chart.XYChart.setDatasetRenderer ( XYMultipleSeriesDataset  dataset,
XYMultipleSeriesRenderer  renderer 
)
inlineprotected

Sets the dataset renderer.

参数
datasetthe dataset
rendererthe renderer
void com.ab.view.chart.XYChart.setScreenR ( Rect  screenR)
inlineprotected

Sets the screen r.

参数
screenRthe new screen r
void com.ab.view.chart.XYChart.setStroke ( Cap  cap,
Join  join,
float  miter,
Style  style,
PathEffect  pathEffect,
Paint  paint 
)
inlineprivate

Sets the stroke.

参数
capthe cap
jointhe join
miterthe miter
stylethe style
pathEffectthe path effect
paintthe paint
double [] com.ab.view.chart.XYChart.toRealPoint ( float  screenX,
float  screenY 
)
inline

To real point.

参数
screenXthe screen x
screenYthe screen y
返回
the double[]
double [] com.ab.view.chart.XYChart.toRealPoint ( float  screenX,
float  screenY,
int  scale 
)
inline

Transforms a screen point to a real coordinates point.

参数
screenXthe screen x axis value
screenYthe screen y axis value
scalethe scale
返回
the real coordinates point
double [] com.ab.view.chart.XYChart.toScreenPoint ( double[]  realPoint)
inline

To screen point.

参数
realPointthe real point
返回
the double[]
double [] com.ab.view.chart.XYChart.toScreenPoint ( double[]  realPoint,
int  scale 
)
inline

To screen point.

参数
realPointthe real point
scalethe scale
返回
the double[]
void com.ab.view.chart.XYChart.transform ( Canvas  canvas,
float  angle,
boolean  inverse 
)
inlineprivate

Transform the canvas such as it can handle both HORIZONTAL and VERTICAL orientations.

参数
canvasthe canvas to paint to
anglethe angle of rotation
inverseif the inverse transform needs to be applied

类成员变量说明

Map<Integer, List<ClickableArea> > com.ab.view.chart.XYChart.clickableAreas = new HashMap<Integer, List<ClickableArea>>()
private

The clickable areas for all points. The array index is the series index, and the RectF list index is the point index in that series.

final Map<Integer, List<Integer> > com.ab.view.chart.XYChart.colors = new HashMap<Integer, List<Integer>>()
private

每个数据点的简要 说明.

final Map<Integer, List<String> > com.ab.view.chart.XYChart.explains = new HashMap<Integer, List<String>>()
private

每个数据点的简要 说明.

final Map<Integer, double[]> com.ab.view.chart.XYChart.mCalcRange = new HashMap<Integer, double[]>()
private

The calculated range.

Point com.ab.view.chart.XYChart.mCenter
private

The canvas center point.

XYMultipleSeriesDataset com.ab.view.chart.XYChart.mDataset
protected

The multiple series dataset.

XYMultipleSeriesRenderer com.ab.view.chart.XYChart.mRenderer
protected

The multiple series renderer.

float com.ab.view.chart.XYChart.mScale
private

The current scale value.

Rect com.ab.view.chart.XYChart.mScreenR
private

The visible chart area, in screen coordinates.

float com.ab.view.chart.XYChart.mTranslate
private

The current translate value.

Map<Integer, List<Float> > com.ab.view.chart.XYChart.points = new HashMap<Integer, List<Float>>()
private

点的真实坐标.

Map<Integer, List<Double> > com.ab.view.chart.XYChart.values = new HashMap<Integer, List<Double>>()
private

点的值.


该类的文档由以下文件生成: