ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QCPBarsGroup Class Reference

Groups multiple QCPBars together so they appear side by side. More...

#include <qcustomplot.h>

Inheritance diagram for QCPBarsGroup:

Public Types

enum  SpacingType {
  stAbsolute, stAxisRectRatio, stPlotCoords, stAbsolute,
  stAxisRectRatio, stPlotCoords, stAbsolute, stAxisRectRatio,
  stPlotCoords, stAbsolute, stAxisRectRatio, stPlotCoords,
  stAbsolute, stAxisRectRatio, stPlotCoords
}
 
enum  SpacingType {
  stAbsolute, stAxisRectRatio, stPlotCoords, stAbsolute,
  stAxisRectRatio, stPlotCoords, stAbsolute, stAxisRectRatio,
  stPlotCoords, stAbsolute, stAxisRectRatio, stPlotCoords,
  stAbsolute, stAxisRectRatio, stPlotCoords
}
 
enum  SpacingType {
  stAbsolute, stAxisRectRatio, stPlotCoords, stAbsolute,
  stAxisRectRatio, stPlotCoords, stAbsolute, stAxisRectRatio,
  stPlotCoords, stAbsolute, stAxisRectRatio, stPlotCoords,
  stAbsolute, stAxisRectRatio, stPlotCoords
}
 
enum  SpacingType {
  stAbsolute, stAxisRectRatio, stPlotCoords, stAbsolute,
  stAxisRectRatio, stPlotCoords, stAbsolute, stAxisRectRatio,
  stPlotCoords, stAbsolute, stAxisRectRatio, stPlotCoords,
  stAbsolute, stAxisRectRatio, stPlotCoords
}
 
enum  SpacingType {
  stAbsolute, stAxisRectRatio, stPlotCoords, stAbsolute,
  stAxisRectRatio, stPlotCoords, stAbsolute, stAxisRectRatio,
  stPlotCoords, stAbsolute, stAxisRectRatio, stPlotCoords,
  stAbsolute, stAxisRectRatio, stPlotCoords
}
 

Public Member Functions

 QCPBarsGroup (QCustomPlot *parentPlot)
 
virtual ~QCPBarsGroup ()
 
SpacingType spacingType () const
 
double spacing () const
 
void setSpacingType (SpacingType spacingType)
 
void setSpacing (double spacing)
 
QList< QCPBars * > bars () const
 
QCPBarsbars (int index) const
 
int size () const
 
bool isEmpty () const
 
void clear ()
 
bool contains (QCPBars *bars) const
 
void append (QCPBars *bars)
 
void insert (int i, QCPBars *bars)
 
void remove (QCPBars *bars)
 
 QCPBarsGroup (QCustomPlot *parentPlot)
 
virtual ~QCPBarsGroup ()
 
SpacingType spacingType () const
 
double spacing () const
 
void setSpacingType (SpacingType spacingType)
 
void setSpacing (double spacing)
 
QList< QCPBars * > bars () const
 
QCPBarsbars (int index) const
 
int size () const
 
bool isEmpty () const
 
void clear ()
 
bool contains (QCPBars *bars) const
 
void append (QCPBars *bars)
 
void insert (int i, QCPBars *bars)
 
void remove (QCPBars *bars)
 
 QCPBarsGroup (QCustomPlot *parentPlot)
 
virtual ~QCPBarsGroup ()
 
SpacingType spacingType () const
 
double spacing () const
 
void setSpacingType (SpacingType spacingType)
 
void setSpacing (double spacing)
 
QList< QCPBars * > bars () const
 
QCPBarsbars (int index) const
 
int size () const
 
bool isEmpty () const
 
void clear ()
 
bool contains (QCPBars *bars) const
 
void append (QCPBars *bars)
 
void insert (int i, QCPBars *bars)
 
void remove (QCPBars *bars)
 
 QCPBarsGroup (QCustomPlot *parentPlot)
 
virtual ~QCPBarsGroup ()
 
SpacingType spacingType () const
 
double spacing () const
 
void setSpacingType (SpacingType spacingType)
 
void setSpacing (double spacing)
 
QList< QCPBars * > bars () const
 
QCPBarsbars (int index) const
 
int size () const
 
bool isEmpty () const
 
void clear ()
 
bool contains (QCPBars *bars) const
 
void append (QCPBars *bars)
 
void insert (int i, QCPBars *bars)
 
void remove (QCPBars *bars)
 
 QCPBarsGroup (QCustomPlot *parentPlot)
 
virtual ~QCPBarsGroup ()
 
SpacingType spacingType () const
 
double spacing () const
 
void setSpacingType (SpacingType spacingType)
 
void setSpacing (double spacing)
 
QList< QCPBars * > bars () const
 
QCPBarsbars (int index) const
 
int size () const
 
bool isEmpty () const
 
void clear ()
 
bool contains (QCPBars *bars) const
 
void append (QCPBars *bars)
 
void insert (int i, QCPBars *bars)
 
void remove (QCPBars *bars)
 

Protected Member Functions

void registerBars (QCPBars *bars)
 
void unregisterBars (QCPBars *bars)
 
double keyPixelOffset (const QCPBars *bars, double keyCoord)
 
double getPixelSpacing (const QCPBars *bars, double keyCoord)
 
void registerBars (QCPBars *bars)
 
void unregisterBars (QCPBars *bars)
 
double keyPixelOffset (const QCPBars *bars, double keyCoord)
 
double getPixelSpacing (const QCPBars *bars, double keyCoord)
 
void registerBars (QCPBars *bars)
 
void unregisterBars (QCPBars *bars)
 
double keyPixelOffset (const QCPBars *bars, double keyCoord)
 
double getPixelSpacing (const QCPBars *bars, double keyCoord)
 
void registerBars (QCPBars *bars)
 
void unregisterBars (QCPBars *bars)
 
double keyPixelOffset (const QCPBars *bars, double keyCoord)
 
double getPixelSpacing (const QCPBars *bars, double keyCoord)
 
void registerBars (QCPBars *bars)
 
void unregisterBars (QCPBars *bars)
 
double keyPixelOffset (const QCPBars *bars, double keyCoord)
 
double getPixelSpacing (const QCPBars *bars, double keyCoord)
 

Protected Attributes

QCustomPlotmParentPlot
 
SpacingType mSpacingType
 
double mSpacing
 
QList< QCPBars * > mBars
 

Friends

class QCPBars
 

Detailed Description

Groups multiple QCPBars together so they appear side by side.

QCPBarsGroup.png

When showing multiple QCPBars in one plot which have bars at identical keys, it may be desirable to have them appearing next to each other at each key. This is what adding the respective QCPBars plottables to a QCPBarsGroup achieves. (An alternative approach is to stack them on top of each other, see QCPBars::moveAbove.)

Usage

To add a QCPBars plottable to the group, create a new group and then add the respective bars intances:

Alternatively to appending to the group like shown above, you can also set the group on the QCPBars plottable via QCPBars::setBarsGroup.

The spacing between the bars can be configured via setSpacingType and setSpacing. The bars in this group appear in the plot in the order they were appended. To insert a bars plottable at a certain index position, or to reposition a bars plottable which is already in the group, use insert.

To remove specific bars from the group, use either remove or call QCPBars::setBarsGroup(0) on the respective bars plottable.

To clear the entire group, call clear, or simply delete the group.

Example

The image above is generated with the following code:

Member Enumeration Documentation

Defines the ways the spacing between bars in the group can be specified. Thus it defines what the number passed to setSpacing actually means.

See Also
setSpacingType, setSpacing
Enumerator
stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

Defines the ways the spacing between bars in the group can be specified. Thus it defines what the number passed to setSpacing actually means.

See Also
setSpacingType, setSpacing
Enumerator
stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

Defines the ways the spacing between bars in the group can be specified. Thus it defines what the number passed to setSpacing actually means.

See Also
setSpacingType, setSpacing
Enumerator
stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

Defines the ways the spacing between bars in the group can be specified. Thus it defines what the number passed to setSpacing actually means.

See Also
setSpacingType, setSpacing
Enumerator
stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

Defines the ways the spacing between bars in the group can be specified. Thus it defines what the number passed to setSpacing actually means.

See Also
setSpacingType, setSpacing
Enumerator
stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

stAbsolute 

Bar spacing is in absolute pixels.

stAxisRectRatio 

Bar spacing is given by a fraction of the axis rect size.

stPlotCoords 

Bar spacing is in key coordinates and thus scales with the key axis range.

Constructor & Destructor Documentation

QCPBarsGroup::QCPBarsGroup ( QCustomPlot parentPlot)

Constructs a new bars group for the specified QCustomPlot instance.

QCPBarsGroup::~QCPBarsGroup ( )
virtual
QCPBarsGroup::QCPBarsGroup ( QCustomPlot parentPlot)
virtual QCPBarsGroup::~QCPBarsGroup ( )
virtual
QCPBarsGroup::QCPBarsGroup ( QCustomPlot parentPlot)
virtual QCPBarsGroup::~QCPBarsGroup ( )
virtual
QCPBarsGroup::QCPBarsGroup ( QCustomPlot parentPlot)
virtual QCPBarsGroup::~QCPBarsGroup ( )
virtual
QCPBarsGroup::QCPBarsGroup ( QCustomPlot parentPlot)
virtual QCPBarsGroup::~QCPBarsGroup ( )
virtual

Member Function Documentation

void QCPBarsGroup::append ( QCPBars bars)

Adds the specified bars plottable to this group. Alternatively, you can also use QCPBars::setBarsGroup on the bars instance.

See Also
insert, remove
void QCPBarsGroup::append ( QCPBars bars)
void QCPBarsGroup::append ( QCPBars bars)
void QCPBarsGroup::append ( QCPBars bars)
void QCPBarsGroup::append ( QCPBars bars)
QList<QCPBars*> QCPBarsGroup::bars ( ) const
inline
QList<QCPBars*> QCPBarsGroup::bars ( ) const
inline
QList< QCPBars * > QCPBarsGroup::bars ( ) const
inline

Returns all bars currently in this group.

See Also
bars(int index)
QList<QCPBars*> QCPBarsGroup::bars ( ) const
inline
QList<QCPBars*> QCPBarsGroup::bars ( ) const
inline
QCPBars* QCPBarsGroup::bars ( int  index) const
QCPBars* QCPBarsGroup::bars ( int  index) const
QCPBars* QCPBarsGroup::bars ( int  index) const
QCPBars * QCPBarsGroup::bars ( int  index) const

Returns the QCPBars instance with the specified index in this group. If no such QCPBars exists, returns 0.

See Also
bars(), size
QCPBars* QCPBarsGroup::bars ( int  index) const
void QCPBarsGroup::clear ( )
void QCPBarsGroup::clear ( )
void QCPBarsGroup::clear ( )

Removes all QCPBars plottables from this group.

See Also
isEmpty
void QCPBarsGroup::clear ( )
void QCPBarsGroup::clear ( )
bool QCPBarsGroup::contains ( QCPBars bars) const
inline
bool QCPBarsGroup::contains ( QCPBars bars) const
inline
bool QCPBarsGroup::contains ( QCPBars bars) const
inline
bool QCPBarsGroup::contains ( QCPBars bars) const
inline
bool QCPBarsGroup::contains ( QCPBars bars) const
inline
double QCPBarsGroup::getPixelSpacing ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::getPixelSpacing ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::getPixelSpacing ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::getPixelSpacing ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::getPixelSpacing ( const QCPBars bars,
double  keyCoord 
)
protected
void QCPBarsGroup::insert ( int  i,
QCPBars bars 
)
void QCPBarsGroup::insert ( int  i,
QCPBars bars 
)
void QCPBarsGroup::insert ( int  i,
QCPBars bars 
)

Inserts the specified bars plottable into this group at the specified index position i. This gives you full control over the ordering of the bars.

bars may already be part of this group. In that case, bars is just moved to the new index position.

See Also
append, remove
void QCPBarsGroup::insert ( int  i,
QCPBars bars 
)
void QCPBarsGroup::insert ( int  i,
QCPBars bars 
)
bool QCPBarsGroup::isEmpty ( ) const
inline

Returns whether this bars group is empty.

See Also
size
bool QCPBarsGroup::isEmpty ( ) const
inline
bool QCPBarsGroup::isEmpty ( ) const
inline
bool QCPBarsGroup::isEmpty ( ) const
inline
bool QCPBarsGroup::isEmpty ( ) const
inline
double QCPBarsGroup::keyPixelOffset ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::keyPixelOffset ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::keyPixelOffset ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::keyPixelOffset ( const QCPBars bars,
double  keyCoord 
)
protected
double QCPBarsGroup::keyPixelOffset ( const QCPBars bars,
double  keyCoord 
)
protected
void QCPBarsGroup::registerBars ( QCPBars bars)
protected
void QCPBarsGroup::registerBars ( QCPBars bars)
protected
void QCPBarsGroup::registerBars ( QCPBars bars)
protected
void QCPBarsGroup::registerBars ( QCPBars bars)
protected
void QCPBarsGroup::registerBars ( QCPBars bars)
protected
void QCPBarsGroup::remove ( QCPBars bars)
void QCPBarsGroup::remove ( QCPBars bars)
void QCPBarsGroup::remove ( QCPBars bars)
void QCPBarsGroup::remove ( QCPBars bars)

Removes the specified bars plottable from this group.

See Also
contains, clear
void QCPBarsGroup::remove ( QCPBars bars)
void QCPBarsGroup::setSpacing ( double  spacing)
void QCPBarsGroup::setSpacing ( double  spacing)
void QCPBarsGroup::setSpacing ( double  spacing)
void QCPBarsGroup::setSpacing ( double  spacing)
void QCPBarsGroup::setSpacing ( double  spacing)

Sets the spacing between adjacent bars. What the number passed as spacing actually means, is defined by the current SpacingType, which can be set with setSpacingType.

See Also
setSpacingType
void QCPBarsGroup::setSpacingType ( SpacingType  spacingType)
void QCPBarsGroup::setSpacingType ( SpacingType  spacingType)
void QCPBarsGroup::setSpacingType ( SpacingType  spacingType)
void QCPBarsGroup::setSpacingType ( SpacingType  spacingType)

Sets how the spacing between adjacent bars is interpreted. See SpacingType.

The actual spacing can then be specified with setSpacing.

See Also
setSpacing
void QCPBarsGroup::setSpacingType ( SpacingType  spacingType)
int QCPBarsGroup::size ( void  ) const
inline
int QCPBarsGroup::size ( ) const
inline
int QCPBarsGroup::size ( ) const
inline

Returns the number of QCPBars plottables that are part of this group.

int QCPBarsGroup::size ( void  ) const
inline
int QCPBarsGroup::size ( void  ) const
inline
double QCPBarsGroup::spacing ( ) const
inline
double QCPBarsGroup::spacing ( ) const
inline
double QCPBarsGroup::spacing ( ) const
inline
double QCPBarsGroup::spacing ( ) const
inline
double QCPBarsGroup::spacing ( ) const
inline
SpacingType QCPBarsGroup::spacingType ( ) const
inline
SpacingType QCPBarsGroup::spacingType ( ) const
inline
SpacingType QCPBarsGroup::spacingType ( ) const
inline
SpacingType QCPBarsGroup::spacingType ( ) const
inline
SpacingType QCPBarsGroup::spacingType ( ) const
inline
void QCPBarsGroup::unregisterBars ( QCPBars bars)
protected
void QCPBarsGroup::unregisterBars ( QCPBars bars)
protected
void QCPBarsGroup::unregisterBars ( QCPBars bars)
protected
void QCPBarsGroup::unregisterBars ( QCPBars bars)
protected
void QCPBarsGroup::unregisterBars ( QCPBars bars)
protected

Friends And Related Function Documentation

QCPBars
friend

Member Data Documentation

QList< QCPBars * > QCPBarsGroup::mBars
protected
QCustomPlot * QCPBarsGroup::mParentPlot
protected
double QCPBarsGroup::mSpacing
protected
SpacingType QCPBarsGroup::mSpacingType
protected

The documentation for this class was generated from the following files: