org.achartengine.renderer
Class DefaultRenderer

java.lang.Object
  extended by org.achartengine.renderer.DefaultRenderer
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DialRenderer, XYMultipleSeriesRenderer

public class DefaultRenderer
extends java.lang.Object
implements java.io.Serializable

An abstract renderer to be extended by the multiple series classes.

See Also:
Serialized Form

Field Summary
static int BACKGROUND_COLOR
          The default background color.
static int NO_COLOR
          A no color constant.
static int TEXT_COLOR
          The default color for text.
 
Constructor Summary
DefaultRenderer()
           
 
Method Summary
 void addSeriesRenderer(int index, SimpleSeriesRenderer renderer)
          Adds a simple renderer to the multiple renderer.
 void addSeriesRenderer(SimpleSeriesRenderer renderer)
          Adds a simple renderer to the multiple renderer.
 int getAxesColor()
          Returns the axes color.
 int getBackgroundColor()
          Returns the background color.
 java.lang.String getChartTitle()
          Returns the chart title.
 float getChartTitleTextSize()
          Returns the chart title text size.
 int getLabelsColor()
          Returns the labels color.
 float getLabelsTextSize()
          Returns the labels text size.
 int getLegendHeight()
          Returns the legend height.
 float getLegendTextSize()
          Returns the legend text size.
 int[] getMargins()
          Returns the margin sizes.
 float getOriginalScale()
          Returns the original value to be used for scaling the chart.
 float getScale()
          Returns the value to be used for scaling the chart.
 int getSelectableBuffer()
          Returns the selectable radius value around clickable points.
 SimpleSeriesRenderer getSeriesRendererAt(int index)
          Returns the simple renderer from the multiple renderer list.
 int getSeriesRendererCount()
          Returns the simple renderers count in the multiple renderer list.
 SimpleSeriesRenderer[] getSeriesRenderers()
          Returns an array of the simple renderers in the multiple renderer list.
 float getStartAngle()
          Returns the start angle for circular charts such as pie, doughnut.
 android.graphics.Typeface getTextTypeface()
          Returns the text typeface.
 java.lang.String getTextTypefaceName()
          Returns the text typeface name.
 int getTextTypefaceStyle()
          Returns the text typeface style.
 float getZoomRate()
          Returns the zoom rate.
 boolean isAntialiasing()
          Returns the antialiasing flag value.
 boolean isApplyBackgroundColor()
          Returns if the background color should be applied.
 boolean isClickEnabled()
          Returns the enabled state of the click.
 boolean isDisplayValues()
          Returns if the values should be displayed as text.
 boolean isExternalZoomEnabled()
          Returns the enabled state of the external (application implemented) zoom.
 boolean isFitLegend()
          Returns if the legend should size to fit.
 boolean isInScroll()
          Returns if the chart is inside a scroll view and doesn't need to shrink.
 boolean isPanEnabled()
          Returns the enabled state of the pan.
 boolean isShowAxes()
          Returns if the axes should be visible.
 boolean isShowCustomTextGrid()
          Returns if the grid should be visible for custom X or Y labels.
 boolean isShowGridX()
          Returns if the X axis grid should be visible.
 boolean isShowGridY()
          Returns if the Y axis grid should be visible.
 boolean isShowLabels()
          Returns if the labels should be visible.
 boolean isShowLegend()
          Returns if the legend should be visible.
 boolean isZoomButtonsVisible()
          Returns the visible state of the zoom buttons.
 boolean isZoomEnabled()
          Returns the enabled state of the zoom.
 void removeAllRenderers()
          Removes all renderers from the multiple renderer.
 void removeSeriesRenderer(SimpleSeriesRenderer renderer)
          Removes a simple renderer from the multiple renderer.
 void setAntialiasing(boolean antialiasing)
          Sets the antialiasing value.
 void setApplyBackgroundColor(boolean apply)
          Sets if the background color should be applied.
 void setAxesColor(int color)
          Sets the axes color.
 void setBackgroundColor(int color)
          Sets the background color.
 void setChartTitle(java.lang.String title)
          Sets the chart title.
 void setChartTitleTextSize(float textSize)
          Sets the chart title text size.
 void setClickEnabled(boolean enabled)
          Sets the enabled state of the click.
 void setDisplayValues(boolean display)
          Sets if the values should be displayed as text (supported by pie chart).
 void setExternalZoomEnabled(boolean enabled)
          Sets the enabled state of the external (application implemented) zoom.
 void setFitLegend(boolean fit)
          Sets if the legend should size to fit.
 void setInScroll(boolean inScroll)
          To be set if the chart is inside a scroll view and doesn't need to shrink when not enough space.
 void setLabelsColor(int color)
          Sets the labels color.
 void setLabelsTextSize(float textSize)
          Sets the labels text size.
 void setLegendHeight(int height)
          Sets the legend height, in pixels.
 void setLegendTextSize(float textSize)
          Sets the legend text size.
 void setMargins(int[] margins)
          Sets the margins, in pixels.
 void setPanEnabled(boolean enabled)
          Sets the enabled state of the pan.
 void setScale(float scale)
          Sets the value to be used for scaling the chart.
 void setSelectableBuffer(int buffer)
          Sets the selectable radius value around clickable points.
 void setShowAxes(boolean showAxes)
          Sets if the axes should be visible.
 void setShowCustomTextGrid(boolean showGrid)
          Sets if the grid for custom X or Y labels should be visible.
 void setShowGrid(boolean showGrid)
          Sets if the grid should be visible.
 void setShowGridX(boolean showGrid)
          Sets if the X axis grid should be visible.
 void setShowGridY(boolean showGrid)
          Sets if the Y axis grid should be visible.
 void setShowLabels(boolean showLabels)
          Sets if the labels should be visible.
 void setShowLegend(boolean showLegend)
          Sets if the legend should be visible.
 void setStartAngle(float startAngle)
          Sets the start angle for circular charts such as pie, doughnut, etc.
 void setTextTypeface(java.lang.String typefaceName, int style)
          Sets the text typeface name and style.
 void setTextTypeface(android.graphics.Typeface typeface)
          Sets the text typeface.
 void setZoomButtonsVisible(boolean visible)
          Sets the visible state of the zoom buttons.
 void setZoomEnabled(boolean enabled)
          Sets the enabled state of the zoom.
 void setZoomRate(float rate)
          Sets the zoom rate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_COLOR

public static final int NO_COLOR
A no color constant.

See Also:
Constant Field Values

BACKGROUND_COLOR

public static final int BACKGROUND_COLOR
The default background color.

See Also:
Constant Field Values

TEXT_COLOR

public static final int TEXT_COLOR
The default color for text.

See Also:
Constant Field Values
Constructor Detail

DefaultRenderer

public DefaultRenderer()
Method Detail

getChartTitle

public java.lang.String getChartTitle()
Returns the chart title.

Returns:
the chart title

setChartTitle

public void setChartTitle(java.lang.String title)
Sets the chart title.

Parameters:
title - the chart title

getChartTitleTextSize

public float getChartTitleTextSize()
Returns the chart title text size.

Returns:
the chart title text size

setChartTitleTextSize

public void setChartTitleTextSize(float textSize)
Sets the chart title text size.

Parameters:
textSize - the chart title text size

addSeriesRenderer

public void addSeriesRenderer(SimpleSeriesRenderer renderer)
Adds a simple renderer to the multiple renderer.

Parameters:
renderer - the renderer to be added

addSeriesRenderer

public void addSeriesRenderer(int index,
                              SimpleSeriesRenderer renderer)
Adds a simple renderer to the multiple renderer.

Parameters:
index - the index in the renderers list
renderer - the renderer to be added

removeSeriesRenderer

public void removeSeriesRenderer(SimpleSeriesRenderer renderer)
Removes a simple renderer from the multiple renderer.

Parameters:
renderer - the renderer to be removed

removeAllRenderers

public void removeAllRenderers()
Removes all renderers from the multiple renderer.


getSeriesRendererAt

public SimpleSeriesRenderer getSeriesRendererAt(int index)
Returns the simple renderer from the multiple renderer list.

Parameters:
index - the index in the simple renderers list
Returns:
the simple renderer at the specified index

getSeriesRendererCount

public int getSeriesRendererCount()
Returns the simple renderers count in the multiple renderer list.

Returns:
the simple renderers count

getSeriesRenderers

public SimpleSeriesRenderer[] getSeriesRenderers()
Returns an array of the simple renderers in the multiple renderer list.

Returns:
the simple renderers array

getBackgroundColor

public int getBackgroundColor()
Returns the background color.

Returns:
the background color

setBackgroundColor

public void setBackgroundColor(int color)
Sets the background color.

Parameters:
color - the background color

isApplyBackgroundColor

public boolean isApplyBackgroundColor()
Returns if the background color should be applied.

Returns:
the apply flag for the background color.

setApplyBackgroundColor

public void setApplyBackgroundColor(boolean apply)
Sets if the background color should be applied.

Parameters:
apply - the apply flag for the background color

getAxesColor

public int getAxesColor()
Returns the axes color.

Returns:
the axes color

setAxesColor

public void setAxesColor(int color)
Sets the axes color.

Parameters:
color - the axes color

getLabelsColor

public int getLabelsColor()
Returns the labels color.

Returns:
the labels color

setLabelsColor

public void setLabelsColor(int color)
Sets the labels color.

Parameters:
color - the labels color

getLabelsTextSize

public float getLabelsTextSize()
Returns the labels text size.

Returns:
the labels text size

setLabelsTextSize

public void setLabelsTextSize(float textSize)
Sets the labels text size.

Parameters:
textSize - the labels text size

isShowAxes

public boolean isShowAxes()
Returns if the axes should be visible.

Returns:
the visibility flag for the axes

setShowAxes

public void setShowAxes(boolean showAxes)
Sets if the axes should be visible.

Parameters:
showAxes - the visibility flag for the axes

isShowLabels

public boolean isShowLabels()
Returns if the labels should be visible.

Returns:
the visibility flag for the labels

setShowLabels

public void setShowLabels(boolean showLabels)
Sets if the labels should be visible.

Parameters:
showLabels - the visibility flag for the labels

isShowGridX

public boolean isShowGridX()
Returns if the X axis grid should be visible.

Returns:
the visibility flag for the X axis grid

isShowGridY

public boolean isShowGridY()
Returns if the Y axis grid should be visible.

Returns:
the visibility flag for the Y axis grid

setShowGridX

public void setShowGridX(boolean showGrid)
Sets if the X axis grid should be visible.

Parameters:
showGrid - the visibility flag for the X axis grid

setShowGridY

public void setShowGridY(boolean showGrid)
Sets if the Y axis grid should be visible.

Parameters:
showGrid - the visibility flag for the Y axis grid

setShowGrid

public void setShowGrid(boolean showGrid)
Sets if the grid should be visible.

Parameters:
showGrid - the visibility flag for the grid

isShowCustomTextGrid

public boolean isShowCustomTextGrid()
Returns if the grid should be visible for custom X or Y labels.

Returns:
the visibility flag for the custom text grid

setShowCustomTextGrid

public void setShowCustomTextGrid(boolean showGrid)
Sets if the grid for custom X or Y labels should be visible.

Parameters:
showGrid - the visibility flag for the custom text grid

isShowLegend

public boolean isShowLegend()
Returns if the legend should be visible.

Returns:
the visibility flag for the legend

setShowLegend

public void setShowLegend(boolean showLegend)
Sets if the legend should be visible.

Parameters:
showLegend - the visibility flag for the legend

isFitLegend

public boolean isFitLegend()
Returns if the legend should size to fit.

Returns:
the fit behavior

setFitLegend

public void setFitLegend(boolean fit)
Sets if the legend should size to fit.

Parameters:
fit - the fit behavior

getTextTypefaceName

public java.lang.String getTextTypefaceName()
Returns the text typeface name.

Returns:
the text typeface name

getTextTypefaceStyle

public int getTextTypefaceStyle()
Returns the text typeface style.

Returns:
the text typeface style

getTextTypeface

public android.graphics.Typeface getTextTypeface()
Returns the text typeface.

Returns:
the text typeface

getLegendTextSize

public float getLegendTextSize()
Returns the legend text size.

Returns:
the legend text size

setLegendTextSize

public void setLegendTextSize(float textSize)
Sets the legend text size.

Parameters:
textSize - the legend text size

setTextTypeface

public void setTextTypeface(java.lang.String typefaceName,
                            int style)
Sets the text typeface name and style.

Parameters:
typefaceName - the text typeface name
style - the text typeface style

setTextTypeface

public void setTextTypeface(android.graphics.Typeface typeface)
Sets the text typeface.

Parameters:
typeface - the typeface

isAntialiasing

public boolean isAntialiasing()
Returns the antialiasing flag value.

Returns:
the antialiasing value

setAntialiasing

public void setAntialiasing(boolean antialiasing)
Sets the antialiasing value.

Parameters:
antialiasing - the antialiasing

getScale

public float getScale()
Returns the value to be used for scaling the chart.

Returns:
the scale value

getOriginalScale

public float getOriginalScale()
Returns the original value to be used for scaling the chart.

Returns:
the original scale value

setScale

public void setScale(float scale)
Sets the value to be used for scaling the chart. It works on some charts like pie, doughnut, dial.

Parameters:
scale - the scale value

isZoomEnabled

public boolean isZoomEnabled()
Returns the enabled state of the zoom.

Returns:
if zoom is enabled

setZoomEnabled

public void setZoomEnabled(boolean enabled)
Sets the enabled state of the zoom.

Parameters:
enabled - zoom enabled

isZoomButtonsVisible

public boolean isZoomButtonsVisible()
Returns the visible state of the zoom buttons.

Returns:
if zoom buttons are visible

setZoomButtonsVisible

public void setZoomButtonsVisible(boolean visible)
Sets the visible state of the zoom buttons.

Parameters:
visible - if the zoom buttons are visible

isExternalZoomEnabled

public boolean isExternalZoomEnabled()
Returns the enabled state of the external (application implemented) zoom.

Returns:
if external zoom is enabled

setExternalZoomEnabled

public void setExternalZoomEnabled(boolean enabled)
Sets the enabled state of the external (application implemented) zoom.

Parameters:
enabled - external zoom enabled

getZoomRate

public float getZoomRate()
Returns the zoom rate.

Returns:
the zoom rate

isPanEnabled

public boolean isPanEnabled()
Returns the enabled state of the pan.

Returns:
if pan is enabled

setPanEnabled

public void setPanEnabled(boolean enabled)
Sets the enabled state of the pan.

Parameters:
enabled - pan enabled

setZoomRate

public void setZoomRate(float rate)
Sets the zoom rate.

Parameters:
rate - the zoom rate

isClickEnabled

public boolean isClickEnabled()
Returns the enabled state of the click.

Returns:
if click is enabled

setClickEnabled

public void setClickEnabled(boolean enabled)
Sets the enabled state of the click.

Parameters:
enabled - click enabled

getSelectableBuffer

public int getSelectableBuffer()
Returns the selectable radius value around clickable points.

Returns:
the selectable radius

setSelectableBuffer

public void setSelectableBuffer(int buffer)
Sets the selectable radius value around clickable points.

Parameters:
buffer - the selectable radius

getLegendHeight

public int getLegendHeight()
Returns the legend height.

Returns:
the legend height

setLegendHeight

public void setLegendHeight(int height)
Sets the legend height, in pixels.

Parameters:
height - the legend height

getMargins

public int[] getMargins()
Returns the margin sizes. An array containing the margins in this order: top, left, bottom, right

Returns:
the margin sizes

setMargins

public void setMargins(int[] margins)
Sets the margins, in pixels.

Parameters:
margins - an array containing the margin size values, in this order: top, left, bottom, right

isInScroll

public boolean isInScroll()
Returns if the chart is inside a scroll view and doesn't need to shrink.

Returns:
if it is inside a scroll view

setInScroll

public void setInScroll(boolean inScroll)
To be set if the chart is inside a scroll view and doesn't need to shrink when not enough space.

Parameters:
inScroll - if it is inside a scroll view

getStartAngle

public float getStartAngle()
Returns the start angle for circular charts such as pie, doughnut. An angle of 0 degrees correspond to the geometric angle of 0 degrees (3 o'clock on a watch.)

Returns:
the start angle in degrees

setStartAngle

public void setStartAngle(float startAngle)
Sets the start angle for circular charts such as pie, doughnut, etc. An angle of 0 degrees correspond to the geometric angle of 0 degrees (3 o'clock on a watch.)

Parameters:
startAngle - the start angle in degrees

isDisplayValues

public boolean isDisplayValues()
Returns if the values should be displayed as text.

Returns:
if the values should be displayed as text

setDisplayValues

public void setDisplayValues(boolean display)
Sets if the values should be displayed as text (supported by pie chart).

Parameters:
display - if the values should be displayed as text


Copyright © 2009 - 2011 4ViewSoft. All Rights Reserved.