rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvStackedChartDisplayer Class Reference

Base class for stacked data displayers. More...

#include <ilviews/charts/stacked.h>

Inheritance diagram for IlvStackedChartDisplayer:
IlvCompositeChartDisplayer IlvAbstractChartDisplayer IlvStacked3dBarChartDisplayer IlvStackedBarChartDisplayer IlvStackedPolygonChartDisplayer

List of all members.

Public Member Functions

 IlvStackedChartDisplayer (IlvChartDisplayerFactory *factory, IlUInt count, IlvPalette *const *palettes=0, IlBoolean stacked100PerCent=IlFalse)
 Constructor.
 IlvStackedChartDisplayer (IlvAbstractChartDisplayer *model, IlUInt count, IlvPalette *const *palettes=0, IlBoolean stacked100PerCent=IlFalse)
 Constructor.
 IlvStackedChartDisplayer (IlBoolean stacked100PerCent=IlFalse)
 Constructor.
virtual IlvAbstractChartDisplayercopy () const
 Virtual copy constructor.
virtual void draw (IlvPort *dst, const IlvTransformer *t, const IlvRegion *clip) const
 Draws the child displayers.
virtual IlvAbstractChartDisplayergetDisplayerForDataSet (const IlvChartDataSet *dataSet) const
 Returns the child displayer used to display a given data set.
virtual IlvCombinedChartDataSetgetVirtualDataSet (const IlvChartDataSet *dataSet, IlUInt &index) const
 Returns a virtual data set used by the current displayer.
IlBoolean isStacked100PerCent () const
 Indicates whether the data are stacked with the total amount equal to 100%.
void setStacked100PerCent (IlBoolean b)
 Specifies whether the data are stacked with the total amount equal to 100%.
virtual IlBoolean useVirtualDataSets () const
 Indicates whether the current displayer uses virtual data sets.
virtual void write (IlvOutputFile &) const
 Writes the attributes of the current object in a file.

Protected Member Functions

virtual void dataSetRemoved (IlUInt index)
 Performs the updates needed when a real data set is removed.
virtual void updateVirtualDataSets ()
 Updates the virtual data sets.

Detailed Description

Base class for stacked data displayers.

Library: ilvcharts

This class is a subclass of IlvCompositeChartDisplayer. This class is the base class for displayers representing stacked data. It enables you to compare the contribution of a given data value to a total across several data sets. Some subclasses are provided that define the child displayers that are created by default to be stacked: bar displayers, polygon displayers, and so on.

The stacked displayers display as many data sets as you want. The first data set is represented at the bottom. The second one is represented stacked on the first one. The third one is represented stacked on the second one, and so on.

To represent the data stacked, the stacked displayer uses virtual data sets. The number of created virtual data sets is equal to the number of real data sets to be stacked.

If the data are not stacked with the total amount equal to 100%, the virtual data sets used are instances of the IlvAddChartDataSet class. These virtual data sets are composed of the added data items of the real data sets from which they are constructed. The first virtual data set is composed of only the first real data set to be stacked. The second virtual data set is composed of the first and the second real data sets to be stacked. The third virtual data set is composed of the first, the second, and the third real data sets to be stacked, and so on.

If the data are stacked with the total amount equal to 100%, the used virtual data sets are instances of the IlvStacked100ChartDataSet class. These virtual data sets are constructed from all the real data sets that are set on the stacked displayer.

The virtual data sets, constructed from the real data sets that are set on the displayer, are the data sets that are actually displayed by the displayer. (See the Detailed Description of the IlvAbstractChartDisplayer class for more details about virtual data sets.)

The stacked displayers can be used with any type of projection. (See the IlvAbstractProjector class for more details.)

See also:
IlvCompositeChartDisplayer, IlvStackedBarChartDisplayer, IlvStacked3dBarChartDisplayer, IlvStackedPolygonChartDisplayer.

Constructor & Destructor Documentation

IlvStackedChartDisplayer::IlvStackedChartDisplayer ( IlBoolean  stacked100PerCent = IlFalse  ) 

Constructor.

Initializes a new IlvStackedChartDisplayer object.

Parameters:
stacked100PerCent A Boolean indicating whether the data are stacked with the total amount equal to 100%.
IlvStackedChartDisplayer::IlvStackedChartDisplayer ( IlvAbstractChartDisplayer model,
IlUInt  count,
IlvPalette *const *  palettes = 0,
IlBoolean  stacked100PerCent = IlFalse 
)

Constructor.

Initializes a new IlvStackedChartDisplayer object with count child displayers.

Parameters:
model The displayer model that will be used to create the child displayers.
count The number of child displayers that are created.
palettes The palettes that will be used by the created child displayers. If a valid array of palettes is provided, its size must match count.
stacked100PerCent A Boolean indicating whether the data are stacked with the total amount equal to 100%.
See also:
IlvCompositeChartDisplayer::setDisplayerModel.
IlvStackedChartDisplayer::IlvStackedChartDisplayer ( IlvChartDisplayerFactory factory,
IlUInt  count,
IlvPalette *const *  palettes = 0,
IlBoolean  stacked100PerCent = IlFalse 
)

Constructor.

Initializes a new IlvStackedChartDisplayer object with count child displayers.

Parameters:
factory The displayer factory that will be used to create the child displayers.
count The number of child displayers that are created.
palettes The palettes that will be used by the created child displayers. If a valid array of palettes is provided, its size must match count.
stacked100PerCent A Boolean indicating whether the data are stacked with the total amount equal to 100%.
See also:
IlvChartDisplayerFactory, IlvCompositeChartDisplayer::setDisplayerFactory.

Member Function Documentation

virtual IlvAbstractChartDisplayer* IlvStackedChartDisplayer::copy (  )  const [virtual]

Virtual copy constructor.

Creates and returns a copy of the current object. This method must be overloaded in subclasses. It is automatically declared by the DeclareChartDisplayerTypeInfo macro. The IlvPredefinedChartDisplayerIOMembers macro lets you define a default implementation, which returns an instance initialized with the copy constructor.

Returns:
A copy of the current object.

Implements IlvAbstractChartDisplayer.

Reimplemented in IlvStackedBarChartDisplayer, IlvStackedPolygonChartDisplayer, and IlvStacked3dBarChartDisplayer.

virtual void IlvStackedChartDisplayer::dataSetRemoved ( IlUInt  index  )  [protected, virtual]

Performs the updates needed when a real data set is removed.

This method removes the child displayer at the index index and then calls the IlvCompositeChartDisplayer::dataSetRemoved method.

Parameters:
index The index of the removed data set.

Reimplemented from IlvAbstractChartDisplayer.

virtual void IlvStackedChartDisplayer::draw ( IlvPort dst,
const IlvTransformer t,
const IlvRegion clip 
) const [virtual]

Draws the child displayers.

This method is redefined to draw the child displayers in reverse order.

See also:
IlvCompositeChartDisplayer::draw.

Reimplemented from IlvCompositeChartDisplayer.

virtual IlvAbstractChartDisplayer* IlvStackedChartDisplayer::getDisplayerForDataSet ( const IlvChartDataSet dataSet  )  const [virtual]

Returns the child displayer used to display a given data set.

The default implementation returns a pointer to the first displayer that displays the data set dataSet among the displayers that compose the current displayer.

dataSet The data set for which we want to get the first displayer displaying this data set.

Returns:
A pointer to the first displayer that displays the data set dataSet among the displayers that compose the current displayer, if one exists, and 0 otherwise.

Reimplemented from IlvCompositeChartDisplayer.

virtual IlvCombinedChartDataSet* IlvStackedChartDisplayer::getVirtualDataSet ( const IlvChartDataSet dataSet,
IlUInt index 
) const [virtual]

Returns a virtual data set used by the current displayer.

The default implementation returns the first virtual data set among the virtual data sets used by the current displayer for which the data set dataSet is one of the real data sets used to construct this virtual data set.

Parameters:
dataSet The real data set for which we want to get the first virtual data set that uses it.
index The index of the virtual data set that is returned.
Returns:
The first virtual data set among the virtual data sets used by the current displayer for which the data set dataSet is one of the real data sets used to construct this virtual data set.

Reimplemented from IlvAbstractChartDisplayer.

IlBoolean IlvStackedChartDisplayer::isStacked100PerCent (  )  const

Indicates whether the data are stacked with the total amount equal to 100%.

Returns:
IlTrue if the data are stacked with the total amount equal to 100% and IlFalse otherwise.
void IlvStackedChartDisplayer::setStacked100PerCent ( IlBoolean  b  ) 

Specifies whether the data are stacked with the total amount equal to 100%.

Parameters:
b The new value of the Boolean indicating whether the data are stacked with the total amount equal to 100%.
virtual void IlvStackedChartDisplayer::updateVirtualDataSets (  )  [protected, virtual]

Updates the virtual data sets.

This method first removes the existing virtual data sets and then constructs new virtual data sets from the real data sets that are set on the current displayer. The number of virtual data sets that are created is equal to the number of real data sets to be stacked.

If the data are not stacked with the total amount equal to 100%, the created virtual data sets are instances of the IlvAddChartDataSet class. The first virtual data set is composed of only the first real data set to be stacked. The second virtual data set is composed of the first and the second real data sets to be stacked. The third virtual data set is composed of the first, the second, and the third real data sets to be stacked, and so on.

If the data are stacked with the total amount equal to 100%, the created virtual data sets are instances of the IlvStacked100ChartDataSet class that are constructed from all the real data sets that are set on the current displayer.

Warning:
[note] This method is used internally and should not be used directly by the user. It is called in the IlvAbstractChartDisplayer::update method to update the virtual data sets when the real data sets have been modified.

Reimplemented from IlvAbstractChartDisplayer.

virtual IlBoolean IlvStackedChartDisplayer::useVirtualDataSets (  )  const [virtual]

Indicates whether the current displayer uses virtual data sets.

Returns a Boolean that indicates whether the current displayer uses virtual data sets.

Returns:
IlTrue by default.

Reimplemented from IlvAbstractChartDisplayer.

virtual void IlvStackedChartDisplayer::write ( IlvOutputFile file  )  const [virtual]

Writes the attributes of the current object in a file.

Called by the IlvAbstractChartDisplayer::save method. This method can be overloaded in subclasses that define new attributes. The information written by the write method is read by the IO constructor, which takes an IlvInputFile as its only argument. Both this method and the IO constructor can be automatically declared by using the DeclareChartDisplayerTypeInfo macro within the class declaration.

Parameters:
file The file where the attributes of the current object are written.

Reimplemented from IlvCompositeChartDisplayer.

 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.