AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Protected 成员函数 | Private 成员函数 | 静态 Private 成员函数 | 所有成员列表
com.ab.view.chart.AbstractChart类 参考abstract
类 com.ab.view.chart.AbstractChart 继承关系图:
com.ab.view.chart.RoundChart com.ab.view.chart.XYChart com.ab.view.chart.PieChart 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 成员函数

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 
)
inlinestaticprivate

Calculate draw points.

参数
p1xthe p1x
p1ythe p1y
p2xthe p2x
p2ythe p2y
screenHeightthe screen height
screenWidththe 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.

参数
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.AbstractChart.drawBackground ( DefaultRenderer  renderer,
Canvas  canvas,
int  x,
int  y,
int  width,
int  height,
Paint  paint,
boolean  newColor,
int  color 
)
inlineprotected

Draws the chart background.

参数
rendererthe chart renderer
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 used for drawing
newColorif a new color is to be used
colorthe 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 
)
inlineprotected

Draws a text label.

参数
canvasthe canvas
labelTextthe label text
rendererthe renderer
prevLabelsBoundsthe previous rendered label bounds
centerXthe round chart center on X axis
centerYthe round chart center on Y axis
shortRadiusthe short radius for the round chart
longRadiusthe long radius for the round chart
currentAnglethe current angle
anglethe label extra angle
leftthe left side
rightthe right side
colorthe label color
paintthe paint
lineif 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 
)
inlineprotected

Draws the chart legend.

参数
canvasthe canvas to paint to
rendererthe series renderer
titlesthe titles to go to the legend
leftthe left X value of the area to draw to
rightthe right X value of the area to draw to
ythe y value of the area to draw to
widththe width of the area to draw to
heightthe height of the area to draw to
legendSizethe legend size
paintthe paint to be used for drawing
calculateif 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.

参数
canvasthe canvas to paint to
rendererthe series renderer
xthe x value of the point the shape should be drawn at
ythe y value of the point the shape should be drawn at
seriesIndexthe series index
paintthe paint to be used for drawing
void com.ab.view.chart.AbstractChart.drawPath ( Canvas  canvas,
float[]  points,
Paint  paint,
boolean  circular 
)
inlineprotected

The graphical representation of a path.

参数
canvasthe canvas to paint to
pointsthe points that are contained in the path to paint
paintthe paint to be used for painting
circularif the path ends with the start point
void com.ab.view.chart.AbstractChart.drawString ( Canvas  canvas,
String  text,
float  x,
float  y,
Paint  paint 
)
inlineprotected

Draw a multiple lines string.

参数
canvasthe canvas to paint to
textthe text to be painted
xthe x value of the area to draw to
ythe y value of the area to draw to
paintthe paint to be used for drawing
boolean com.ab.view.chart.AbstractChart.getExceed ( float  currentWidth,
DefaultRenderer  renderer,
int  right,
int  width 
)
inlineprotected

Calculates if the current width exceeds the total width.

参数
currentWidththe current width
rendererthe renderer
rightthe right side pixel value
widththe total width
返回
if the current width exceeds the total width
String com.ab.view.chart.AbstractChart.getFitText ( String  text,
float  width,
Paint  paint 
)
inlineprivate

Calculates the best text to fit into the available space.

参数
textthe entire text
widththe width to fit the text into
paintthe paint
返回
the text to fit into the space
String com.ab.view.chart.AbstractChart.getLabel ( double  label)
inlineprotected

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

参数
labelthe 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.

参数
seriesIndexthe series index
返回
the legend shape width
int com.ab.view.chart.AbstractChart.getLegendSize ( DefaultRenderer  renderer,
int  defaultHeight,
float  extraHeight 
)
inlineprotected

Calculates the current legend size.

参数
rendererthe renderer
defaultHeightthe default height
extraHeightthe 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.

参数
screenPointthe screen point
返回
the series and point indexes
boolean com.ab.view.chart.AbstractChart.isNullValue ( double  value)
inline

Checks if is null value.

参数
valuethe 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.

参数
rendererthe renderer
返回
if the chart is rendered as a vertical one

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