Summ:  Nested Constr. Methods    Details:  Constr. Methods      Class:  Prev Next
com.artfulbits.aiCharts.Base
Class ChartLegend

java.lang.Object com.artfulbits.aiCharts.Base.ChartLayoutElement com.artfulbits.aiCharts.Base.ChartLegend

Declaration: public final class ChartLegend extends ChartLayoutElement
All Interfaces: ILayout.IElement

 

Represents chart legend class.
XML Attributes
nameDefines legend name
visibleDefines legend visibility
dockDefines legend dock
backgroundDefines background

 

Since: 1.0

 

 

Nested Members Summary
static enum ChartLegend.LayoutMode
    
Represents legend items layout mode.

 

Nested members inherited from class: com.artfulbits.aiCharts.Base.ChartLayoutElement
ChartLayoutElement.Alignment, ChartLayoutElement.Dock

 

 

Constructors Summary
ChartLegend()
    
Initializes a new instance of legend with default smart items provider.
ChartLegend(LegendItemsProvider itemsProvider)
    
Initializes a new instance of legend.

 

 

Methods Summary
void draw(android.graphics.Canvas canvas)
    
Draws the legend on the specified canvas.
android.graphics.drawable.Drawable getBackDrawable()
    
Gets the android.graphics.drawable.Drawable that is be used to draw the legend.
LegendItemsProvider getItemsProvider()
    
Gets legend items provider.
ChartLegend.LayoutMode getLayoutMode()
    
Gets layout mode applied to this legend.
java.lang.String getName()
    
android.text.TextPaint getTextPaint()
    
Gets paint object used to draw legend's text.
void measure(android.graphics.Point inOutSize)
    
Measures the element.
void setBackDrawable(android.graphics.drawable.Drawable drawable)
    
Sets the android.graphics.drawable.Drawable that will be used to draw the legend.
void setItemsProvider(LegendItemsProvider provider)
    
Sets legend items provider.
void setLayoutMode(ChartLegend.LayoutMode mode)
    
Sets layout mode applied to this legend.
void setName(java.lang.String name)
    

 

Methods inherited from class: com.artfulbits.aiCharts.Base.ChartLayoutElement
getAlignment, getBounds, getDock, getMeasuredHeight, getMeasureWidth, isVisible, layout, setAlignment, setDock, setVisible

 

Methods inherited from class: java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

 

 

 

ChartLegend

 

public ChartLegend( )

 

Initializes a new instance of legend with default smart items provider.

 

Since: 1.5

 

 

 

ChartLegend

 

public ChartLegend( LegendItemsProvider itemsProvider)

 

Initializes a new instance of legend.

 

Parameters:
itemsProvider-
instance of LegendItemsProvider class that is responsible for legend items generation.

 

Since: 1.0

 

 

 

 

setLayoutMode

 

public void setLayoutMode( ChartLegend.LayoutMode mode)

 

Sets layout mode applied to this legend.

 

Parameters:
mode-
instance of ChartLegend.LayoutMode representing currently applied items layout mode.

 

Since: 1.5

 

 

 

getLayoutMode

 

public ChartLegend.LayoutMode getLayoutMode( )

 

Gets layout mode applied to this legend.

 

Returns:
instance of ChartLegend.LayoutMode representing currently applied items layout mode.

 

Since: 1.5
See also: setLayoutMode(ChartLegend.LayoutMode)

 

 

 

setItemsProvider

 

public void setItemsProvider( LegendItemsProvider provider)

 

Sets legend items provider. Legend will use this provider to build its items.

 

Parameters:
provider-
instance of LegendItemsProvider.

 

Since: 1.5
See also: LegendItemsProvider.AnnotationItemsProviderLegendItemsProvider.CustomItemsProvider

 

 

 

getItemsProvider

 

public LegendItemsProvider getItemsProvider( )

 

Gets legend items provider. Legend will use this provider to build its items.

 

Returns:
provider instance of LegendItemsProvider.

 

Since: 1.5

 

 

 

getName

 

public java.lang.String getName( )

 

 

 

setName

 

public void setName( java.lang.String name)

 

 

 

setBackDrawable

 

public void setBackDrawable( android.graphics.drawable.Drawable drawable)

 

Sets the android.graphics.drawable.Drawable that will be used to draw the legend.

 

Parameters:
drawable-
instance of android.graphics.drawable.Drawable.

 

Since: 1.0

 

 

 

getBackDrawable

 

public android.graphics.drawable.Drawable getBackDrawable( )

 

Gets the android.graphics.drawable.Drawable that is be used to draw the legend.

 

Returns:
instance of android.graphics.drawable.Drawable.

 

Since: 1.0

 

 

 

getTextPaint

 

public android.text.TextPaint getTextPaint( )

 

Gets paint object used to draw legend's text.

 

Returns:
value of currently applied text paint.

 

Since: 1.0

 

 

 

measure

 

public void measure( android.graphics.Point inOutSize)

 

[ description from ILayout.IElement.measure(android.graphics.Point) ]
 
Measures the element.

 

Overrides: ChartLayoutElement.measure(Point)
Implements: ILayout.IElement.measure(Point)

 

 

 

draw

 

public void draw( android.graphics.Canvas canvas)

 

Draws the legend on the specified canvas.

 

Parameters:
canvas-
instance of android.graphics.Canvas class.

 

Since: 1.0

 

 

© 2005 - 2010 ArtfulBits. All rights reserved.