Rogue Wave Views
Charts Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvChartLegendItem Class Reference

Base class for legend items. More...

#include <ilviews/charts/legend.h>

Inheritance diagram for IlvChartLegendItem:
IlvSimpleGraphic IlvGraphic IlvValueInterface

Public Member Functions

 IlvChartLegendItem (const IlvChartLegend *chartLegend, const char *label, const IlvAbstractChartDisplayer *dsp, IlvPalette *pal=0)
 Constructor. More...
 
 ~IlvChartLegendItem ()
 Destructor. More...
 
virtual void draw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the legend item. More...
 
IlUShort getBoxHeight () const
 Returns the height of the area where the graphic part of the current legend item is displayed. More...
 
IlUShort getBoxWidth () const
 Returns the width of the area where the graphic part of the current legend item is displayed. More...
 
const IlvAbstractChartDisplayergetDisplayer (IlUInt rank=0) const
 Returns a displayer with which the current legend item is associated. More...
 
IlUInt getDisplayersCount () const
 Returns the number of displayers with which the current legend item is associated. More...
 
const char * getLabel () const
 Returns the text of the current legend item. More...
 
IlvPalettegetLabelPalette () const
 Returns the palette used to display the text of the current legend item. More...
 
IlvDim getLabelSpacing () const
 Returns the space between the area where the graphic part is displayed and the label of the current legend item. More...
 
void setLabelForeground (IlvColor *color)
 Sets the foreground color of the palette for the text of the legend item. More...
 
void setLabelPalette (IlvPalette *pal)
 Sets the palette used to display the text for the current legend item. More...
 

Detailed Description

Base class for legend items.

Library: ilvcharts

This class allows you to define an item of a chart legend. A legend item is composed of a graphic and a text part:

Since the IlvChartLegendItem class inherits from the IlvSimpleGraphic class, the legend item is a graphic object.

See also
IlvChartLegend, IlvAbstractChartDisplayer.

Constructor & Destructor Documentation

IlvChartLegendItem::IlvChartLegendItem ( const IlvChartLegend chartLegend,
const char *  label,
const IlvAbstractChartDisplayer dsp,
IlvPalette pal = 0 
)

Constructor.

Initializes a new IlvChartLegendItem object.

Parameters
chartLegendThe legend to which the current legend item belongs.
labelThe text displayed for the current legend item.
dspThe displayer with which the current legend item is associated.
palThe palette used to display the current legend item.
IlvChartLegendItem::~IlvChartLegendItem ( )

Destructor.

This destructor deletes the label object that is used to display the text of the current legend item.

Member Function Documentation

virtual void IlvChartLegendItem::draw ( IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
virtual

Draws the legend item.

Draws the legend item in the port named dst using the transformer t and the clipping region clip. The graphic part of the legend item is drawn by calling the drawLegendItem method of the displayers with which the current legend item is associated. This allows you to display in the legend item a small graphical item which recalls the displayers with which the legend item is associated.

Parameters
dstThe port where the legend item is drawn.
tThe transformer used to draw the item.
clipThe clipping region used for the item.

Implements IlvGraphic.

IlUShort IlvChartLegendItem::getBoxHeight ( ) const

Returns the height of the area where the graphic part of the current legend item is displayed.

Returns
The height of the area where the graphic part of the current legend item is displayed.
IlUShort IlvChartLegendItem::getBoxWidth ( ) const

Returns the width of the area where the graphic part of the current legend item is displayed.

Returns
The width of the area where the graphic part of the current legend item is displayed.
const IlvAbstractChartDisplayer* IlvChartLegendItem::getDisplayer ( IlUInt  rank = 0) const

Returns a displayer with which the current legend item is associated.

This method returns a pointer to the displayer at the index rank among the displayers with which the current legend item is associated.

Parameters
rankThe index of the returned displayer.
Note
For the current release, the index rank has no real meaning since a legend item can be associated only with one displayer. It is included here for later versions.
Returns
A pointer to the displayer with which the current legend item is associated.
IlUInt IlvChartLegendItem::getDisplayersCount ( ) const

Returns the number of displayers with which the current legend item is associated.

Returns
1 by default for the current release, since a legend item can be associated only with one displayer.
const char* IlvChartLegendItem::getLabel ( ) const

Returns the text of the current legend item.

Returns
The text of the current legend item.
IlvPalette* IlvChartLegendItem::getLabelPalette ( ) const

Returns the palette used to display the text of the current legend item.

Returns
A pointer to the palette used to display the text of the current legend item.
IlvDim IlvChartLegendItem::getLabelSpacing ( ) const

Returns the space between the area where the graphic part is displayed and the label of the current legend item.

Returns
The space between the area where the graphic part is displayed and the label of the current legend item.
void IlvChartLegendItem::setLabelForeground ( IlvColor color)

Sets the foreground color of the palette for the text of the legend item.

Parameters
colorThe new foreground color for the palette used to display the text of the current legend item.
void IlvChartLegendItem::setLabelPalette ( IlvPalette pal)

Sets the palette used to display the text for the current legend item.

Parameters
palThe new palette used to display the text for the current legend item.

© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.