rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvChartLegendItem Class Reference

Base class for legend items. More...

#include <ilviews/charts/legend.h>

Inheritance diagram for IlvChartLegendItem:
IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

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

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:
chartLegend The legend to which the current legend item belongs.
label The text displayed for the current legend item.
dsp The displayer with which the current legend item is associated.
pal The 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:
dst The port where the legend item is drawn.
t The transformer used to draw the item.
clip The 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:
rank The index of the returned displayer.
Warning:
[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:
color The 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:
pal The new palette used to display the text for the current legend item.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.