| AndBase开发框架 1.6

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

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

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

## Public 成员函数
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 成员函数
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)

## Private 成员函数
String | getFitText (String text, float width, Paint paint)

## 静态 Private 成员函数
static float[] | calculateDrawPoints (float p1x, float p1y, float p2x, float p2y, int screenHeight, int screenWidth)

## 详细描述

An abstract class to be implemented by the chart rendering classes.

## 成员函数说明

static float [] com.ab.view.chart.AbstractChart.calculateDrawPoints | ( | float | p1x,
|  | float | p1y,
|  | float | p2x,
|  | float | p2y,
|  | int | screenHeight,
|  | int | screenWidth
| ) |  |
| inline static private

Calculate draw points.

参数

  p1x | the p1x
  p1y | the p1y
  p2x | the p2x
  p2y | the p2y
  screenHeight | the screen height
  screenWidth | the screen width

返回
  the float[]

abstract void com.ab.view.chart.AbstractChart.draw | ( | Canvas | canvas,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | Paint | paint
| ) |  |
| abstract

The graphical representation of the 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.AbstractChart.drawBackground | ( | DefaultRenderer | renderer,
|  | Canvas | canvas,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | Paint | paint,
|  | boolean | newColor,
|  | int | color
| ) |  |
| inline protected

Draws the chart background.

参数

  renderer | the chart renderer
  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 used for drawing
  newColor | if a new color is to be used
  color | the color to be used

void com.ab.view.chart.AbstractChart.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
| ) |  |
| inline protected

Draws a text label.

参数

  canvas | the canvas
  labelText | the label text
  renderer | the renderer
  prevLabelsBounds | the previous rendered label bounds
  centerX | the round chart center on X axis
  centerY | the round chart center on Y axis
  shortRadius | the short radius for the round chart
  longRadius | the long radius for the round chart
  currentAngle | the current angle
  angle | the label extra angle
  left | the left side
  right | the right side
  color | the label color
  paint | the paint
  line | if a line to the label should be drawn

int com.ab.view.chart.AbstractChart.drawLegend | ( | Canvas | canvas,
|  | DefaultRenderer | renderer,
|  | String[] | titles,
|  | int | left,
|  | int | right,
|  | int | y,
|  | int | width,
|  | int | height,
|  | int | legendSize,
|  | Paint | paint,
|  | boolean | calculate
| ) |  |
| inline protected

Draws the chart legend.

参数

  canvas | the canvas to paint to
  renderer | the series renderer
  titles | the titles to go to the legend
  left | the left X value of the area to draw to
  right | the right X value of the area to draw to
  y | the y value of the area to draw to
  width | the width of the area to draw to
  height | the height of the area to draw to
  legendSize | the legend size
  paint | the paint to be used for drawing
  calculate | if only calculating the legend size

返回
  the legend height

abstract void com.ab.view.chart.AbstractChart.drawLegendShape | ( | Canvas | canvas,
|  | SimpleSeriesRenderer | renderer,
|  | float | x,
|  | float | y,
|  | int | seriesIndex,
|  | Paint | paint
| ) |  |
| abstract

The graphical representation of the legend shape.

参数

  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

void com.ab.view.chart.AbstractChart.drawPath | ( | Canvas | canvas,
|  | float[] | points,
|  | Paint | paint,
|  | boolean | circular
| ) |  |
| inline protected

The graphical representation of a path.

参数

  canvas | the canvas to paint to
  points | the points that are contained in the path to paint
  paint | the paint to be used for painting
  circular | if the path ends with the start point

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

Draw a multiple lines string.

参数

  canvas | the canvas to paint to
  text | the text to be painted
  x | the x value of the area to draw to
  y | the y value of the area to draw to
  paint | the paint to be used for drawing

boolean com.ab.view.chart.AbstractChart.getExceed | ( | float | currentWidth,
|  | DefaultRenderer | renderer,
|  | int | right,
|  | int | width
| ) |  |
| inline protected

Calculates if the current width exceeds the total width.

参数

  currentWidth | the current width
  renderer | the renderer
  right | the right side pixel value
  width | the total width

返回
  if the current width exceeds the total width

String com.ab.view.chart.AbstractChart.getFitText | ( | String | text,
|  | float | width,
|  | Paint | paint
| ) |  |
| inline private

Calculates the best text to fit into the available space.

参数

  text | the entire text
  width | the width to fit the text into
  paint | the paint

返回
  the text to fit into the space

String com.ab.view.chart.AbstractChart.getLabel | ( | double | label | ) |
| inline protected

Makes sure the fraction digit is not displayed, if not needed.

参数

  label | the input label value

返回
  the label without the useless fraction digit

abstract int com.ab.view.chart.AbstractChart.getLegendShapeWidth | ( | int | seriesIndex | ) |
| abstract

Returns the legend shape width.

参数

  seriesIndex | the series index

返回
  the legend shape width

int com.ab.view.chart.AbstractChart.getLegendSize | ( | DefaultRenderer | renderer,
|  | int | defaultHeight,
|  | float | extraHeight
| ) |  |
| inline protected

Calculates the current legend size.

参数

  renderer | the renderer
  defaultHeight | the default height
  extraHeight | the added extra height

返回
  the legend size

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

Given screen coordinates, returns the series and point indexes of a chart element. If there is no chart element (line, point, bar, etc) at those coordinates, null is returned.

参数

  screenPoint | the screen point

返回
  the series and point indexes

boolean com.ab.view.chart.AbstractChart.isNullValue | ( | double | value | ) |
| inline

Checks if is null value.

参数

  value | the value

返回
  true, if is null value

boolean com.ab.view.chart.AbstractChart.isVertical | ( | DefaultRenderer | renderer | ) |
| inline

Checks if the current chart is rendered as vertical.

参数

  renderer | the renderer

返回
  if the chart is rendered as a vertical one

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

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