| AndBase开发框架 1.6

- 首页
- 相关页面
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 枚举值 页
Public 成员函数 | Protected 成员函数 | Protected 属性 | Private 成员函数 | Private 属性 | 所有成员列表
com.ab.view.chart.XYChart类 参考abstract
类 com.ab.view.chart.XYChart 继承关系图:

## 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 | ( |  | ) |
| inline protected

Instantiates a new xY chart.

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

Builds a new XY chart instance.

参数

  dataset | the multiple series dataset
  renderer | the multiple series renderer

## 成员函数说明

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

Returns the clickable areas for all passed points.

参数

  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

返回
  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.

参数

  canvas | the canvas to paint to
  x | the top left x value of the view to draw to
  y | the top left y value of the view to draw to
  width | the width of the view to draw to
  height | the height of the view to draw to
  paint | the paint

void com.ab.view.chart.XYChart.drawChartValuesText | ( | Canvas | canvas,
|  | XYSeries | series,
|  | SimpleSeriesRenderer | renderer,
|  | Paint | paint,
|  | float[] | points,
|  | int | seriesIndex,
|  | int | startIndex
| ) |  |
| inline protected

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

参数

  canvas | the canvas to paint to
  series | the series to be painted
  renderer | the series renderer
  paint | the paint to be used for drawing
  points | the array of points to be used for drawing the series
  seriesIndex | the index of the series currently being drawn
  startIndex | the 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
| ) |  |
| inline protected

Draws the series.

参数

  series | the series
  canvas | the canvas
  paint | the paint object
  pointsList | the points to be rendered
  colorsList | the colors list
  seriesRenderer | the series renderer
  yAxisValue | the y axis value in pixels
  seriesIndex | the series index
  or | the orientation
  startIndex | the 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.

参数

  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
  colors | the colors
  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

void com.ab.view.chart.XYChart.drawText | ( | Canvas | canvas,
|  | String | text,
|  | float | x,
|  | float | y,
|  | Paint | paint,
|  | float | extraAngle
| ) |  |
| inline protected

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

参数

  canvas | the canvas to paint to
  text | the text to be rendered
  x | the X axis location of the text
  y | the Y axis location of the text
  paint | the paint to be used for drawing
  extraAngle | the 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
| ) |  |
| inline protected

The graphical representation of the labels on the X axis.

参数

  xLabels | the X labels values
  xTextLabelLocations | the X text label locations
  canvas | the canvas to paint to
  paint | the paint to be used for drawing
  left | the left value of the labels area
  top | the top value of the labels area
  bottom | the bottom value of the labels area
  xPixelsPerUnit | the amount of pixels per one unit in the chart labels
  minX | the minimum value on the X axis in the chart
  maxX | the 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
| ) |  |
| inline protected

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

参数

  xTextLabelLocations | the X text label locations
  canvas | the canvas to paint to
  paint | the paint to be used for drawing
  showLabels | the show labels
  left | the left value of the labels area
  top | the top value of the labels area
  bottom | the bottom value of the labels area
  xPixelsPerUnit | the amount of pixels per one unit in the chart labels
  minX | the minimum value on the X axis in the chart
  maxX | the 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
| ) |  |
| inline protected

The graphical representation of the labels on the X axis.

参数

  allYLabels | the Y labels values
  canvas | the canvas to paint to
  paint | the paint to be used for drawing
  maxScaleNumber | the maximum scale number
  left | the left value of the labels area
  right | the right value of the labels area
  bottom | the bottom value of the labels area
  yPixelsPerUnit | the amount of pixels per one unit in the chart labels
  minY | the minimum value on the Y axis in the chart

double [] com.ab.view.chart.XYChart.getCalcRange | ( | int | scale | ) |
| inline

Gets the calc range.

参数

  scale | the 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 | ) |
| inline private

Gets the label line pos.

参数

  align | the 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 | ( |  | ) |
| inline protected

Gets the screen r.

返回
  the screen r

SeriesSelection com.ab.view.chart.XYChart.getSeriesAndPointForScreenCoordinate | ( | final Point | screenPoint | ) |
| inline

描述：TODO.

版本
  v1.0

参数

  screenPoint | the 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 | ) |
| inline private

Gets the valid labels.

参数

  labels | the 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
| ) |  |
| inline protected

Gets the x labels.

参数

  min | the min
  max | the max
  count | the count

返回
  the x labels

Map<Integer, List<Double> > com.ab.view.chart.XYChart.getYLabels | ( | double[] | minY,
|  | double[] | maxY,
|  | int | maxScaleNumber
| ) |  |
| inline protected

Gets the y labels.

参数

  minY | the min y
  maxY | the max y
  maxScaleNumber | the max scale number

返回
  the y labels

boolean com.ab.view.chart.XYChart.isRenderNullValues | ( |  | ) |
| inline protected

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.

参数

  renderer | the series renderer

返回
  true, if is render points

void com.ab.view.chart.XYChart.setCalcRange | ( | double[] | range,
|  | int | scale
| ) |  |
| inline

Sets the calc range.

参数

  range | the range
  scale | the scale

void com.ab.view.chart.XYChart.setDatasetRenderer | ( | XYMultipleSeriesDataset | dataset,
|  | XYMultipleSeriesRenderer | renderer
| ) |  |
| inline protected

Sets the dataset renderer.

参数

  dataset | the dataset
  renderer | the renderer

void com.ab.view.chart.XYChart.setScreenR | ( | Rect | screenR | ) |
| inline protected

Sets the screen r.

参数

  screenR | the new screen r

void com.ab.view.chart.XYChart.setStroke | ( | Cap | cap,
|  | Join | join,
|  | float | miter,
|  | Style | style,
|  | PathEffect | pathEffect,
|  | Paint | paint
| ) |  |
| inline private

Sets the stroke.

参数

  cap | the cap
  join | the join
  miter | the miter
  style | the style
  pathEffect | the path effect
  paint | the paint

double [] com.ab.view.chart.XYChart.toRealPoint | ( | float | screenX,
|  | float | screenY
| ) |  |
| inline

To real point.

参数

  screenX | the screen x
  screenY | the 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.

参数

  screenX | the screen x axis value
  screenY | the screen y axis value
  scale | the scale

返回
  the real coordinates point

double [] com.ab.view.chart.XYChart.toScreenPoint | ( | double[] | realPoint | ) |
| inline

To screen point.

参数

  realPoint | the real point

返回
  the double[]

double [] com.ab.view.chart.XYChart.toScreenPoint | ( | double[] | realPoint,
|  | int | scale
| ) |  |
| inline

To screen point.

参数

  realPoint | the real point
  scale | the scale

返回
  the double[]

void com.ab.view.chart.XYChart.transform | ( | Canvas | canvas,
|  | float | angle,
|  | boolean | inverse
| ) |  |
| inline private

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

参数

  canvas | the canvas to paint to
  angle | the angle of rotation
  inverse | if 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

点的值.

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

- src/com/ab/view/chart/XYChart.java