Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Class for high-low bar displayers. More...
#include <ilviews/charts/hilo.h>
Public Member Functions | |
IlvHiLoBarChartDisplayer (IlvDim width=8, IlvPalette *risePalette=0, IlvPalette *fallPalette=0) | |
Constructor. | |
Protected Member Functions | |
virtual void | computeItem (const IlvChartDisplayerPoints *displayerPoints, IlUInt pointIndex, IlUInt &usedPointsCount, IlvPoint *points, const IlvTransformer *t=0) const |
Computes the item that will be displayed for a given point in screen coordinates corresponding to a data point to display. | |
virtual void | drawItem (const IlvChartDisplayerPoints *displayerPoints, IlUInt pointIndex, IlUInt pointCount, IlvPoint *points, IlvPalette *itemPalette, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the item for a given point in screen coordinates corresponding to a data point to display. | |
virtual void | drawLegendItem (IlvPort *dst, const IlvRect &legendArea, IlvPalette *itemPal, const IlvRegion *clip, IlAny clientData=0) const |
Draws the graphic part of a legend item associated with the current displayer. | |
virtual IlUInt | getItemPointsCount (const IlvChartDisplayerPoints *displayerPoints) const |
Returns the maximum number of points needed to define an item for the current displayer. |
Class for high-low bar displayers.
Library: ilvcharts
This class is a subclass of IlvHiLoChartDisplayer
which allows you to represent data with high-low items that are shown as bars. A high-low item is made up of a bar linking a low value and a high value.
The high-low bar displayer (just as with the high-low displayer) displays two data sets. The first data set is composed of the low values and the second data set is composed of the high values.
A high-low item is drawn between each pair of low-high values, the low values being taken in order from the first data set and the high values being taken in order from the second data set. Two palettes are defined for this displayer: a rise palette and a fall palette. The rise palette is used to draw the high-low items for which the corresponding low value is smaller than the high value. The fall palette is used to draw the high-low items for which the corresponding low value is greater than the high value.
See the IlvHiLoChartDisplayer
class, and particularly the Detailed Description, for more details about objects displaying high-low items.
The high-low bar displayer can be used with any type of projection. (See the IlvAbstractProjector
class for more details.)
The following images show data sets represented with a high-low bar displayer in a Cartesian chart (on the left) and a polar chart (on the right). The rise palette has its foreground color set to green and the fall palette to red. The background color is set to white for both the rise palette and the fall palette.
IlvHiLoChartDisplayer
. IlvHiLoBarChartDisplayer::IlvHiLoBarChartDisplayer | ( | IlvDim | width = 8 , |
|
IlvPalette * | risePalette = 0 , |
|||
IlvPalette * | fallPalette = 0 | |||
) |
Constructor.
Initializes a new IlvHiLoBarChartDisplayer
object.
width | The width of the bars that will be drawn for the high-low items. | |
risePalette | The rise palette that will be used to draw the high-low items for which the corresponding low value is smaller than the high value. | |
fallPalette | The fall palette that will be used to draw the high-low items for which the corresponding low value is greater than the high value. |
virtual void IlvHiLoBarChartDisplayer::computeItem | ( | const IlvChartDisplayerPoints * | displayerPoints, | |
IlUInt | pointIndex, | |||
IlUInt & | usedPointsCount, | |||
IlvPoint * | points, | |||
const IlvTransformer * | t = 0 | |||
) | const [protected, virtual] |
Computes the item that will be displayed for a given point in screen coordinates corresponding to a data point to display.
Computes the points defining the item to be displayed for the point in screen coordinates that is stored at the index pointIndex in the displayerPoints object. This object stores the points in screen coordinates corresponding to the data points that have to be displayed by the current displayer. (See the IlvSingleChartDisplayer::computeItem
method for more details.)
The data points that are displayed are those of the virtual data set that is constructed internally from the two data sets that are set on the current displayer. (See the Detailed Description of the IlvHiLoChartDisplayer
class for more details.) These data points are the alternated data points of the low-values and high-values data sets. Since two data points (one from the low-values data set and one from the high-values data set) are needed to draw a high-low item, the data points of the virtual data set are considered in pairs and the computeItem method will be called once for each pair of screen points corresponding to data points to display instead of once for each screen point.
The item that will be displayed for a given pair of screen points corresponding to a data point of the low values data set and a data point of the high-values data set, respectively, is a bar that links the pair of screen points and has the width returned by the getWidth
method. This bar is defined by five points (the last one being equal to the first one).
The number of points defining the item is returned in usedPointsCount.
drawPoints
method. Reimplemented from IlvHiLoChartDisplayer.
virtual void IlvHiLoBarChartDisplayer::drawItem | ( | const IlvChartDisplayerPoints * | displayerPoints, | |
IlUInt | pointIndex, | |||
IlUInt | pointCount, | |||
IlvPoint * | points, | |||
IlvPalette * | itemPalette, | |||
IlvPort * | dst, | |||
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [protected, virtual] |
Draws the item for a given point in screen coordinates corresponding to a data point to display.
Draws the item for the point in screen coordinates that is stored at the index pointIndex in the displayerPoints object. This object stores the points in screen coordinates corresponding to the data points that have to be displayed by the current displayer. (See the IlvSingleChartDisplayer::drawItem
method for more details.)
This method draws the high-low item defined by the points stored in points. A polyline is drawn between these points with the foreground color of the palette itemPalette. The bar is filled with the background color of the palette itemPalette if the method IlvSingleChartDisplayer::isDrawingFill
returns IlTrue
. (See the IlvHiLoBarChartDisplayer::computeItem
method for more details.)
drawPoints
method. Reimplemented from IlvHiLoChartDisplayer.
virtual void IlvHiLoBarChartDisplayer::drawLegendItem | ( | IlvPort * | dst, | |
const IlvRect & | legendArea, | |||
IlvPalette * | itemPal, | |||
const IlvRegion * | clip, | |||
IlAny | clientData = 0 | |||
) | const [protected, virtual] |
Draws the graphic part of a legend item associated with the current displayer.
The drawing is performed in the port dst using the clipping region clip. It is bounded by the rectangle legendArea.
The current implementation of the method simply draws two bars side-by-side. These bars are bounded by the area legendArea. They are displayed with the fall and rise palettes respectively.
dst | The port used for the drawing. | |
legendArea | The area where the drawing is performed. | |
itemPal | The palette of the legend item associated with the current displayer. | |
clip | The optional clipping region. | |
clientData | The client data defined for the legend item associated with the current displayer. |
Reimplemented from IlvHiLoChartDisplayer.
virtual IlUInt IlvHiLoBarChartDisplayer::getItemPointsCount | ( | const IlvChartDisplayerPoints * | displayerPoints | ) | const [protected, virtual] |
Returns the maximum number of points needed to define an item for the current displayer.
(See the IlvHiLoBarChartDisplayer::computeItem
method for more details.)
displayerPoints | The object that stores the points in screen coordinates to be displayed by the current displayer. |
5
. Reimplemented from IlvHiLoChartDisplayer.
© 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.