com.androidplot.xy
Class XYGraphWidget

java.lang.Object
  extended by com.androidplot.ui.widget.Widget
      extended by com.androidplot.xy.XYGraphWidget
All Implemented Interfaces:
BoxModelable, Resizable

public class XYGraphWidget
extends Widget

Displays graphical data annotated with domain and range tick markers.


Nested Class Summary
static class XYGraphWidget.XYPlotOrientation
          Will be used in a future version.
 
Constructor Summary
XYGraphWidget(LayoutManager layoutManager, XYPlot plot, SizeMetrics sizeMetrics)
           
 
Method Summary
 void addAxisValueLabelRegion(RectRegion region, AxisValueLabelFormatter formatter)
          Add a new Region used for rendering axis valuelabels.
 void addDomainAxisValueLabelRegion(double min, double max, AxisValueLabelFormatter formatter)
          Convenience method - wraps addAxisValueLabelRegion, using Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY to mask off range axis value labels.
 void addRangeAxisValueLabelRegion(double min, double max, AxisValueLabelFormatter formatter)
          Convenience method - wraps addAxisValueLabelRegion, using Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY to mask off domain axis value labels.
 void drawRangeTick(android.graphics.Canvas canvas, float yPix, Number yVal, android.graphics.Paint labelPaint, android.graphics.Paint linePaint, boolean drawLineOnly)
           
 AxisValueLabelFormatter getAxisValueLabelFormatterForDomainVal(double val)
           
 AxisValueLabelFormatter getAxisValueLabelFormatterForRangeVal(double val)
           
 AxisValueLabelFormatter getAxisValueLabelFormatterForVal(double x, double y)
          Returns the formatter associated with the first (bottom) Region containing x and y.
 ZIndexable<RectRegion> getAxisValueLabelRegions()
           
 android.graphics.Paint getCursorLabelBackgroundPaint()
           
 android.graphics.Paint getCursorLabelPaint()
           
 float getDomainCursorPosition()
           
 Double getDomainCursorVal()
           
 android.graphics.Paint getDomainGridLinePaint()
          Get the paint used to draw the domain grid line.
 float getDomainLabelHorizontalOffset()
           
 float getDomainLabelOrientation()
           
 android.graphics.Paint getDomainLabelPaint()
           
 int getDomainLabelTickExtension()
           
 float getDomainLabelVerticalOffset()
           
 float getDomainLabelWidth()
           
 android.graphics.Paint getDomainOriginLabelPaint()
           
 android.graphics.Paint getDomainOriginLinePaint()
           
 android.graphics.Paint getDomainSubGridLinePaint()
          Get the paint used to draw the domain grid line.
 Format getDomainValueFormat()
           
 android.graphics.Paint getGridBackgroundPaint()
           
 float getGridPaddingBottom()
           
 float getGridPaddingLeft()
           
 float getGridPaddingRight()
           
 float getGridPaddingTop()
           
 android.graphics.RectF getGridRect()
          Returns a RectF representing the grid area last drawn by this plot.
 float getRangeCursorPosition()
           
 Double getRangeCursorVal()
           
 android.graphics.Paint getRangeGridLinePaint()
          Get the paint used to draw the range grid line.
 float getRangeLabelHorizontalOffset()
           
 float getRangeLabelOrientation()
           
 android.graphics.Paint getRangeLabelPaint()
           
 int getRangeLabelTickExtension()
           
 float getRangeLabelVerticalOffset()
           
 float getRangeLabelWidth()
           
 android.graphics.Paint getRangeOriginLabelPaint()
           
 android.graphics.Paint getRangeOriginLinePaint()
           
 android.graphics.Paint getRangeSubGridLinePaint()
          Get the paint used to draw the range grid line.
 Format getRangeValueFormat()
           
 int getTicksPerDomainLabel()
           
 int getTicksPerRangeLabel()
           
 Double getXVal(float xPix)
          Converts an x pixel into an x value.
 Double getXVal(android.graphics.PointF point)
          Convenience method.
 Double getYVal(float yPix)
          Converts a y pixel to a y value.
 Double getYVal(android.graphics.PointF point)
          Convenience method.
 boolean isDomainAxisBottom()
           
 boolean isDrawMarkersEnabled()
           
 boolean isRangeAxisLeft()
           
 void setCursorLabelBackgroundPaint(android.graphics.Paint cursorLabelBackgroundPaint)
           
 void setCursorLabelPaint(android.graphics.Paint cursorLabelPaint)
           
 void setCursorPosition(float x, float y)
           
 void setCursorPosition(android.graphics.PointF point)
           
 void setDomainAxisBottom(boolean domainAxisBottom)
           
 void setDomainAxisPosition(boolean domainAxisBottom, boolean domainAxisOverlay, int tickSize, String maxLabelString)
           
 void setDomainCursorPosition(float domainCursorPosition)
           
 void setDomainGridLinePaint(android.graphics.Paint gridLinePaint)
          Set the paint used to draw the domain grid line.
 void setDomainLabelHorizontalOffset(float domainLabelHorizontalOffset)
           
 void setDomainLabelOrientation(float domainLabelOrientation)
           
 void setDomainLabelPaint(android.graphics.Paint domainLabelPaint)
           
 void setDomainLabelTickExtension(int domainLabelTickExtension)
           
 void setDomainLabelVerticalOffset(float domainLabelVerticalOffset)
           
 void setDomainLabelWidth(float domainLabelWidth)
           
 void setDomainOriginLabelPaint(android.graphics.Paint domainOriginLabelPaint)
           
 void setDomainOriginLinePaint(android.graphics.Paint domainOriginLinePaint)
           
 void setDomainSubGridLinePaint(android.graphics.Paint gridLinePaint)
          Set the paint used to draw the domain grid line.
 void setDomainValueFormat(Format domainValueFormat)
           
 void setDrawMarkersEnabled(boolean drawMarkersEnabled)
           
 void setGridBackgroundPaint(android.graphics.Paint gridBackgroundPaint)
           
 void setGridPadding(float left, float top, float right, float bottom)
           
 void setGridPaddingBottom(float gridPaddingBottom)
           
 void setGridPaddingLeft(float gridPaddingLeft)
           
 void setGridPaddingRight(float gridPaddingRight)
           
 void setGridPaddingTop(float gridPaddingTop)
           
 void setRangeAxisLeft(boolean rangeAxisLeft)
           
 void setRangeAxisPosition(boolean rangeAxisLeft, boolean rangeAxisOverlay, int tickSize, String maxLableString)
           
 void setRangeCursorPosition(float rangeCursorPosition)
           
 void setRangeGridLinePaint(android.graphics.Paint gridLinePaint)
          Set the Paint used to draw the range grid line.
 void setRangeLabelHorizontalOffset(float rangeLabelHorizontalOffset)
           
 void setRangeLabelOrientation(float rangeLabelOrientation)
           
 void setRangeLabelPaint(android.graphics.Paint rangeLabelPaint)
           
 void setRangeLabelTickExtension(int rangeLabelTickExtension)
           
 void setRangeLabelVerticalOffset(float rangeLabelVerticalOffset)
           
 void setRangeLabelWidth(float rangeLabelWidth)
           
 void setRangeOriginLabelPaint(android.graphics.Paint rangeOriginLabelPaint)
           
 void setRangeOriginLinePaint(android.graphics.Paint rangeOriginLinePaint)
           
 void setRangeSubGridLinePaint(android.graphics.Paint gridLinePaint)
          Set the Paint used to draw the range grid line.
 void setRangeValueFormat(Format rangeValueFormat)
           
 void setTicksPerDomainLabel(int ticksPerDomainLabel)
           
 void setTicksPerRangeLabel(int ticksPerRangeLabel)
           
 
Methods inherited from class com.androidplot.ui.widget.Widget
containsPoint, draw, getAnchor, getAnchorCoordinates, getAnchorCoordinates, getAnchorOffset, getBackgroundPaint, getBorderPaint, getElementCoordinates, getHeightMetric, getHeightPix, getMarginatedRect, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddedRect, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPositionMetrics, getWidgetDimensions, getWidthMetric, getWidthPix, isClippingEnabled, isVisible, layout, onPostInit, position, position, refreshLayout, setAnchor, setBackgroundPaint, setBorderPaint, setClippingEnabled, setHeight, setHeight, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginTop, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPositionMetrics, setSize, setVisible, setWidth, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XYGraphWidget

public XYGraphWidget(LayoutManager layoutManager,
                     XYPlot plot,
                     SizeMetrics sizeMetrics)
Method Detail

getRangeLabelOrientation

public float getRangeLabelOrientation()

setRangeLabelOrientation

public void setRangeLabelOrientation(float rangeLabelOrientation)

getDomainLabelOrientation

public float getDomainLabelOrientation()

setDomainLabelOrientation

public void setDomainLabelOrientation(float domainLabelOrientation)

getAxisValueLabelRegions

public ZIndexable<RectRegion> getAxisValueLabelRegions()

addAxisValueLabelRegion

public void addAxisValueLabelRegion(RectRegion region,
                                    AxisValueLabelFormatter formatter)
Add a new Region used for rendering axis valuelabels. Note that it is possible to add multiple Region instances which overlap, in which cast the last region to be added will be used. It is up to the developer to guard against this often undesireable situation.

Parameters:
region -
formatter -

addDomainAxisValueLabelRegion

public void addDomainAxisValueLabelRegion(double min,
                                          double max,
                                          AxisValueLabelFormatter formatter)
Convenience method - wraps addAxisValueLabelRegion, using Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY to mask off range axis value labels.

Parameters:
min -
max -
formatter -

addRangeAxisValueLabelRegion

public void addRangeAxisValueLabelRegion(double min,
                                         double max,
                                         AxisValueLabelFormatter formatter)
Convenience method - wraps addAxisValueLabelRegion, using Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY to mask off domain axis value labels.

Parameters:
min -
max -
formatter -

getAxisValueLabelFormatterForVal

public AxisValueLabelFormatter getAxisValueLabelFormatterForVal(double x,
                                                                double y)
Returns the formatter associated with the first (bottom) Region containing x and y.

Parameters:
x -
y -
Returns:
the formatter associated with the first (bottom) region containing x and y. null otherwise.

getAxisValueLabelFormatterForDomainVal

public AxisValueLabelFormatter getAxisValueLabelFormatterForDomainVal(double val)

getAxisValueLabelFormatterForRangeVal

public AxisValueLabelFormatter getAxisValueLabelFormatterForRangeVal(double val)

getGridRect

public android.graphics.RectF getGridRect()
Returns a RectF representing the grid area last drawn by this plot.

Returns:

getYVal

public Double getYVal(android.graphics.PointF point)
Convenience method. Wraps getYVal(float)

Parameters:
point -
Returns:

getYVal

public Double getYVal(float yPix)
Converts a y pixel to a y value.

Parameters:
yPix -
Returns:

getXVal

public Double getXVal(android.graphics.PointF point)
Convenience method. Wraps getXVal(float)

Parameters:
point -
Returns:

getXVal

public Double getXVal(float xPix)
Converts an x pixel into an x value.

Parameters:
xPix -
Returns:

drawRangeTick

public void drawRangeTick(android.graphics.Canvas canvas,
                          float yPix,
                          Number yVal,
                          android.graphics.Paint labelPaint,
                          android.graphics.Paint linePaint,
                          boolean drawLineOnly)

getDomainLabelWidth

public float getDomainLabelWidth()

setDomainLabelWidth

public void setDomainLabelWidth(float domainLabelWidth)

getRangeLabelWidth

public float getRangeLabelWidth()

setRangeLabelWidth

public void setRangeLabelWidth(float rangeLabelWidth)

getDomainLabelVerticalOffset

public float getDomainLabelVerticalOffset()

setDomainLabelVerticalOffset

public void setDomainLabelVerticalOffset(float domainLabelVerticalOffset)

getDomainLabelHorizontalOffset

public float getDomainLabelHorizontalOffset()

setDomainLabelHorizontalOffset

public void setDomainLabelHorizontalOffset(float domainLabelHorizontalOffset)

getRangeLabelHorizontalOffset

public float getRangeLabelHorizontalOffset()

setRangeLabelHorizontalOffset

public void setRangeLabelHorizontalOffset(float rangeLabelHorizontalOffset)

getRangeLabelVerticalOffset

public float getRangeLabelVerticalOffset()

setRangeLabelVerticalOffset

public void setRangeLabelVerticalOffset(float rangeLabelVerticalOffset)

getGridBackgroundPaint

public android.graphics.Paint getGridBackgroundPaint()

setGridBackgroundPaint

public void setGridBackgroundPaint(android.graphics.Paint gridBackgroundPaint)

getDomainLabelPaint

public android.graphics.Paint getDomainLabelPaint()

setDomainLabelPaint

public void setDomainLabelPaint(android.graphics.Paint domainLabelPaint)

getRangeLabelPaint

public android.graphics.Paint getRangeLabelPaint()

setRangeLabelPaint

public void setRangeLabelPaint(android.graphics.Paint rangeLabelPaint)

getDomainGridLinePaint

public android.graphics.Paint getDomainGridLinePaint()
Get the paint used to draw the domain grid line.


setDomainGridLinePaint

public void setDomainGridLinePaint(android.graphics.Paint gridLinePaint)
Set the paint used to draw the domain grid line.

Parameters:
gridLinePaint -

getRangeGridLinePaint

public android.graphics.Paint getRangeGridLinePaint()
Get the paint used to draw the range grid line.


getDomainSubGridLinePaint

public android.graphics.Paint getDomainSubGridLinePaint()
Get the paint used to draw the domain grid line.


setDomainSubGridLinePaint

public void setDomainSubGridLinePaint(android.graphics.Paint gridLinePaint)
Set the paint used to draw the domain grid line.

Parameters:
gridLinePaint -

setRangeGridLinePaint

public void setRangeGridLinePaint(android.graphics.Paint gridLinePaint)
Set the Paint used to draw the range grid line.

Parameters:
gridLinePaint -

getRangeSubGridLinePaint

public android.graphics.Paint getRangeSubGridLinePaint()
Get the paint used to draw the range grid line.


setRangeSubGridLinePaint

public void setRangeSubGridLinePaint(android.graphics.Paint gridLinePaint)
Set the Paint used to draw the range grid line.

Parameters:
gridLinePaint -

getRangeValueFormat

public Format getRangeValueFormat()

setRangeValueFormat

public void setRangeValueFormat(Format rangeValueFormat)

getDomainValueFormat

public Format getDomainValueFormat()

setDomainValueFormat

public void setDomainValueFormat(Format domainValueFormat)

getDomainLabelTickExtension

public int getDomainLabelTickExtension()

setDomainLabelTickExtension

public void setDomainLabelTickExtension(int domainLabelTickExtension)

getRangeLabelTickExtension

public int getRangeLabelTickExtension()

setRangeLabelTickExtension

public void setRangeLabelTickExtension(int rangeLabelTickExtension)

getTicksPerRangeLabel

public int getTicksPerRangeLabel()

setTicksPerRangeLabel

public void setTicksPerRangeLabel(int ticksPerRangeLabel)

getTicksPerDomainLabel

public int getTicksPerDomainLabel()

setTicksPerDomainLabel

public void setTicksPerDomainLabel(int ticksPerDomainLabel)

setGridPaddingTop

public void setGridPaddingTop(float gridPaddingTop)

getGridPaddingBottom

public float getGridPaddingBottom()

setGridPaddingBottom

public void setGridPaddingBottom(float gridPaddingBottom)

getGridPaddingLeft

public float getGridPaddingLeft()

setGridPaddingLeft

public void setGridPaddingLeft(float gridPaddingLeft)

getGridPaddingRight

public float getGridPaddingRight()

setGridPaddingRight

public void setGridPaddingRight(float gridPaddingRight)

getGridPaddingTop

public float getGridPaddingTop()

setGridPadding

public void setGridPadding(float left,
                           float top,
                           float right,
                           float bottom)

getDomainOriginLinePaint

public android.graphics.Paint getDomainOriginLinePaint()

setDomainOriginLinePaint

public void setDomainOriginLinePaint(android.graphics.Paint domainOriginLinePaint)

getRangeOriginLinePaint

public android.graphics.Paint getRangeOriginLinePaint()

setRangeOriginLinePaint

public void setRangeOriginLinePaint(android.graphics.Paint rangeOriginLinePaint)

getDomainOriginLabelPaint

public android.graphics.Paint getDomainOriginLabelPaint()

setDomainOriginLabelPaint

public void setDomainOriginLabelPaint(android.graphics.Paint domainOriginLabelPaint)

getRangeOriginLabelPaint

public android.graphics.Paint getRangeOriginLabelPaint()

setRangeOriginLabelPaint

public void setRangeOriginLabelPaint(android.graphics.Paint rangeOriginLabelPaint)

setCursorPosition

public void setCursorPosition(float x,
                              float y)

setCursorPosition

public void setCursorPosition(android.graphics.PointF point)

getDomainCursorPosition

public float getDomainCursorPosition()

getDomainCursorVal

public Double getDomainCursorVal()

setDomainCursorPosition

public void setDomainCursorPosition(float domainCursorPosition)

getRangeCursorPosition

public float getRangeCursorPosition()

getRangeCursorVal

public Double getRangeCursorVal()

setRangeCursorPosition

public void setRangeCursorPosition(float rangeCursorPosition)

getCursorLabelPaint

public android.graphics.Paint getCursorLabelPaint()

setCursorLabelPaint

public void setCursorLabelPaint(android.graphics.Paint cursorLabelPaint)

getCursorLabelBackgroundPaint

public android.graphics.Paint getCursorLabelBackgroundPaint()

setCursorLabelBackgroundPaint

public void setCursorLabelBackgroundPaint(android.graphics.Paint cursorLabelBackgroundPaint)

isDrawMarkersEnabled

public boolean isDrawMarkersEnabled()

setDrawMarkersEnabled

public void setDrawMarkersEnabled(boolean drawMarkersEnabled)

isRangeAxisLeft

public boolean isRangeAxisLeft()

setRangeAxisLeft

public void setRangeAxisLeft(boolean rangeAxisLeft)

isDomainAxisBottom

public boolean isDomainAxisBottom()

setDomainAxisBottom

public void setDomainAxisBottom(boolean domainAxisBottom)

setRangeAxisPosition

public void setRangeAxisPosition(boolean rangeAxisLeft,
                                 boolean rangeAxisOverlay,
                                 int tickSize,
                                 String maxLableString)

setDomainAxisPosition

public void setDomainAxisPosition(boolean domainAxisBottom,
                                  boolean domainAxisOverlay,
                                  int tickSize,
                                  String maxLabelString)


Copyright © 2010-2013 androidplot.com. All Rights Reserved.