-
- 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 class
XYGraphWidget.LineLabelRenderer
public class
XYGraphWidget.LineLabelStyle
public interface
XYGraphWidget.CursorLabelFormatter
public enum
XYGraphWidget.Edge
-
Field Summary
Fields Modifier and Type Field Description private int
linesPerRangeLabel
private int
linesPerDomainLabel
private Insets
gridInsets
private Insets
lineLabelInsets
private RectF
gridRect
private RectF
labelRect
private float
lineExtensionTop
private float
lineExtensionBottom
private float
lineExtensionLeft
private float
lineExtensionRight
private Paint
gridBackgroundPaint
private Paint
rangeGridLinePaint
private Paint
rangeSubGridLinePaint
private Paint
domainGridLinePaint
private Paint
domainSubGridLinePaint
private boolean
isGridClippingEnabled
private Paint
domainCursorPaint
private Paint
rangeCursorPaint
private Paint
domainOriginLinePaint
private Paint
rangeOriginLinePaint
private Float
domainCursorPosition
private Float
rangeCursorPosition
private boolean
drawMarkersEnabled
private boolean
drawGridOnTop
private EnumSet<XYGraphWidget.Edge>
lineLabelEdges
private XYGraphWidget.CursorLabelFormatter
cursorLabelFormatter
-
Constructor Summary
Constructors Constructor Description XYGraphWidget(LayoutManager layoutManager, XYPlot plot, Size size)
-
Method Summary
Modifier and Type Method Description int
getLinesPerRangeLabel()
void
setLinesPerRangeLabel(int linesPerRangeLabel)
int
getLinesPerDomainLabel()
void
setLinesPerDomainLabel(int linesPerDomainLabel)
Insets
getGridInsets()
Grid insets void
setGridInsets(Insets gridInsets)
Insets
getLineLabelInsets()
Domain / Range label insets void
setLineLabelInsets(Insets lineLabelInsets)
RectF
getGridRect()
void
setGridRect(RectF gridRect)
RectF
getLabelRect()
void
setLabelRect(RectF labelRect)
float
getLineExtensionTop()
void
setLineExtensionTop(float lineExtensionTop)
float
getLineExtensionBottom()
void
setLineExtensionBottom(float lineExtensionBottom)
float
getLineExtensionLeft()
void
setLineExtensionLeft(float lineExtensionLeft)
float
getLineExtensionRight()
void
setLineExtensionRight(float lineExtensionRight)
Paint
getGridBackgroundPaint()
void
setGridBackgroundPaint(Paint gridBackgroundPaint)
Paint
getRangeGridLinePaint()
Get the paint used to draw the range grid line. void
setRangeGridLinePaint(Paint gridLinePaint)
Set the Paint used to draw the range grid line. Paint
getRangeSubGridLinePaint()
Get the paint used to draw the range grid line. void
setRangeSubGridLinePaint(Paint gridLinePaint)
Set the Paint used to draw the range grid line. Paint
getDomainGridLinePaint()
Get the paint used to draw the domain grid line. void
setDomainGridLinePaint(Paint gridLinePaint)
Set the paint used to draw the domain grid line. Paint
getDomainSubGridLinePaint()
Get the paint used to draw the domain grid line. void
setDomainSubGridLinePaint(Paint gridLinePaint)
Set the paint used to draw the domain grid line. boolean
isGridClippingEnabled()
Paint
getDomainCursorPaint()
void
setDomainCursorPaint(Paint domainCursorPaint)
Paint
getRangeCursorPaint()
void
setRangeCursorPaint(Paint rangeCursorPaint)
Paint
getDomainOriginLinePaint()
void
setDomainOriginLinePaint(Paint domainOriginLinePaint)
Paint
getRangeOriginLinePaint()
void
setRangeOriginLinePaint(Paint rangeOriginLinePaint)
Float
getDomainCursorPosition()
void
setDomainCursorPosition(Float domainCursorPosition)
Set domain cursor position using screen coordinates Float
getRangeCursorPosition()
void
setRangeCursorPosition(Float rangeCursorPosition)
Set range cursor position using screen coordinates void
setDrawMarkersEnabled(boolean drawMarkersEnabled)
void
setDrawGridOnTop(boolean drawGridOnTop)
void
setLineLabelEdges(Array<XYGraphWidget.Edge> positions)
XYGraphWidget.CursorLabelFormatter
getCursorLabelFormatter()
void
setCursorLabelFormatter(XYGraphWidget.CursorLabelFormatter cursorLabelFormatter)
void
processAttrs(TypedArray attrs)
Apply xml attrs void
setCursorPosition(Float x, Float y)
Set domain and range cursor position using screen coordinates void
setCursorPosition(PointF point)
Set domain and range cursor position using screen coordinates Number
getDomainCursorVal()
Number
getRangeCursorVal()
boolean
isDrawGridOnTop()
boolean
isDrawMarkersEnabled()
XYGraphWidget.LineLabelRenderer
getLineLabelRenderer(XYGraphWidget.Edge edge)
void
setLineLabelRenderer(XYGraphWidget.Edge edge, XYGraphWidget.LineLabelRenderer renderer)
XYGraphWidget.LineLabelStyle
getLineLabelStyle(XYGraphWidget.Edge edge)
void
setLineLabelStyle(XYGraphWidget.Edge edge, XYGraphWidget.LineLabelStyle style)
void
setGridClippingEnabled(boolean gridClippingEnabled)
boolean
isLineLabelEnabled(XYGraphWidget.Edge position)
boolean
containsPoint(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.
-
-
-
-