public class DefaultRenderer

  1. Object
  2. DefaultRenderer

Known subtypesDialRenderer, XYMultipleSeriesRenderer

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

Fields

public static final int NO_COLOR = 0A no color constant.
public static final int BACKGROUND_COLOR = 0The default background color.
public static final int TEXT_COLOR = 15395562The default color for text.

Constructors

public DefaultRenderer()

Methods

public String getChartTitle()Returns the chart title.
public void setChartTitle(String title)Sets the chart title.
public float getChartTitleTextSize()Returns the chart title text size.
public void setChartTitleTextSize(float textSize)Sets the chart title text size in pixels.
public void setChartTitleTextFont(Font font)Sets the chart title font size using a Font object instead of a point size.
public void addSeriesRenderer(SimpleSeriesRenderer renderer)Adds a simple renderer to the multiple renderer.
public void addSeriesRenderer(int index, SimpleSeriesRenderer renderer)Adds a simple renderer to the multiple renderer.
public void removeSeriesRenderer(SimpleSeriesRenderer renderer)Removes a simple renderer from the multiple renderer.
public void removeAllRenderers()Removes all renderers from the multiple renderer.
public SimpleSeriesRenderer getSeriesRendererAt(int index)Returns the simple renderer from the multiple renderer list.
public int getSeriesRendererCount()Returns the simple renderers count in the multiple renderer list.
public SimpleSeriesRenderer[] getSeriesRenderers()Returns an array of the simple renderers in the multiple renderer list.
public int getBackgroundColor()Returns the background color.
public void setBackgroundColor(int color)Sets the background color.
public boolean isApplyBackgroundColor()Returns if the background color should be applied.
public void setApplyBackgroundColor(boolean apply)Sets if the background color should be applied.
public int getAxesColor()Returns the axes color.
public void setAxesColor(int color)Sets the axes color.
public int getYAxisColor()Returns the color of the Y axis
public void setYAxisColor(int color)Sets the Y axis color.
public int getXAxisColor()Returns the color of the X axis
public void setXAxisColor(int color)Sets the X axis color.
public int getLabelsColor()Returns the labels color.
public void setLabelsColor(int color)Sets the labels color.
public float getLabelsTextSize()Returns the labels text size.
public void setLabelsTextSize(float textSize)Sets the labels text size.
public void setLabelsTextFont(Font font)Sets the label title font size using a Font object instead of a point size.
public boolean isShowAxes()Returns if the axes should be visible.
public void setShowAxes(boolean showAxes)Sets if the axes should be visible.
public boolean isShowLabels()Returns if the labels should be visible.
public void setShowLabels(boolean showLabels)Sets if the labels should be visible.
public boolean isShowTickMarks()Returns if the tick marks should be visible.
public void setShowTickMarks(boolean mShowTickMarks)Sets if the tick marks should be visible.
public boolean isShowGridX()Returns if the X axis grid should be visible.
public void setShowGridX(boolean showGrid)Sets if the X axis grid should be visible.
public boolean isShowGridY()Returns if the Y axis grid should be visible.
public void setShowGridY(boolean showGrid)Sets if the Y axis grid should be visible.
public void setShowGrid(boolean showGrid)Sets if the grid should be visible.
public boolean isShowCustomTextGridX()Returns if the X axis custom text grid should be visible.
public void setShowCustomTextGridX(boolean showGrid)Sets if the X axis custom text grid should be visible.
public boolean isShowCustomTextGridY()Returns if the Y axis custom text grid should be visible.
public void setShowCustomTextGridY(boolean showGrid)Sets if the Y axis custom text grid should be visible.
public void setShowCustomTextGrid(boolean showGrid)Sets if the grid for custom X or Y labels should be visible.
public boolean isShowLegend()Returns if the legend should be visible.
public void setShowLegend(boolean showLegend)Sets if the legend should be visible.
public boolean isFitLegend()Returns if the legend should size to fit.
public void setFitLegend(boolean fit)Sets if the legend should size to fit.
public int getTextTypefaceName()Returns the text typeface name.
public int getTextTypefaceStyle()Returns the text typeface style.
public Font getTextTypeface()Returns the text typeface.
public void setTextTypeface(Font typeface)Sets the text typeface.
public float getLegendTextSize()Returns the legend text size.
public void setLegendTextSize(float textSize)Sets the legend text size.
public void setLegendTextFont(Font font)Sets the legend text font size using a Font object instead of a point size.
public void setTextTypeface(int typefaceName, int style)Sets the text typeface name and style.
public boolean isAntialiasing()Returns the antialiasing flag value.
public void setAntialiasing(boolean antialiasing)Sets the antialiasing value.
public float getScale()Returns the value to be used for scaling the chart.
public void setScale(float scale)Sets the value to be used for scaling the chart.
public float getOriginalScale()Returns the original value to be used for scaling the chart.
public boolean isZoomEnabled()Returns the enabled state of the zoom.
public void setZoomEnabled(boolean enabled)Sets the enabled state of the zoom.
public boolean isZoomButtonsVisible()Returns the visible state of the zoom buttons.
public void setZoomButtonsVisible(boolean visible)Sets the visible state of the zoom buttons.
public boolean isExternalZoomEnabled()Returns the enabled state of the external (application implemented) zoom.
public void setExternalZoomEnabled(boolean enabled)Sets the enabled state of the external (application implemented) zoom.
public float getZoomRate()Returns the zoom rate.
public void setZoomRate(float rate)Sets the zoom rate.
public boolean isPanEnabled()Returns the enabled state of the pan.
public void setPanEnabled(boolean enabled)Sets the enabled state of the pan.
public boolean isClickEnabled()Returns the enabled state of the click.
public void setClickEnabled(boolean enabled)Sets the enabled state of the click.
public int getSelectableBuffer()Returns the selectable radius value around clickable points.
public void setSelectableBuffer(int buffer)Sets the selectable radius value around clickable points.
public int getLegendHeight()Returns the legend height.
public void setLegendHeight(int height)Sets the legend height, in pixels.
public int[] getMargins()Returns the margin sizes.
public void setMargins(int[] margins)Sets the margins, in pixels.
public boolean isInScroll()Returns if the chart is inside a scroll view and doesn’t need to shrink.
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.
public float getStartAngle()Returns the start angle for circular charts such as pie, doughnut.
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.)
public boolean isDisplayValues()Returns if the values should be displayed as text.
public void setDisplayValues(boolean display)Sets if the values should be displayed as text (supported by pie chart).

Inherited methods

Field details

NO_COLOR

public static final int NO_COLOR = 0
A no color constant.

BACKGROUND_COLOR

public static final int BACKGROUND_COLOR = 0
The default background color.

TEXT_COLOR

public static final int TEXT_COLOR = 15395562
The default color for text.

Constructor details

DefaultRenderer

public DefaultRenderer()

Method details

getChartTitle

public String getChartTitle()
Returns the chart title.

Returns

the chart title

setChartTitle

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

Parameters

title String
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 in pixels. Consider using #setChartTitleTextFont(com.codename1.ui.Font) instead of this method to allow the text to be sized appropriately for the device resolution.

Parameters

textSize float
the chart title text size

setChartTitleTextFont

public void setChartTitleTextFont(Font font)

Sets the chart title font size using a Font object instead of a point size. This method is the preferred way to set font size because it allows you to more easily have fonts appear in an appropriate size for the target device.

Alternatively check out #setChartTitleTextSize(float) to set the text size in pixels.

addSeriesRenderer

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

Parameters

renderer SimpleSeriesRenderer
the renderer to be added

addSeriesRenderer

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

Parameters

index int
the index in the renderers list
renderer SimpleSeriesRenderer
the renderer to be added

removeSeriesRenderer

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

Parameters

renderer SimpleSeriesRenderer
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 int
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 int
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 boolean
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 int
the axes color

getYAxisColor

public int getYAxisColor()
Returns the color of the Y axis

Returns

the Y axis color

setYAxisColor

public void setYAxisColor(int color)
Sets the Y axis color.

Parameters

color int
the Y axis color

getXAxisColor

public int getXAxisColor()
Returns the color of the X axis

Returns

the X axis color

setXAxisColor

public void setXAxisColor(int color)
Sets the X axis color.

Parameters

color int
the X axis 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 int
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. Consider using #setLabelsTextFont(com.codename1.ui.Font) instead to allow the font size to to be adjusted appropriately for the display resolution.

Parameters

textSize float
the labels text size

setLabelsTextFont

public void setLabelsTextFont(Font font)

Sets the label title font size using a Font object instead of a point size. This method is the preferred way to set font size because it allows you to more easily have fonts appear in an appropriate size for the target device.

Alternatively check out #setLabelsTextSize(float) to set the text size in pixels.

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 boolean
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 boolean
the visibility flag for the labels

isShowTickMarks

public boolean isShowTickMarks()
Returns if the tick marks should be visible.

setShowTickMarks

public void setShowTickMarks(boolean mShowTickMarks)
Sets if the tick marks should be visible.

isShowGridX

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

Returns

the visibility flag for the X axis grid

setShowGridX

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

Parameters

showGrid boolean
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

setShowGridY

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

Parameters

showGrid boolean
the visibility flag for the Y axis grid

setShowGrid

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

Parameters

showGrid boolean
the visibility flag for the grid

isShowCustomTextGridX

public boolean isShowCustomTextGridX()
Returns if the X axis custom text grid should be visible.

Returns

the visibility flag for the X axis custom text grid

setShowCustomTextGridX

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

Parameters

showGrid boolean
the visibility flag for the X axis custom text grid

isShowCustomTextGridY

public boolean isShowCustomTextGridY()
Returns if the Y axis custom text grid should be visible.

Returns

the visibility flag for the custom text Y axis grid

setShowCustomTextGridY

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

Parameters

showGrid boolean
the visibility flag for the Y axis custom text grid

setShowCustomTextGrid

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

Parameters

showGrid boolean
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 boolean
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 boolean
the fit behavior

getTextTypefaceName

public int 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 Font getTextTypeface()
Returns the text typeface.

Returns

the text typeface

setTextTypeface

public void setTextTypeface(Font typeface)
Sets the text typeface.

Parameters

typeface Font
the 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. Consider using #setLegendTextFont(com.codename1.ui.Font) instead to allow the font size to to be adjusted appropriately for the display resolution.

Parameters

textSize float
the legend text size

setLegendTextFont

public void setLegendTextFont(Font font)

Sets the legend text font size using a Font object instead of a point size. This method is the preferred way to set font size because it allows you to more easily have fonts appear in an appropriate size for the target device.

Alternatively check out #setLegendTextSize(float) to set the text size in pixels.

setTextTypeface

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

Parameters

typefaceName int
the text typeface name
style int
the text typeface style

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 boolean
the antialiasing

getScale

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

Returns

the 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 float
the scale value

getOriginalScale

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

Returns

the original 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 boolean
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 boolean
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 boolean
external zoom enabled

getZoomRate

public float getZoomRate()
Returns the zoom rate.

Returns

the zoom rate

setZoomRate

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

Parameters

rate float
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 boolean
pan enabled

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 boolean
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 int
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 int
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 int[]
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 boolean
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 float
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 boolean
if the values should be displayed as text