public class Chart extends Control
ColumnChart
,
LineChart
,
PieChart
,
XYChart
Control.TranslucentShape
Modifier and Type | Field and Description |
---|---|
int |
axisBackColor
Color used in the axis lines.
|
int |
axisForeColor
Color used in the axis lines.
|
int |
axisText
Color used in the axis text (x,y values).
|
Insets |
border
This chart's empty border dimensions
|
int |
categoryMarkColor
The color for the category mark.
|
int |
categoryMarkIndex
The index where the category mark is shown.
|
protected Rect |
clientRect |
static int |
COLOR1
Sample gray color to be used in the chart, taken from here.
|
static int |
COLOR2
Sample blue color to be used in the chart, taken from here.
|
static int |
COLOR3
Sample orange color to be used in the chart, taken from here.
|
static int |
COLOR4
Sample green color to be used in the chart, taken from here.
|
static int |
COLOR5
Sample pink color to be used in the chart, taken from here.
|
static int |
COLOR6
Sample brown color to be used in the chart, taken from here.
|
static int |
COLOR7
Sample purple color to be used in the chart, taken from here.
|
static int |
COLOR8
Sample yellow color to be used in the chart, taken from here.
|
static int |
COLOR9
Sample red color to be used in the chart, taken from here.
|
int |
columnW |
protected boolean |
drawAxis
Flag that indicates if the axis must be drawn.
|
int |
fillColor2 |
static int |
GRADIENT_DARK
Indicates a dark gradient.
|
static int |
GRADIENT_HORIZONTAL
Indicates a horizontal gradient.
|
static int |
GRADIENT_INVERT
Indicates to invert the gradient direction.
|
static int |
GRADIENT_VERTICAL
Indicates a vertical gradient.
|
static int |
IS_3D
Indicates a 3D chart.
|
int |
legendPerspective
Perspective distance for the Legend.
|
int |
legendPosition
The position of the legend.
|
int |
legendTextColor
The text color for the legend.
|
protected java.lang.String[] |
legendValues
Values that may be shown with the legend.
|
boolean |
onlyShowCategories |
Vector |
series
The series that are currently added to this chart
|
boolean |
showCategories
Flag to indicate whether the categories must be painted
|
boolean |
showCategoriesOnTick
Flag to indicate whether the categories must be painted on the next tick.
The field showCategories must also be set to true.Special values for categories on tick: "|" - Paints a line using the axis fore color. |
boolean |
showFirstYValue
Shows the first y value or not.
|
boolean |
showHGrids
Flag to indicate whether the Y grids must be painted
|
boolean |
showLegend
Flag to indicate whether the legend must be painted
|
java.lang.Boolean |
showTextBox
Flag to indicate whether the textbox must be painted
|
boolean |
showTitle
Flag to indicate whether the title must be painted
|
boolean |
showVGrids
Flag to indicate whether the X grids must be painted
|
boolean |
showYValues
Flag to indicate whether the y values must be painted
|
boolean |
snapToBottom
Set to true to let a ChartData be snapped at the bottom.
|
boolean |
snapToTop
Set to true to let a ChartData be snapped at the top.
|
protected java.lang.String |
title
This chart's title
|
int |
type
The chart type.
|
static int |
UNSET |
int |
use2ndColorEveryXColumns |
protected java.lang.String[] |
xAxisCategories
The categories of the X axis (may be null if X is a value axis)
|
double |
xAxisMaxValue
The value for the end of the X axis
|
double |
xAxisMinValue
The value for the origin of the X axis
|
int |
xAxisSteps
The number of subdivisions of the X axis
|
int |
xAxisX1
The relative screen position of the X axis origin
|
int |
xAxisX2
The relative screen position of the X axis end
|
int |
xDecimalPlaces
The number of decimal places to show the data of the X axis.
|
protected double |
yAxisMaxValue
The value for the end of the Y axis
|
protected double |
yAxisMinValue
The value for the origin of the Y axis
|
protected int |
yAxisSteps
The number of subdivisions of the Y axis
|
int |
yAxisY1
The relative screen position of the Y axis origin
|
int |
yAxisY2
The relative screen position of the Y axis end
|
int |
yDecimalPlaces
The number of decimal places to show the data of the Y axis.
|
int |
yValuesSize
Defines a value that will be used as the y-value width.
|
AFTER, alphaValue, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, BRIGHTER_BACKGROUND, callListenersOnAllTargets, CENTER, CENTER_OF, clearValueInt, clearValueStr, DARKER_BACKGROUND, DP, effect, enableUpdateScreen, esce, eventsEnabled, FILL, fillColor, FIT, floating, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, FONTSIZE, foreColor, height, ignoreInsets, isHighlighting, isTablet, KEEP, keepDisabled, keepEnabled, LEFT, next, nextTabControl, npParts, offscreen, offscreen0, onEventFirst, parent, PARENTSIZE, PARENTSIZEMAX, PARENTSIZEMIN, PREFERRED, prev, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, SCREENSIZE, SCREENSIZEMAX, SCREENSIZEMIN, setFont, setH, setRel, setW, setX, SETX_NOT_SET, setY, tempW, textShadowColor, TOP, translucentShape, transparentBackground, uiAdjustmentsBasedOnFontHeightIsSupported, uiAndroid, UICONST, uiFlat, uiHolo, uiMaterial, uiVista, visible, width, WILL_RESIZE, x, y
Constructor and Description |
---|
Chart() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
draw(Graphics g)
Draws the chart's basic features.
|
protected void |
drawTextBox(Graphics g,
int refX,
int refY,
java.lang.String text)
Draws a box to display a text in the chart area
|
protected void |
drawTextBox(Graphics g,
int refX,
int refY,
java.lang.String text,
int back) |
protected void |
getCustomInsets(Insets r) |
java.lang.String |
getTitle() |
int |
getXValuePos(double value)
Calculates the screen position of a value in the X axis according to
its current minimum and maximum values.
|
int |
getYValuePos(double value)
Calculates the screen position of a value in the Y axis according to
its current minimum and maximum values.
|
void |
setTitle(java.lang.String title)
Sets this chart's title
|
void |
setXAxis(double min,
double max,
int steps)
Sets the X axis as a value axis given the minimum (its origin) and
the maximum values to be used
|
void |
setXAxis(java.lang.String[] categories)
Sets the X axis as a category axis
|
void |
setYAxis(double min,
double max,
int steps)
Sets the Y axis given the minimum (its origin) and the maximum values
to be used
|
_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, clear, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, getEffectH, getEffectW, getEffectX, getEffectY, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPreferredHeight, getPreferredWidth, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, handleGeographicalFocusChangeKeys, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isTopMost, isVisible, isVisibleAndInside, onBoundsChanged, onColorsChanged, onEvent, onFontChanged, onPaint, onWindowPaintFinished, post, postEvent, postPressedEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, reposition, reposition, repositionChildren, requestFocus, resetSetPositions, resetStyle, safeRepaintNow, safeUpdateScreen, sendToBack, setBackColor, setBackForeColors, setDoEffect, setEnabled, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
public static final int COLOR1
public static final int COLOR2
public static final int COLOR3
public static final int COLOR4
public static final int COLOR5
public static final int COLOR6
public static final int COLOR7
public static final int COLOR8
public static final int COLOR9
public static final int IS_3D
type
,
Constant Field Valuespublic static final int GRADIENT_HORIZONTAL
type
,
Constant Field Valuespublic static final int GRADIENT_VERTICAL
type
,
Constant Field Valuespublic static final int GRADIENT_DARK
type
,
Constant Field Valuespublic static final int GRADIENT_INVERT
type
,
Constant Field Valuespublic int type
chart.type = Chart.IS_3D | Chart.GRADIENT_HORIZONTAL | Chart.GRADIENT_DARK;
IS_3D
,
GRADIENT_HORIZONTAL
,
GRADIENT_VERTICAL
,
GRADIENT_DARK
,
GRADIENT_INVERT
protected java.lang.String title
public Vector series
public double xAxisMinValue
public double xAxisMaxValue
public int xAxisSteps
protected java.lang.String[] xAxisCategories
protected double yAxisMinValue
protected double yAxisMaxValue
protected int yAxisSteps
public int xAxisX1
public int xAxisX2
public int yAxisY1
public int yAxisY2
public Insets border
public boolean showTitle
public boolean showLegend
public boolean showCategories
public java.lang.Boolean showTextBox
public boolean showCategoriesOnTick
showCategories
must also be set to true.showCategories
public int categoryMarkIndex
public int categoryMarkColor
public boolean showYValues
public boolean showVGrids
public boolean showHGrids
public int xDecimalPlaces
public int yDecimalPlaces
public int legendPosition
public int legendPerspective
protected boolean drawAxis
public boolean showFirstYValue
public int axisForeColor
public int axisBackColor
public int axisText
protected java.lang.String[] legendValues
protected Rect clientRect
public boolean snapToBottom
public boolean snapToTop
public int yValuesSize
public int legendTextColor
public int fillColor2
public int use2ndColorEveryXColumns
public boolean onlyShowCategories
public int columnW
public static final int UNSET
public void setTitle(java.lang.String title)
title
- the new titlepublic java.lang.String getTitle()
public void setXAxis(double min, double max, int steps)
min
- the minimum value (the axis origin)max
- the maximum value (the axis end)steps
- the number of subdivisions of the axispublic void setXAxis(java.lang.String[] categories)
categories
- the categories' namespublic void setYAxis(double min, double max, int steps)
min
- the minimum value (the axis origin)max
- the maximum value (the axis end)steps
- the number of subdivisions of the axisprotected void getCustomInsets(Insets r)
protected boolean draw(Graphics g)
g
- The graphics object.protected void drawTextBox(Graphics g, int refX, int refY, java.lang.String text)
text
- the text to be displayedrefX
- the X position of the anchor pointrefY
- the Y position of the anchor pointprotected void drawTextBox(Graphics g, int refX, int refY, java.lang.String text, int back)
public int getXValuePos(double value)
draw
value
- the valuedraw(Graphics)
public int getYValuePos(double value)
draw
value
- the valuedraw(Graphics)