com.androidplot.xy
Class BarRenderer<T extends BarFormatter>

java.lang.Object
  extended by com.androidplot.ui.SeriesRenderer<XYPlot,XYSeries,XYFormatterType>
      extended by com.androidplot.xy.XYSeriesRenderer<T>
          extended by com.androidplot.xy.BarRenderer<T>

public class BarRenderer<T extends BarFormatter>
extends XYSeriesRenderer<T>

Renders a point as a Bar


Nested Class Summary
 class BarRenderer.Bar
           
 class BarRenderer.BarComparator
           
static class BarRenderer.BarRenderStyle
           
static class BarRenderer.BarWidthStyle
           
 
Constructor Summary
BarRenderer(XYPlot plot)
           
 
Method Summary
 void doDrawLegendIcon(android.graphics.Canvas canvas, android.graphics.RectF rect, BarFormatter formatter)
          Draw the legend icon in the rect passed in.
 T getFormatter(int index, XYSeries series)
          Retrieves the BarFormatter instance that corresponds with the series passed in.
 void onRender(android.graphics.Canvas canvas, android.graphics.RectF plotArea)
           
 void setBarComparator(Comparator<BarRenderer.Bar> barComparator)
          Sets a Comparator used for sorting bars.
 void setBarGap(float barGap)
          Sets the size of the gap between the bar (or bar groups) when using the VARIABLE_WIDTH render style
 void setBarRenderStyle(BarRenderer.BarRenderStyle renderStyle)
           
 void setBarWidth(float barWidth)
          Sets the width of the bars when using the FIXED_WIDTH render style
 void setBarWidthStyle(BarRenderer.BarWidthStyle widthStyle)
           
 void setBarWidthStyle(BarRenderer.BarWidthStyle style, float value)
           
 
Methods inherited from class com.androidplot.xy.XYSeriesRenderer
getUniqueRegionFormatters
 
Methods inherited from class com.androidplot.ui.SeriesRenderer
drawSeriesLegendIcon, getFormatter, getPlot, getSeriesAndFormatterList, render, setPlot
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarRenderer

public BarRenderer(XYPlot plot)
Method Detail

setBarWidth

public void setBarWidth(float barWidth)
Sets the width of the bars when using the FIXED_WIDTH render style

Parameters:
barWidth -

setBarGap

public void setBarGap(float barGap)
Sets the size of the gap between the bar (or bar groups) when using the VARIABLE_WIDTH render style

Parameters:
barGap -

setBarRenderStyle

public void setBarRenderStyle(BarRenderer.BarRenderStyle renderStyle)

setBarWidthStyle

public void setBarWidthStyle(BarRenderer.BarWidthStyle widthStyle)

setBarWidthStyle

public void setBarWidthStyle(BarRenderer.BarWidthStyle style,
                             float value)

setBarComparator

public void setBarComparator(Comparator<BarRenderer.Bar> barComparator)
Sets a Comparator used for sorting bars.


doDrawLegendIcon

public void doDrawLegendIcon(android.graphics.Canvas canvas,
                             android.graphics.RectF rect,
                             BarFormatter formatter)
Description copied from class: SeriesRenderer
Draw the legend icon in the rect passed in.


getFormatter

public T getFormatter(int index,
                      XYSeries series)
Retrieves the BarFormatter instance that corresponds with the series passed in. Can be overridden to return other BarFormatters as a result of touch events etc.

Parameters:
index - index of the point being rendered.
series - XYSeries to which the point being rendered belongs.
Returns:

onRender

public void onRender(android.graphics.Canvas canvas,
                     android.graphics.RectF plotArea)
              throws PlotRenderException
Specified by:
onRender in class SeriesRenderer<XYPlot,XYSeries,T extends BarFormatter>
Throws:
PlotRenderException


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