Package totalcross.ui.chart
Class ArcChart
- java.lang.Object
-
- totalcross.ui.gfx.GfxSurface
-
- totalcross.ui.Control
-
- totalcross.ui.chart.Chart
-
- totalcross.ui.chart.ArcChart
-
public class ArcChart extends Chart
A simple pie chart.
The values do not have to be in percentage; the percentage is computed based on the series values. If the user clicks on the slice, a popup shows the corresponding value. By setting the legendValueSuffix to "%", the value displayed will be the percentage instead of the serie's value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class totalcross.ui.Control
Control.TranslucentShape
-
-
Field Summary
Fields Modifier and Type Field Description intborderGapA gap between the chart and the bordersintfillPercThe percentage of the filled circle.java.lang.StringlegendValueSuffixThe suffix used in the legend to display the values.intselectedSeriesSpecifies the selected pie.booleanshowValuesOnLegendSet to true to show the values in the legend.-
Fields inherited from class totalcross.ui.chart.Chart
axisBackColor, axisForeColor, axisText, border, categoryMarkColor, categoryMarkIndex, clientRect, COLOR1, COLOR2, COLOR3, COLOR4, COLOR5, COLOR6, COLOR7, COLOR8, COLOR9, columnW, drawAxis, fillColor2, GRADIENT_DARK, GRADIENT_HORIZONTAL, GRADIENT_INVERT, GRADIENT_VERTICAL, IS_3D, legendPerspective, legendPosition, legendTextColor, legendValues, onlyShowCategories, series, showCategories, showCategoriesOnTick, showFirstYValue, showHGrids, showLegend, showTextBox, showTitle, showVGrids, showYValues, snapToBottom, snapToTop, title, type, UNSET, use2ndColorEveryXColumns, xAxisCategories, xAxisMaxValue, xAxisMinValue, xAxisSteps, xAxisX1, xAxisX2, xDecimalPlaces, yAxisMaxValue, yAxisMinValue, yAxisSteps, yAxisY1, yAxisY2, yDecimalPlaces, yValuesSize
-
Fields inherited from class totalcross.ui.Control
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 Summary
Constructors Constructor Description ArcChart()Creates a new Pie chart.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidgetCustomInsets(Insets r)voidonEvent(Event e)Called to process key, pen, control and other posted events.voidonFontChanged()Called after a setFontvoidonPaint(Graphics g)Called to draw the control.-
Methods inherited from class totalcross.ui.chart.Chart
draw, drawTextBox, drawTextBox, getTitle, getXValuePos, getYValuePos, setTitle, setXAxis, setXAxis, setYAxis
-
Methods inherited from class totalcross.ui.Control
_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, 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
-
-
-
-
Field Detail
-
selectedSeries
public int selectedSeries
Specifies the selected pie.
-
legendValueSuffix
public java.lang.String legendValueSuffix
The suffix used in the legend to display the values. E.G.: "%". Defaults to blank.
-
showValuesOnLegend
public boolean showValuesOnLegend
Set to true to show the values in the legend.
-
fillPerc
public int fillPerc
The percentage of the filled circle.
-
borderGap
public int borderGap
A gap between the chart and the borders
-
-
Method Detail
-
getCustomInsets
protected void getCustomInsets(Insets r)
- Overrides:
getCustomInsetsin classChart
-
onPaint
public void onPaint(Graphics g)
Description copied from class:ControlCalled to draw the control. When this method is called, the graphics object passed has been translated into the coordinate system of the control and the area behind the control has already been painted.
-
onEvent
public void onEvent(Event e)
Description copied from class:ControlCalled to process key, pen, control and other posted events.
-
onFontChanged
public void onFontChanged()
Description copied from class:ControlCalled after a setFont- Overrides:
onFontChangedin classControl
-
-