public final class

ChartLegendItem

extends Object
java.lang.Object
   ↳ com.artfulbits.aiCharts.Base.ChartLegendItem

Class Overview

Represents item that is hold by the legend.

Summary

Nested Classes
class ChartLegendItem.Cell Represents cell of the legend. 
class ChartLegendItem.DrawableCell Represents the drawable cell. 
class ChartLegendItem.TextCell Represents text cell class. 
Public Constructors
ChartLegendItem()
Sole constructor.
ChartLegendItem(Object... cells)
Initialize new instance of ChartLegendItem with specified cells.
Public Methods
ChartLegendItem.DrawableCell addCell(Drawable drawable)
Adds the specified cell to the legend item.
void addCell()
Adds empty cell.
void addCell(ChartLegendItem.Cell cell)
Adds the specified cell to the legend item.
ChartLegendItem.TextCell addCell(String text)
Adds the specified cell to the legend item.
void clearCells()
Clears all cells in this item.
List<ChartLegendItem.Cell> getCells()
Gets cells of this legend item.
Object getTag()
Gets associated tag.
void setCell(int index, Drawable drawable)
Sets drawable that will be rendered in specified legend item's cell.
void setCell(int index, String text)
Sets text that will be rendered in specified legend item's cell.
void setTag(Object tag)
Sets associated tag.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ChartLegendItem ()

Sole constructor. (For invocation by subclass constructors, typically implicit.)

public ChartLegendItem (Object... cells)

Initialize new instance of ChartLegendItem with specified cells.

Parameters
cells objects array representing legend item cells. Each cell is expected to be either Drawable or text. If cell is not instance of Drawable, toString() representation of cell will be used.

Public Methods

public ChartLegendItem.DrawableCell addCell (Drawable drawable)

Adds the specified cell to the legend item.

Parameters
drawable visual representation of cell.

public void addCell ()

Adds empty cell.

public void addCell (ChartLegendItem.Cell cell)

Adds the specified cell to the legend item.

Parameters
cell ChartLegendItem.Cell instance.

public ChartLegendItem.TextCell addCell (String text)

Adds the specified cell to the legend item.

Parameters
text text representation of cell.

public void clearCells ()

Clears all cells in this item.

public List<ChartLegendItem.Cell> getCells ()

Gets cells of this legend item.

Returns
  • list containing item's cells.

public Object getTag ()

Gets associated tag.

Returns
  • the Object associated with this item.

public void setCell (int index, Drawable drawable)

Sets drawable that will be rendered in specified legend item's cell.

Parameters
index cell index.
drawable instance of Drawable that will be used to draw the cell.

public void setCell (int index, String text)

Sets text that will be rendered in specified legend item's cell.

Parameters
index cell index.
text desired text.

public void setTag (Object tag)

Sets associated tag.

Parameters
tag the Object associated with this item.