-
- All Implemented Interfaces:
-
com.androidplot.ui.BoxModelable,com.androidplot.ui.Resizable
public class XYGraphWidget extends Widget
Displays graphical data (lines, points, etc.) annotated with domain and range tick markers. The inner area of the graph upon which grid lines and points are rendered is called the "grid" area.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classXYGraphWidget.LineLabelRendererpublic classXYGraphWidget.LineLabelStylepublic interfaceXYGraphWidget.CursorLabelFormatterpublic enumXYGraphWidget.Edge
-
Field Summary
Fields Modifier and Type Field Description private intlinesPerRangeLabelprivate intlinesPerDomainLabelprivate InsetsgridInsetsprivate InsetslineLabelInsetsprivate RectFgridRectprivate RectFlabelRectprivate floatlineExtensionTopprivate floatlineExtensionBottomprivate floatlineExtensionLeftprivate floatlineExtensionRightprivate PaintgridBackgroundPaintprivate PaintrangeGridLinePaintprivate PaintrangeSubGridLinePaintprivate PaintdomainGridLinePaintprivate PaintdomainSubGridLinePaintprivate booleanisGridClippingEnabledprivate PaintdomainCursorPaintprivate PaintrangeCursorPaintprivate PaintdomainOriginLinePaintprivate PaintrangeOriginLinePaintprivate FloatdomainCursorPositionprivate FloatrangeCursorPositionprivate booleandrawMarkersEnabledprivate booleandrawGridOnTopprivate EnumSet<XYGraphWidget.Edge>lineLabelEdgesprivate XYGraphWidget.CursorLabelFormattercursorLabelFormatter
-
Constructor Summary
Constructors Constructor Description XYGraphWidget(LayoutManager layoutManager, XYPlot plot, Size size)
-
Method Summary
Modifier and Type Method Description intgetLinesPerRangeLabel()voidsetLinesPerRangeLabel(int linesPerRangeLabel)intgetLinesPerDomainLabel()voidsetLinesPerDomainLabel(int linesPerDomainLabel)InsetsgetGridInsets()Grid insets voidsetGridInsets(Insets gridInsets)InsetsgetLineLabelInsets()Domain / Range label insets voidsetLineLabelInsets(Insets lineLabelInsets)RectFgetGridRect()voidsetGridRect(RectF gridRect)RectFgetLabelRect()voidsetLabelRect(RectF labelRect)floatgetLineExtensionTop()voidsetLineExtensionTop(float lineExtensionTop)floatgetLineExtensionBottom()voidsetLineExtensionBottom(float lineExtensionBottom)floatgetLineExtensionLeft()voidsetLineExtensionLeft(float lineExtensionLeft)floatgetLineExtensionRight()voidsetLineExtensionRight(float lineExtensionRight)PaintgetGridBackgroundPaint()voidsetGridBackgroundPaint(Paint gridBackgroundPaint)PaintgetRangeGridLinePaint()Get the paint used to draw the range grid line. voidsetRangeGridLinePaint(Paint gridLinePaint)Set the Paint used to draw the range grid line. PaintgetRangeSubGridLinePaint()Get the paint used to draw the range grid line. voidsetRangeSubGridLinePaint(Paint gridLinePaint)Set the Paint used to draw the range grid line. PaintgetDomainGridLinePaint()Get the paint used to draw the domain grid line. voidsetDomainGridLinePaint(Paint gridLinePaint)Set the paint used to draw the domain grid line. PaintgetDomainSubGridLinePaint()Get the paint used to draw the domain grid line. voidsetDomainSubGridLinePaint(Paint gridLinePaint)Set the paint used to draw the domain grid line. booleanisGridClippingEnabled()PaintgetDomainCursorPaint()voidsetDomainCursorPaint(Paint domainCursorPaint)PaintgetRangeCursorPaint()voidsetRangeCursorPaint(Paint rangeCursorPaint)PaintgetDomainOriginLinePaint()voidsetDomainOriginLinePaint(Paint domainOriginLinePaint)PaintgetRangeOriginLinePaint()voidsetRangeOriginLinePaint(Paint rangeOriginLinePaint)FloatgetDomainCursorPosition()voidsetDomainCursorPosition(Float domainCursorPosition)Set domain cursor position using screen coordinates FloatgetRangeCursorPosition()voidsetRangeCursorPosition(Float rangeCursorPosition)Set range cursor position using screen coordinates voidsetDrawMarkersEnabled(boolean drawMarkersEnabled)voidsetDrawGridOnTop(boolean drawGridOnTop)voidsetLineLabelEdges(Array<XYGraphWidget.Edge> positions)XYGraphWidget.CursorLabelFormattergetCursorLabelFormatter()voidsetCursorLabelFormatter(XYGraphWidget.CursorLabelFormatter cursorLabelFormatter)voidprocessAttrs(TypedArray attrs)Apply xml attrs voidsetCursorPosition(Float x, Float y)Set domain and range cursor position using screen coordinates voidsetCursorPosition(PointF point)Set domain and range cursor position using screen coordinates NumbergetDomainCursorVal()NumbergetRangeCursorVal()booleanisDrawGridOnTop()booleanisDrawMarkersEnabled()XYGraphWidget.LineLabelRenderergetLineLabelRenderer(XYGraphWidget.Edge edge)voidsetLineLabelRenderer(XYGraphWidget.Edge edge, XYGraphWidget.LineLabelRenderer renderer)XYGraphWidget.LineLabelStylegetLineLabelStyle(XYGraphWidget.Edge edge)voidsetLineLabelStyle(XYGraphWidget.Edge edge, XYGraphWidget.LineLabelStyle style)voidsetGridClippingEnabled(boolean gridClippingEnabled)booleanisLineLabelEnabled(XYGraphWidget.Edge position)booleancontainsPoint(float x, float y)Checks whether the point exists within the visible grid space. -
Methods inherited from class com.androidplot.ui.widget.Widget
calculateCoordinates, containsPoint, draw, getAnchor, getAnchorCoordinates, getAnchorCoordinates, getAnchorOffset, getBackgroundPaint, getBorderPaint, getHeightMetric, getHeightPix, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMarginatedRect, getPaddedRect, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPositionMetrics, getRotation, getSize, getWidgetDimensions, getWidthMetric, getWidthPix, isClippingEnabled, isVisible, layout, onPostInit, position, position, refreshLayout, setAnchor, setBackgroundPaint, setBorderPaint, setClippingEnabled, setHeight, setHeight, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMargins, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPositionMetrics, setRotation, setSize, setVisible, setWidth, setWidth -
Methods inherited from class com.androidplot.ui.BoxModelable
getMarginatedRect, getPaddedRect, setMarginBottom -
Methods inherited from class com.androidplot.ui.Resizable
layout -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
XYGraphWidget
XYGraphWidget(LayoutManager layoutManager, XYPlot plot, Size size)
-
-
Method Detail
-
getLinesPerRangeLabel
int getLinesPerRangeLabel()
-
setLinesPerRangeLabel
void setLinesPerRangeLabel(int linesPerRangeLabel)
-
getLinesPerDomainLabel
int getLinesPerDomainLabel()
-
setLinesPerDomainLabel
void setLinesPerDomainLabel(int linesPerDomainLabel)
-
getGridInsets
Insets getGridInsets()
Grid insets
-
setGridInsets
void setGridInsets(Insets gridInsets)
-
getLineLabelInsets
Insets getLineLabelInsets()
Domain / Range label insets
-
setLineLabelInsets
void setLineLabelInsets(Insets lineLabelInsets)
-
getGridRect
RectF getGridRect()
-
setGridRect
void setGridRect(RectF gridRect)
-
getLabelRect
RectF getLabelRect()
-
setLabelRect
void setLabelRect(RectF labelRect)
-
getLineExtensionTop
float getLineExtensionTop()
-
setLineExtensionTop
void setLineExtensionTop(float lineExtensionTop)
-
getLineExtensionBottom
float getLineExtensionBottom()
-
setLineExtensionBottom
void setLineExtensionBottom(float lineExtensionBottom)
-
getLineExtensionLeft
float getLineExtensionLeft()
-
setLineExtensionLeft
void setLineExtensionLeft(float lineExtensionLeft)
-
getLineExtensionRight
float getLineExtensionRight()
-
setLineExtensionRight
void setLineExtensionRight(float lineExtensionRight)
-
getGridBackgroundPaint
Paint getGridBackgroundPaint()
-
setGridBackgroundPaint
void setGridBackgroundPaint(Paint gridBackgroundPaint)
-
getRangeGridLinePaint
Paint getRangeGridLinePaint()
Get the paint used to draw the range grid line.
-
setRangeGridLinePaint
void setRangeGridLinePaint(Paint gridLinePaint)
Set the Paint used to draw the range grid line.
-
getRangeSubGridLinePaint
Paint getRangeSubGridLinePaint()
Get the paint used to draw the range grid line.
-
setRangeSubGridLinePaint
void setRangeSubGridLinePaint(Paint gridLinePaint)
Set the Paint used to draw the range grid line.
-
getDomainGridLinePaint
Paint getDomainGridLinePaint()
Get the paint used to draw the domain grid line.
-
setDomainGridLinePaint
void setDomainGridLinePaint(Paint gridLinePaint)
Set the paint used to draw the domain grid line.
-
getDomainSubGridLinePaint
Paint getDomainSubGridLinePaint()
Get the paint used to draw the domain grid line.
-
setDomainSubGridLinePaint
void setDomainSubGridLinePaint(Paint gridLinePaint)
Set the paint used to draw the domain grid line.
-
isGridClippingEnabled
boolean isGridClippingEnabled()
-
getDomainCursorPaint
Paint getDomainCursorPaint()
-
setDomainCursorPaint
void setDomainCursorPaint(Paint domainCursorPaint)
- Parameters:
domainCursorPaint- The Paint used to draw the domain cursor line.
-
getRangeCursorPaint
Paint getRangeCursorPaint()
-
setRangeCursorPaint
void setRangeCursorPaint(Paint rangeCursorPaint)
- Parameters:
rangeCursorPaint- The Paint used to draw the range cursor line.
-
getDomainOriginLinePaint
Paint getDomainOriginLinePaint()
-
setDomainOriginLinePaint
void setDomainOriginLinePaint(Paint domainOriginLinePaint)
-
getRangeOriginLinePaint
Paint getRangeOriginLinePaint()
-
setRangeOriginLinePaint
void setRangeOriginLinePaint(Paint rangeOriginLinePaint)
-
getDomainCursorPosition
Float getDomainCursorPosition()
-
setDomainCursorPosition
void setDomainCursorPosition(Float domainCursorPosition)
Set domain cursor position using screen coordinates
-
getRangeCursorPosition
Float getRangeCursorPosition()
-
setRangeCursorPosition
void setRangeCursorPosition(Float rangeCursorPosition)
Set range cursor position using screen coordinates
-
setDrawMarkersEnabled
void setDrawMarkersEnabled(boolean drawMarkersEnabled)
-
setDrawGridOnTop
void setDrawGridOnTop(boolean drawGridOnTop)
-
setLineLabelEdges
void setLineLabelEdges(Array<XYGraphWidget.Edge> positions)
-
getCursorLabelFormatter
XYGraphWidget.CursorLabelFormatter getCursorLabelFormatter()
-
setCursorLabelFormatter
void setCursorLabelFormatter(XYGraphWidget.CursorLabelFormatter cursorLabelFormatter)
-
processAttrs
void processAttrs(TypedArray attrs)
Apply xml attrs
-
setCursorPosition
void setCursorPosition(Float x, Float y)
Set domain and range cursor position using screen coordinates
-
setCursorPosition
void setCursorPosition(PointF point)
Set domain and range cursor position using screen coordinates
-
getDomainCursorVal
Number getDomainCursorVal()
-
getRangeCursorVal
Number getRangeCursorVal()
-
isDrawGridOnTop
boolean isDrawGridOnTop()
-
isDrawMarkersEnabled
boolean isDrawMarkersEnabled()
-
getLineLabelRenderer
XYGraphWidget.LineLabelRenderer getLineLabelRenderer(XYGraphWidget.Edge edge)
-
setLineLabelRenderer
void setLineLabelRenderer(XYGraphWidget.Edge edge, XYGraphWidget.LineLabelRenderer renderer)
-
getLineLabelStyle
XYGraphWidget.LineLabelStyle getLineLabelStyle(XYGraphWidget.Edge edge)
-
setLineLabelStyle
void setLineLabelStyle(XYGraphWidget.Edge edge, XYGraphWidget.LineLabelStyle style)
-
setGridClippingEnabled
void setGridClippingEnabled(boolean gridClippingEnabled)
-
isLineLabelEnabled
boolean isLineLabelEnabled(XYGraphWidget.Edge position)
-
containsPoint
boolean containsPoint(float x, float y)
Checks whether the point exists within the visible grid space.
-
-
-
-