Rogue Wave Views |
Rogue Wave Views Documentation Home |
Base class for legend items. More...
#include <ilviews/charts/legend.h>
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 IlvAbstractChartDisplayer * | getDisplayer (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... | |
IlvPalette * | getLabelPalette () 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... | |
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:
The graphic part illustrates the graphical representation of the data with which the legend item is associated. For example, for data displayed by markers, the graphic part will show a marker with the same color and shape.
Since the IlvChartLegendItem
class inherits from the IlvSimpleGraphic
class, the legend item is a graphic object.
IlvChartLegend
, IlvAbstractChartDisplayer
. IlvChartLegendItem::IlvChartLegendItem | ( | const IlvChartLegend * | chartLegend, |
const char * | label, | ||
const IlvAbstractChartDisplayer * | dsp, | ||
IlvPalette * | pal = 0 |
||
) |
Constructor.
Initializes a new IlvChartLegendItem
object.
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.
|
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.
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.
IlUShort IlvChartLegendItem::getBoxWidth | ( | ) | const |
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.
rank | The index of the returned displayer. |
IlUInt IlvChartLegendItem::getDisplayersCount | ( | ) | const |
Returns the number of displayers with which the current legend item is associated.
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.
IlvPalette* IlvChartLegendItem::getLabelPalette | ( | ) | const |
Returns 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.
void IlvChartLegendItem::setLabelForeground | ( | IlvColor * | color | ) |
Sets the foreground color of the palette for the text of the legend item.
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.
pal | The new palette used to display the text for the current legend item. |
© Copyright 2015, 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.