KDChart::BarDiagram Class Reference

#include <KDChartBarDiagram.h>

Inheritance diagram for KDChart::BarDiagram:

Inheritance graph
[legend]
Collaboration diagram for KDChart::BarDiagram:

Collaboration graph
[legend]
List of all members.

Detailed Description

BarDiagram defines a common bar diagram.

It provides different subtypes which are set using setType.

Definition at line 48 of file KDChartBarDiagram.h.

Public Types

enum  BarType {
  Normal,
  Stacked,
  Percent,
  Rows
}

Signals

void dataHidden ()
 This signal is emitted, when the hidden status of at least one data cell was (un)set.
void layoutChanged (AbstractDiagram *)
 Diagrams are supposed to emit this signal, when the layout of one of their element changes.
void modelsChanged ()
 This signal is emitted, when either the model or the AttributesModel is replaced.
void propertiesChanged ()
 Emitted upon change of a property of the Diagram.

Public Member Functions

virtual void addAxis (CartesianAxis *axis)
 Add the axis to the diagram.
bool allowOverlappingDataValueTexts () const
 
Returns:
Whether data value labels are allowed to overlap.

bool antiAliasing () const
 
Returns:
Whether anti-aliasing is to be used for rendering this diagram.

virtual AttributesModelattributesModel () const
 Returns the AttributesModel, that is used by this diagram.
virtual KDChart::CartesianAxisList axes () const
 
Returns:
a list of all axes added to the diagram

BarAttributes barAttributes (const QModelIndex &index) const
 
Returns:
the bar attribute set of the model index index

BarAttributes barAttributes (int column) const
 
Returns:
the bar attribute set of data set column

BarAttributes barAttributes () const
 
Returns:
the global bar attribute set

 BarDiagram (QWidget *parent=0, CartesianCoordinatePlane *plane=0)
QBrush brush (const QModelIndex &index) const
 Retrieve the brush to be used, for painting the datapoint at the given index in the model.
QBrush brush (int dataset) const
 Retrieve the brush to be used for the given dataset.
QBrush brush () const
 Retrieve the brush to be used for painting datapoints globally.
virtual BarDiagramclone () const
 Creates an exact copy of this diagram.
bool compare (const AbstractDiagram *other) const
 Returns true if both diagrams have the same settings.
bool compare (const AbstractCartesianDiagram *other) const
 Returns true if both diagrams have the same settings.
bool compare (const BarDiagram *other) const
 Returns true if both diagrams have the same settings.
AbstractCoordinatePlanecoordinatePlane () const
 The coordinate plane associated with the diagram.
const QPair< QPointF, QPointF > dataBoundaries () const
 Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values).
virtual void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 [reimplemented]
QList< QBrush > datasetBrushes () const
 The set of dataset brushes currently used, for use in legends, etc.
int datasetDimension () const
 The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have.
QStringList datasetLabels () const
 The set of dataset labels currently displayed, for use in legends, etc.
QList< MarkerAttributesdatasetMarkers () const
 The set of dataset markers currently used, for use in legends, etc.
QList< QPen > datasetPens () const
 The set of dataset pens currently used, for use in legends, etc.
DataValueAttributes dataValueAttributes (const QModelIndex &index) const
 Retrieve the DataValueAttributes for the given index.
DataValueAttributes dataValueAttributes (int column) const
 Retrieve the DataValueAttributes for the given dataset.
DataValueAttributes dataValueAttributes () const
 Retrieve the DataValueAttributes speficied globally.
virtual void doItemsLayout ()
 [reimplemented]
virtual int horizontalOffset () const
 [reimplemented]
virtual QModelIndex indexAt (const QPoint &point) const
 [reimplemented]
QModelIndexList indexesAt (const QPoint &point) const
 This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot.
bool isHidden (const QModelIndex &index) const
 Retrieve the hidden status for the given index.
bool isHidden (int column) const
 Retrieve the hidden status for the given dataset.
bool isHidden () const
 Retrieve the hidden status speficied globally.
virtual bool isIndexHidden (const QModelIndex &index) const
 [reimplemented]
QStringList itemRowLabels () const
 The set of item row labels currently displayed, for use in Abscissa axes, etc.
virtual void layoutPlanes ()
 Triggers layouting of all coordinate planes on the current chart.
virtual QModelIndex moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
 [reimplemented]
const int numberOfAbscissaSegments () const
 [reimplemented]
const int numberOfOrdinateSegments () const
 [reimplemented]
void paintDataValueText (QPainter *painter, const QModelIndex &index, const QPointF &pos, double value)
void paintMarker (QPainter *painter, const QModelIndex &index, const QPointF &pos)
virtual void paintMarker (QPainter *painter, const MarkerAttributes &markerAttributes, const QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size)
QPen pen (const QModelIndex &index) const
 Retrieve the pen to be used, for painting the datapoint at the given index in the model.
QPen pen (int dataset) const
 Retrieve the pen to be used for the given dataset.
QPen pen () const
 Retrieve the pen to be used for painting datapoints globally.
bool percentMode () const
virtual AbstractCartesianDiagramreferenceDiagram () const
 
Returns:
this diagram's reference diagram

virtual QPointF referenceDiagramOffset () const
 
Returns:
the relative offset of this diagram's reference diagram

void resize (const QSizeF &area)
 Called by the widget's sizeEvent.
virtual void scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)
 [reimplemented]
void setAllowOverlappingDataValueTexts (bool allow)
 Set whether data value labels are allowed to overlap.
void setAntiAliasing (bool enabled)
 Set whether anti-aliasing is to be used while rendering this diagram.
void setAttributesModel (AttributesModel *model)
 Associate an AttributesModel with this diagram.
void setBarAttributes (const QModelIndex &index, const BarAttributes &a)
 Sets the line attributes for the model index index to ba.
void setBarAttributes (int column, const BarAttributes &a)
 Sets the bar attributes of data set column to ba.
void setBarAttributes (const BarAttributes &a)
 Sets the global bar attributes to ba.
void setBrush (const QBrush &brush)
 Set the brush to be used, for painting all datasets in the model.
void setBrush (int dataset, const QBrush &brush)
 Set the brush to be used, for painting the given dataset.
void setBrush (const QModelIndex &index, const QBrush &brush)
 Set the brush to be used, for painting the datapoint at the given index.
virtual void setCoordinatePlane (AbstractCoordinatePlane *plane)
 [reimplemented]
void setDatasetDimension (int dimension)
 Sets the dataset dimension of the diagram.
void setDataValueAttributes (const DataValueAttributes &a)
 Set the DataValueAttributes for all datapoints in the model.
void setDataValueAttributes (int dataset, const DataValueAttributes &a)
 Set the DataValueAttributes for the given dataset.
void setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a)
 Set the DataValueAttributes for the given index.
void setHidden (bool hidden)
 Hide (or unhide, resp.
void setHidden (int column, bool hidden)
 Hide (or unhide, resp.
void setHidden (const QModelIndex &index, bool hidden)
 Hide (or unhide, resp.
void setModel (QAbstractItemModel *model)
 Associate a model with the diagram.
void setPen (const QPen &pen)
 Set the pen to be used, for painting all datasets in the model.
void setPen (int dataset, const QPen &pen)
 Set the pen to be used, for painting the given dataset.
void setPen (const QModelIndex &index, const QPen &pen)
 Set the pen to be used, for painting the datapoint at the given index.
void setPercentMode (bool percent)
virtual void setReferenceDiagram (AbstractCartesianDiagram *diagram, const QPointF &offset=QPointF())
 Makes this diagram use another diagram diagram as reference diagram with relative offset offset.
void setRootIndex (const QModelIndex &index)
 Set the root index in the model, where the diagram starts referencing data for display.
virtual void setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)
 [reimplemented]
void setThreeDBarAttributes (const QModelIndex &index, const ThreeDBarAttributes &a)
 Sets the 3D line attributes of model index index to threeDAttrs.
void setThreeDBarAttributes (int column, const ThreeDBarAttributes &a)
 Sets the 3D bar attributes of dataset column to threeDAttrs.
void setThreeDBarAttributes (const ThreeDBarAttributes &a)
 Sets the global 3D bar attributes to threeDAttrs.
void setType (const BarType type)
 Sets the bar diagram's type to type.
void setUnitPrefix (const QString &prefix, Qt::Orientation orientation)
 Sets the unit prefix for all values.
void setUnitPrefix (const QString &prefix, int column, Qt::Orientation orientation)
 Sets the unit prefix for one value.
void setUnitSuffix (const QString &suffix, Qt::Orientation orientation)
 Sets the unit suffix for all values.
void setUnitSuffix (const QString &suffix, int column, Qt::Orientation orientation)
 Sets the unit suffix for one value.
virtual void takeAxis (CartesianAxis *axis)
 Removes the axis from the diagram, without deleting it.
ThreeDBarAttributes threeDBarAttributes (const QModelIndex &index) const
 
Returns:
the 3D bar attributes of the model index index

ThreeDBarAttributes threeDBarAttributes (int column) const
 
Returns:
the 3D bar attributes of data set column

ThreeDBarAttributes threeDBarAttributes () const
 
Returns:
the global 3D bar attributes

BarType type () const
 
Returns:
the type of the line diagram

QString unitPrefix (Qt::Orientation orientation) const
 Returns the global unit prefix.
QString unitPrefix (int column, Qt::Orientation orientation, bool fallback=false) const
 Returns the unit prefix for a special value.
QString unitSuffix (Qt::Orientation orientation) const
 Returns the global unit suffix.
QString unitSuffix (int column, Qt::Orientation orientation, bool fallback=false) const
 Returns the unit suffix for a special value.
void update () const
void useDefaultColors ()
 Set the palette to be used, for painting datasets to the default palette.
void useRainbowColors ()
 Set the palette to be used, for painting datasets to the rainbow palette.
virtual bool usesExternalAttributesModel () const
 Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.
void useSubduedColors ()
 Set the palette to be used, for painting datasets to the subdued palette.
virtual int verticalOffset () const
 [reimplemented]
virtual QRect visualRect (const QModelIndex &index) const
 [reimplemented]
virtual QRegion visualRegionForSelection (const QItemSelection &selection) const
 [reimplemented]
virtual ~BarDiagram ()

Protected Member Functions

QModelIndex attributesModelRootIndex () const
const QPair< QPointF, QPointF > calculateDataBoundaries () const
 [reimplemented]
virtual bool checkInvariants (bool justReturnTheStatus=false) const
QModelIndex columnToIndex (int column) const
void paint (PaintContext *paintContext)
 Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.
virtual void paintDataValueTexts (QPainter *painter)
void paintEvent (QPaintEvent *)
virtual void paintMarkers (QPainter *painter)
void resizeEvent (QResizeEvent *)
void setAttributesModelRootIndex (const QModelIndex &)
void setDataBoundariesDirty () const
virtual double threeDItemDepth (int column) const
 
Returns:
the 3D item depth of the data set column

virtual double threeDItemDepth (const QModelIndex &index) const
 
Returns:
the 3D item depth of the model index index

double valueForCell (int row, int column) const
 Helper method, retrieving the data value (DisplayRole) for a given row and column.


Member Enumeration Documentation

enum KDChart::BarDiagram::BarType

Enumerator:
Normal 
Stacked 
Percent 
Rows 

Definition at line 70 of file KDChartBarDiagram.h.

00070                  { Normal,
00071                    Stacked,
00072                    Percent,
00073                    Rows };


Constructor & Destructor Documentation

BarDiagram::BarDiagram ( QWidget parent = 0,
CartesianCoordinatePlane plane = 0 
) [explicit]

Definition at line 55 of file KDChartBarDiagram.cpp.

Referenced by clone().

00055                                                                          :
00056     AbstractCartesianDiagram( new Private(), parent, plane )
00057 {
00058     init();
00059 }

BarDiagram::~BarDiagram (  )  [virtual]

Definition at line 71 of file KDChartBarDiagram.cpp.

00072 {
00073 }


Member Function Documentation

void AbstractCartesianDiagram::addAxis ( CartesianAxis axis  )  [virtual, inherited]

Add the axis to the diagram.

The diagram takes ownership of the axis and will delete it.

To gain back ownership (e.g. for assigning the axis to another diagram) use the takeAxis method, before calling addAxis on the other diagram.

See also:
takeAxis

Definition at line 91 of file KDChartAbstractCartesianDiagram.cpp.

References d, and KDChart::AbstractCartesianDiagram::layoutPlanes().

00092 {
00093     if ( !d->axesList.contains( axis ) ) {
00094         d->axesList.append( axis );
00095         axis->createObserver( this );
00096         layoutPlanes();
00097     }
00098 }

bool AbstractDiagram::allowOverlappingDataValueTexts (  )  const [inherited]

Returns:
Whether data value labels are allowed to overlap.

Definition at line 440 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::compare().

00441 {
00442     return d->allowOverlappingDataValueTexts;
00443 }

bool AbstractDiagram::antiAliasing (  )  const [inherited]

Returns:
Whether anti-aliasing is to be used for rendering this diagram.

Definition at line 451 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::compare().

00452 {
00453     return d->antiAliasing;
00454 }

AttributesModel * AbstractDiagram::attributesModel (  )  const [virtual, inherited]

Returns the AttributesModel, that is used by this diagram.

By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-supplied AttributesModel has been set does the pointer returned here not belong to the diagram.

Returns:
The AttributesModel associated with the diagram.
See also:
setAttributesModel

Definition at line 280 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::compare(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::AbstractDiagram::isHidden(), KDChart::AbstractDiagram::itemRowLabels(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::pen(), KDChart::AbstractCartesianDiagram::setAttributesModel(), setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractCartesianDiagram::setModel(), KDChart::AbstractDiagram::setPen(), and KDChart::TernaryLineDiagram::TernaryLineDiagram().

00281 {
00282     return d->attributesModel;
00283 }

QModelIndex AbstractDiagram::attributesModelRootIndex (  )  const [protected, inherited]

returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.

Definition at line 302 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::AbstractDiagram::itemRowLabels(), KDChart::Plotter::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfAbscissaSegments(), numberOfAbscissaSegments(), KDChart::Plotter::numberOfOrdinateSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), numberOfOrdinateSegments(), KDChart::AbstractDiagram::valueForCell(), and KDChart::LineDiagram::valueForCellTesting().

00303 {
00304     if ( !d->attributesModelRootIndex.isValid() )
00305         d->attributesModelRootIndex = d->attributesModel->mapFromSource( rootIndex() );
00306     return d->attributesModelRootIndex;
00307 }

KDChart::CartesianAxisList AbstractCartesianDiagram::axes (  )  const [virtual, inherited]

Returns:
a list of all axes added to the diagram

Definition at line 110 of file KDChartAbstractCartesianDiagram.cpp.

References d.

Referenced by KDChart::Widget::setType(), and KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().

00111 {
00112     return d->axesList;
00113 }

BarAttributes BarDiagram::barAttributes ( const QModelIndex &  index  )  const

Returns:
the bar attribute set of the model index index

Definition at line 196 of file KDChartBarDiagram.cpp.

References KDChart::BarAttributesRole, and d.

00197 {
00198     return qVariantValue<BarAttributes>(
00199         d->attributesModel->data(
00200             d->attributesModel->mapFromSource( index ),
00201             KDChart::BarAttributesRole ) );
00202 }

BarAttributes BarDiagram::barAttributes ( int  column  )  const

Returns:
the bar attribute set of data set column

Definition at line 185 of file KDChartBarDiagram.cpp.

References KDChart::BarAttributesRole, KDChart::AbstractDiagram::columnToIndex(), and d.

00186 {
00187     return qVariantValue<BarAttributes>(
00188         d->attributesModel->data(
00189             d->attributesModel->mapFromSource( columnToIndex( column ) ),
00190             KDChart::BarAttributesRole ) );
00191 }

BarAttributes BarDiagram::barAttributes (  )  const

Returns:
the global bar attribute set

Definition at line 176 of file KDChartBarDiagram.cpp.

References KDChart::BarAttributesRole, and d.

00177 {
00178     return qVariantValue<BarAttributes>(
00179         d->attributesModel->data( KDChart::BarAttributesRole ) );
00180 }

QBrush AbstractDiagram::brush ( const QModelIndex &  index  )  const [inherited]

Retrieve the brush to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.
Returns:
The brush to use for painting.

Definition at line 838 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::brush(), KDChart::AttributesModel::data(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().

00839 {
00840     if( datasetDimension() > 1 )
00841         return brush( index.column() );
00842     return qVariantValue<QBrush>(
00843         attributesModel()->data(
00844             attributesModel()->mapFromSource( index ),
00845             DatasetBrushRole ) );
00846 }

QBrush AbstractDiagram::brush ( int  dataset  )  const [inherited]

Retrieve the brush to be used for the given dataset.

This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the brush for.
Returns:
The brush to use for painting.

Definition at line 828 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().

00829 {
00830     if( datasetDimension() > 1 )
00831         dataset /= datasetDimension();
00832     return qVariantValue<QBrush>(
00833         attributesModel()->data(
00834             attributesModel()->mapFromSource( columnToIndex( dataset ) ),
00835             DatasetBrushRole ) );
00836 }

QBrush AbstractDiagram::brush (  )  const [inherited]

Retrieve the brush to be used for painting datapoints globally.

This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The brush to use for painting.

Definition at line 822 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetBrushRole.

Referenced by KDChart::AbstractDiagram::brush(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().

00823 {
00824     return qVariantValue<QBrush>(
00825         attributesModel()->data( DatasetBrushRole ) );
00826 }

const QPair< QPointF, QPointF > BarDiagram::calculateDataBoundaries (  )  const [protected, virtual]

[reimplemented]

Implements KDChart::AbstractDiagram.

Definition at line 294 of file KDChartBarDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), and d.

00295 {
00296     if ( !checkInvariants(true) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) );
00297 
00298     // note: calculateDataBoundaries() is ignoring the hidden flags.
00299     // That's not a bug but a feature: Hiding data does not mean removing them.
00300     // For totally removing data from KD Chart's view people can use e.g. a proxy model
00301     // calculate boundaries for different line types Normal - Stacked - Percent - Default Normal
00302     return d->implementor->calculateDataBoundaries();
00303 }

bool AbstractDiagram::checkInvariants ( bool  justReturnTheStatus = false  )  const [protected, virtual, inherited]

Definition at line 1060 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::coordinatePlane().

Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), KDChart::Plotter::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::Plotter::paint(), KDChart::PieDiagram::paint(), KDChart::LineDiagram::paint(), paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().

01061 {
01062     if( ! justReturnTheStatus ){
01063         Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()",
01064                     "There is no usable model set, for the diagram." );
01065 
01066         Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()",
01067                     "There is no usable coordinate plane set, for the diagram." );
01068     }
01069     return model() && coordinatePlane();
01070 }

BarDiagram * BarDiagram::clone (  )  const [virtual]

Creates an exact copy of this diagram.

Definition at line 78 of file KDChartBarDiagram.cpp.

References BarDiagram(), d, setType(), and type().

00079 {
00080 
00081     BarDiagram* newDiagram = new BarDiagram( new Private( *d ) );
00082     newDiagram->setType( type() );
00083     return newDiagram;
00084 }

QModelIndex AbstractDiagram::columnToIndex ( int  column  )  const [protected, inherited]

Definition at line 309 of file KDChartAbstractDiagram.cpp.

Referenced by barAttributes(), KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::AbstractDiagram::isHidden(), KDChart::Plotter::lineAttributes(), KDChart::LineDiagram::lineAttributes(), KDChart::AbstractDiagram::pen(), KDChart::AbstractPieDiagram::pieAttributes(), threeDBarAttributes(), KDChart::Plotter::threeDLineAttributes(), KDChart::LineDiagram::threeDLineAttributes(), and KDChart::AbstractPieDiagram::threeDPieAttributes().

00310 {   // FIXME (Mirko): shouldn't this be headerData? instead of the index for the first row?
00311     if( model() )
00312         return QModelIndex( model()->index( 0, column, rootIndex() ) );
00313     return QModelIndex();
00314 }

bool AbstractDiagram::compare ( const AbstractDiagram other  )  const [inherited]

Returns true if both diagrams have the same settings.

Definition at line 129 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::allowOverlappingDataValueTexts(), KDChart::AbstractDiagram::antiAliasing(), KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::compare(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AbstractDiagram::percentMode().

00130 {
00131     if( other == this ) return true;
00132     if( ! other ){
00133         //qDebug() << "AbstractDiagram::compare() cannot compare to Null pointer";
00134         return false;
00135     }
00136     /*
00137     qDebug() << "\n             AbstractDiagram::compare() QAbstractScrollArea:";
00138             // compare QAbstractScrollArea properties
00139     qDebug() <<
00140             ((horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) &&
00141             (verticalScrollBarPolicy()    == other->verticalScrollBarPolicy()));
00142     qDebug() << "AbstractDiagram::compare() QFrame:";
00143             // compare QFrame properties
00144     qDebug() <<
00145             ((frameShadow() == other->frameShadow()) &&
00146             (frameShape()   == other->frameShape()) &&
00147             (frameWidth()   == other->frameWidth()) &&
00148             (lineWidth()    == other->lineWidth()) &&
00149             (midLineWidth() == other->midLineWidth()));
00150     qDebug() << "AbstractDiagram::compare() QAbstractItemView:";
00151             // compare QAbstractItemView properties
00152     qDebug() <<
00153             ((alternatingRowColors() == other->alternatingRowColors()) &&
00154             (hasAutoScroll()         == other->hasAutoScroll()) &&
00155 #if QT_VERSION > 0x040199
00156             (dragDropMode()          == other->dragDropMode()) &&
00157             (dragDropOverwriteMode() == other->dragDropOverwriteMode()) &&
00158             (horizontalScrollMode()  == other->horizontalScrollMode ()) &&
00159             (verticalScrollMode()    == other->verticalScrollMode()) &&
00160 #endif
00161             (dragEnabled()           == other->dragEnabled()) &&
00162             (editTriggers()          == other->editTriggers()) &&
00163             (iconSize()              == other->iconSize()) &&
00164             (selectionBehavior()     == other->selectionBehavior()) &&
00165             (selectionMode()         == other->selectionMode()) &&
00166             (showDropIndicator()     == other->showDropIndicator()) &&
00167             (tabKeyNavigation()      == other->tabKeyNavigation()) &&
00168             (textElideMode()         == other->textElideMode()));
00169     qDebug() << "AbstractDiagram::compare() AttributesModel: ";
00170             // compare all of the properties stored in the attributes model
00171     qDebug() << attributesModel()->compare( other->attributesModel() );
00172     qDebug() << "AbstractDiagram::compare() own:";
00173             // compare own properties
00174     qDebug() <<
00175             ((rootIndex().column()            == other->rootIndex().column()) &&
00176             (rootIndex().row()                == other->rootIndex().row()) &&
00177             (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) &&
00178             (antiAliasing()                   == other->antiAliasing()) &&
00179             (percentMode()                    == other->percentMode()) &&
00180             (datasetDimension()               == other->datasetDimension()));
00181     */
00182     return  // compare QAbstractScrollArea properties
00183             (horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) &&
00184             (verticalScrollBarPolicy()   == other->verticalScrollBarPolicy()) &&
00185             // compare QFrame properties
00186             (frameShadow()  == other->frameShadow()) &&
00187             (frameShape()   == other->frameShape()) &&
00188 // frameWidth is a read-only property defined by the style, it should not be in here:
00189             // (frameWidth()   == other->frameWidth()) &&
00190             (lineWidth()    == other->lineWidth()) &&
00191             (midLineWidth() == other->midLineWidth()) &&
00192             // compare QAbstractItemView properties
00193             (alternatingRowColors()  == other->alternatingRowColors()) &&
00194             (hasAutoScroll()         == other->hasAutoScroll()) &&
00195 #if QT_VERSION > 0x040199
00196             (dragDropMode()          == other->dragDropMode()) &&
00197             (dragDropOverwriteMode() == other->dragDropOverwriteMode()) &&
00198             (horizontalScrollMode()  == other->horizontalScrollMode ()) &&
00199             (verticalScrollMode()    == other->verticalScrollMode()) &&
00200 #endif
00201             (dragEnabled()           == other->dragEnabled()) &&
00202             (editTriggers()          == other->editTriggers()) &&
00203             (iconSize()              == other->iconSize()) &&
00204             (selectionBehavior()     == other->selectionBehavior()) &&
00205             (selectionMode()         == other->selectionMode()) &&
00206             (showDropIndicator()     == other->showDropIndicator()) &&
00207             (tabKeyNavigation()      == other->tabKeyNavigation()) &&
00208             (textElideMode()         == other->textElideMode()) &&
00209             // compare all of the properties stored in the attributes model
00210             attributesModel()->compare( other->attributesModel() ) &&
00211             // compare own properties
00212             (rootIndex().column()             == other->rootIndex().column()) &&
00213             (rootIndex().row()                == other->rootIndex().row()) &&
00214             (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) &&
00215             (antiAliasing()                   == other->antiAliasing()) &&
00216             (percentMode()                    == other->percentMode()) &&
00217             (datasetDimension()               == other->datasetDimension());
00218 }

bool AbstractCartesianDiagram::compare ( const AbstractCartesianDiagram other  )  const [inherited]

Returns true if both diagrams have the same settings.

Definition at line 46 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractCartesianDiagram::referenceDiagram(), and KDChart::AbstractCartesianDiagram::referenceDiagramOffset().

00047 {
00048     if( other == this ) return true;
00049     if( ! other ){
00050         //qDebug() << "AbstractCartesianDiagram::compare() cannot compare to Null pointer";
00051         return false;
00052     }
00053     /*
00054     qDebug() << "\n             AbstractCartesianDiagram::compare():";
00055             // compare own properties
00056     qDebug() <<
00057             ((referenceDiagram() == other->referenceDiagram()) &&
00058             ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset())));
00059     */
00060     return  // compare the base class
00061             ( static_cast<const AbstractDiagram*>(this)->compare( other ) ) &&
00062             // compare own properties
00063             (referenceDiagram() == other->referenceDiagram()) &&
00064             ((! referenceDiagram()) || (referenceDiagramOffset() == other->referenceDiagramOffset()));
00065 }

bool BarDiagram::compare ( const BarDiagram other  )  const

Returns true if both diagrams have the same settings.

Definition at line 86 of file KDChartBarDiagram.cpp.

References type().

00087 {
00088     if( other == this ) return true;
00089     if( ! other ){
00090         return false;
00091     }
00092 
00093     return  // compare the base class
00094             ( static_cast<const AbstractCartesianDiagram*>(this)->compare( other ) ) &&
00095             // compare own properties
00096             (type() == other->type());
00097 }

AbstractCoordinatePlane * AbstractDiagram::coordinatePlane (  )  const [inherited]

The coordinate plane associated with the diagram.

This determines how coordinates in value space are mapped into pixel space. By default this is a CartesianCoordinatePlane.

Returns:
The coordinate plane associated with the diagram.

Definition at line 220 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().

00221 {
00222     return d->plane;
00223 }

const QPair< QPointF, QPointF > AbstractDiagram::dataBoundaries (  )  const [inherited]

Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values).

This method returns a chached result of calculations done by calculateDataBoundaries. Classes derived from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they can call setDataBoundariesDirty()

Returned value is in diagram coordinates.

Definition at line 225 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::calculateDataBoundaries(), and d.

Referenced by KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::Plotter::paint(), KDChart::LineDiagram::paint(), and paint().

00226 {
00227     if( d->databoundariesDirty ){
00228         d->databoundaries = calculateDataBoundaries ();
00229         d->databoundariesDirty = false;
00230     }
00231     return d->databoundaries;
00232 }

void AbstractDiagram::dataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
) [virtual, inherited]

[reimplemented]

Definition at line 330 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::setDataBoundariesDirty().

00332 {
00333     Q_UNUSED( topLeft );
00334     Q_UNUSED( bottomRight );
00335     // We are still too dumb to do intelligent updates...
00336     setDataBoundariesDirty();
00337     scheduleDelayedItemsLayout();
00338 }

void KDChart::AbstractDiagram::dataHidden (  )  [signal, inherited]

This signal is emitted, when the hidden status of at least one data cell was (un)set.

Referenced by KDChart::AbstractDiagram::setHidden().

QList< QBrush > AbstractDiagram::datasetBrushes (  )  const [inherited]

The set of dataset brushes currently used, for use in legends, etc.

Note:
Cell-level override brushes, if set, take precedence over the dataset values, so you might need to check these too, in order to find the brush, that is used for a single cell.
Returns:
The current set of dataset brushes.

Definition at line 1018 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::DatasetBrushRole, and KDChart::AbstractDiagram::datasetDimension().

Referenced by KDChart::Legend::setBrushesFromDiagram().

01019 {
01020     QList<QBrush> ret;
01021     if( model() == 0 )
01022         return ret;
01023 
01024     const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
01025     for( int i = 0; i < columnCount / datasetDimension(); ++i )
01026         ret << qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetBrushRole ) );
01027 
01028     return ret;
01029 }

int AbstractDiagram::datasetDimension (  )  const [inherited]

The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have.

For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic values will be used for the abscissa.

For example a diagram with the default dimension of 1, will have one column per datapoint (the y values) and will use automatic values for the x axis (1, 2, 3, ... n). If the dimension is 2, the diagram will use the first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y values.

Returns:
The dataset dimension of the diagram.

Definition at line 1072 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::compare(), KDChart::AbstractDiagram::datasetBrushes(), KDChart::AbstractDiagram::datasetLabels(), KDChart::AbstractDiagram::datasetMarkers(), KDChart::AbstractDiagram::datasetPens(), KDChart::LineDiagram::getCellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::AbstractDiagram::paintDataValueTexts(), KDChart::AbstractDiagram::paintMarkers(), KDChart::AbstractDiagram::pen(), KDChart::AbstractDiagram::setPen(), KDChart::Plotter::setType(), and KDChart::LineDiagram::setType().

01073 {
01074     return d->datasetDimension;
01075 }

QStringList AbstractDiagram::datasetLabels (  )  const [inherited]

The set of dataset labels currently displayed, for use in legends, etc.

Returns:
The set of dataset labels currently displayed.

Definition at line 1005 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::AttributesModel::headerData().

01006 {
01007     QStringList ret;
01008     if( model() == 0 )
01009         return ret;
01010     
01011     const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
01012     for( int i = 0; i < columnCount / datasetDimension(); ++i )
01013         ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString();
01014     
01015     return ret;
01016 }

QList< MarkerAttributes > AbstractDiagram::datasetMarkers (  )  const [inherited]

The set of dataset markers currently used, for use in legends, etc.

Note:
Cell-level override markers, if set, take precedence over the dataset values, so you might need to check these too, in order to find the marker, that is shown for a single cell.
Returns:
The current set of dataset brushes.

Definition at line 1044 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::DataValueLabelAttributesRole.

01045 {
01046     QList<MarkerAttributes> ret;
01047     if( model() == 0 )
01048         return ret;
01049     
01050     const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
01051     for( int i = 0; i < columnCount / datasetDimension(); ++i )
01052     {
01053         const DataValueAttributes a =
01054             qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataValueLabelAttributesRole ) );
01055         ret << a.markerAttributes();
01056     }
01057     return ret;
01058 }

QList< QPen > AbstractDiagram::datasetPens (  )  const [inherited]

The set of dataset pens currently used, for use in legends, etc.

Note:
Cell-level override pens, if set, take precedence over the dataset values, so you might need to check these too, in order to find the pens, that is used for a single cell.
Returns:
The current set of dataset pens.

Definition at line 1031 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::columnCount(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::DatasetPenRole.

01032 {
01033     QList<QPen> ret;
01034     if( model() == 0 )
01035         return ret;
01036     
01037     const int columnCount = attributesModel()->columnCount(attributesModelRootIndex());
01038     for( int i = 0; i < columnCount / datasetDimension(); ++i )
01039         ret << qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole ) );
01040     
01041     return ret;
01042 }

DataValueAttributes AbstractDiagram::dataValueAttributes ( const QModelIndex &  index  )  const [inherited]

Retrieve the DataValueAttributes for the given index.

This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific settings.

Parameters:
index The datapoint to retrieve the attributes for.
Returns:
The DataValueAttributes for the given index.

Definition at line 421 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataValueLabelAttributesRole.

00422 {
00423     return qVariantValue<DataValueAttributes>(
00424         attributesModel()->data( attributesModel()->mapFromSource(index),
00425                                  KDChart::DataValueLabelAttributesRole ) );
00426 }

DataValueAttributes AbstractDiagram::dataValueAttributes ( int  column  )  const [inherited]

Retrieve the DataValueAttributes for the given dataset.

This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
column The dataset to retrieve the attributes for.
Returns:
The DataValueAttributes for the given dataset.

Definition at line 414 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), and KDChart::DataValueLabelAttributesRole.

00415 {
00416     return qVariantValue<DataValueAttributes>(
00417         attributesModel()->data( attributesModel()->mapFromSource(columnToIndex( column )),
00418         KDChart::DataValueLabelAttributesRole ) );
00419 }

DataValueAttributes AbstractDiagram::dataValueAttributes (  )  const [inherited]

Retrieve the DataValueAttributes speficied globally.

This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The global DataValueAttributes.

Definition at line 408 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DataValueLabelAttributesRole, and KDChart::AttributesModel::modelData().

Referenced by KDChart::AbstractDiagram::paintDataValueText(), KDChart::AbstractDiagram::paintMarker(), and KDChart::TernaryLineDiagram::TernaryLineDiagram().

00409 {
00410     return qVariantValue<DataValueAttributes>(
00411         attributesModel()->modelData( KDChart::DataValueLabelAttributesRole ) );
00412 }

void AbstractDiagram::doItemsLayout (  )  [virtual, inherited]

[reimplemented]

Definition at line 321 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::update().

00322 {
00323     if ( d->plane ) {
00324         d->plane->layoutDiagrams();
00325         update();
00326     }
00327     QAbstractItemView::doItemsLayout();
00328 }

int AbstractDiagram::horizontalOffset (  )  const [virtual, inherited]

[reimplemented]

Definition at line 950 of file KDChartAbstractDiagram.cpp.

00951 { return 0; }

QModelIndex AbstractDiagram::indexAt ( const QPoint &  point  )  const [virtual, inherited]

[reimplemented]

Definition at line 1098 of file KDChartAbstractDiagram.cpp.

References d.

01099 {
01100     return d->indexAt( point );
01101 }

QModelIndexList AbstractDiagram::indexesAt ( const QPoint &  point  )  const [inherited]

This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot.

Definition at line 1103 of file KDChartAbstractDiagram.cpp.

References d.

01104 {
01105     return d->indexesAt( point );
01106 }

bool AbstractDiagram::isHidden ( const QModelIndex &  index  )  const [inherited]

Retrieve the hidden status for the given index.

This will fall back automatically to what was set at dataset or diagram level, if there are no datapoint specific settings.

Parameters:
index The datapoint to retrieve the hidden status for.
Returns:
The hidden status for the given index.

Definition at line 380 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DataHiddenRole.

00381 {
00382     return qVariantValue<bool>(
00383         attributesModel()->data(
00384             attributesModel()->mapFromSource(index),
00385             DataHiddenRole ) );
00386 }

bool AbstractDiagram::isHidden ( int  column  )  const [inherited]

Retrieve the hidden status for the given dataset.

This will fall back automatically to what was set at diagram level, if there are no dataset specific settings.

Parameters:
column The dataset to retrieve the hidden status for.
Returns:
The hidden status for the given dataset.

Definition at line 373 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), and KDChart::DataHiddenRole.

00374 {
00375     return qVariantValue<bool>(
00376         attributesModel()->data(
00377             attributesModel()->mapFromSource(columnToIndex( column )),
00378             DataHiddenRole ) );
00379 }

bool AbstractDiagram::isHidden (  )  const [inherited]

Retrieve the hidden status speficied globally.

This will fall back automatically to the default settings ( = not hidden), if there are no specific settings.

Returns:
The global hidden status.

Definition at line 367 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DataHiddenRole, and KDChart::AttributesModel::modelData().

Referenced by KDChart::LineDiagram::valueForCellTesting().

00368 {
00369     return qVariantValue<bool>(
00370         attributesModel()->modelData( DataHiddenRole ) );
00371 }

bool AbstractDiagram::isIndexHidden ( const QModelIndex &  index  )  const [virtual, inherited]

[reimplemented]

Definition at line 956 of file KDChartAbstractDiagram.cpp.

00957 { return true; }

QStringList AbstractDiagram::itemRowLabels (  )  const [inherited]

The set of item row labels currently displayed, for use in Abscissa axes, etc.

Returns:
The set of item row labels currently displayed.

Definition at line 989 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::attributesModelRootIndex(), KDChart::AttributesModel::rowCount(), KDChart::AbstractDiagram::unitPrefix(), and KDChart::AbstractDiagram::unitSuffix().

00990 {
00991     QStringList ret;
00992     if( model() ){
00993         //qDebug() << "AbstractDiagram::itemRowLabels(): " << attributesModel()->rowCount(attributesModelRootIndex()) << "entries";
00994         const int rowCount = attributesModel()->rowCount(attributesModelRootIndex());
00995         for( int i = 0; i < rowCount; ++i ){
00996             //qDebug() << "item row label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString();
00997             ret << unitPrefix( i, Qt::Horizontal, true ) +
00998                    attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString() +
00999                    unitSuffix( i, Qt::Horizontal, true );
01000         }
01001     }
01002     return ret;
01003 }

void KDChart::AbstractDiagram::layoutChanged ( AbstractDiagram  )  [signal, inherited]

Diagrams are supposed to emit this signal, when the layout of one of their element changes.

Layouts can change, for example, when axes are added or removed, or when the configuration was changed in a way that the axes or the diagram itself are displayed in a different geometry. Changes in the diagrams coordinate system also result in the layoutChanged() signal being emitted.

Referenced by KDChart::AbstractDiagram::setDatasetDimension(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and setType().

void KDChart::AbstractCartesianDiagram::layoutPlanes (  )  [virtual, inherited]

Triggers layouting of all coordinate planes on the current chart.

Normally you don't need to call this method. It's handled automatically for you.

Definition at line 115 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractCoordinatePlane::layoutPlanes().

Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractCartesianDiagram::takeAxis().

00116 {
00117     //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes()";
00118     AbstractCoordinatePlane* plane = coordinatePlane();
00119     if( plane ){
00120         plane->layoutPlanes();
00121         //qDebug() << "KDChart::AbstractCartesianDiagram::layoutPlanes() OK";
00122     }
00123 }

void KDChart::AbstractDiagram::modelsChanged (  )  [signal, inherited]

This signal is emitted, when either the model or the AttributesModel is replaced.

Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::setModel().

QModelIndex AbstractDiagram::moveCursor ( CursorAction  cursorAction,
Qt::KeyboardModifiers  modifiers 
) [virtual, inherited]

[reimplemented]

Definition at line 947 of file KDChartAbstractDiagram.cpp.

00948 { return QModelIndex(); }

const int BarDiagram::numberOfAbscissaSegments (  )  const [virtual]

[reimplemented]

Implements KDChart::AbstractCartesianDiagram.

Definition at line 338 of file KDChartBarDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

00339 {
00340     return d->attributesModel->rowCount(attributesModelRootIndex());
00341 }

const int BarDiagram::numberOfOrdinateSegments (  )  const [virtual]

[reimplemented]

Implements KDChart::AbstractCartesianDiagram.

Definition at line 343 of file KDChartBarDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

00344 {
00345     return d->attributesModel->columnCount(attributesModelRootIndex());
00346 }

void BarDiagram::paint ( PaintContext paintContext  )  [protected, virtual]

Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.

Parameters:
paintContext All information needed for painting.

Implements KDChart::AbstractDiagram.

Definition at line 314 of file KDChartBarDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::PaintContext::coordinatePlane(), d, KDChart::AbstractDiagram::dataBoundaries(), KDChart::PaintContext::painter(), KDChart::PaintContext::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::sharedAxisMasterPlane().

Referenced by paintEvent().

00315 {
00316     if ( !checkInvariants( true ) ) return;
00317     if ( !AbstractGrid::isBoundariesValid(dataBoundaries()) ) return;
00318     const PainterSaver p( ctx->painter() );
00319     if( model()->rowCount() == 0 || model()->columnCount() == 0 )
00320         return; // nothing to paint for us
00321 
00322     AbstractCoordinatePlane* const plane = ctx->coordinatePlane();
00323     ctx->setCoordinatePlane( plane->sharedAxisMasterPlane( ctx->painter() ) );
00324 
00325     // paint different bar types Normal - Stacked - Percent - Default Normal
00326     d->implementor->paint( ctx );
00327 
00328     ctx->setCoordinatePlane( plane );
00329 }

void AbstractDiagram::paintDataValueText ( QPainter *  painter,
const QModelIndex &  index,
const QPointF &  pos,
double  value 
) [inherited]

Definition at line 468 of file KDChartAbstractDiagram.cpp.

References d, KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::DataValueAttributes::isVisible(), KDChartEnums::MeasureOrientationMinimum, KDChart::DataValueAttributes::position(), KDChart::DataValueAttributes::prefix(), KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes().

Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::AbstractDiagram::paintDataValueTexts().

00472 {
00473     // paint one data series
00474     const DataValueAttributes a( dataValueAttributes(index) );
00475     if ( !a.isVisible() ) return;
00476 
00477     // handle decimal digits
00478     int decimalDigits = a.decimalDigits();
00479     int decimalPos = QString::number(  value ).indexOf( QLatin1Char( '.' ) );
00480     QString roundedValue;
00481     if ( a.dataLabel().isNull() ) {
00482         if ( decimalPos > 0 && value != 0 )
00483             roundedValue =  roundValues ( value, decimalPos, decimalDigits );
00484         else
00485             roundedValue = QString::number(  value );
00486     } else
00487         roundedValue = a.dataLabel();
00488         // handle prefix and suffix
00489     if ( !a.prefix().isNull() )
00490         roundedValue.prepend( a.prefix() );
00491 
00492     if ( !a.suffix().isNull() )
00493         roundedValue.append( a.suffix() );
00494 
00495     const TextAttributes ta( a.textAttributes() );
00496     // FIXME draw the non-text bits, background, etc
00497     if ( ta.isVisible() ) {
00498 
00499         QPointF pt( pos );
00500         /* for debugging:
00501         PainterSaver painterSaver( painter );
00502         painter->setPen( Qt::black );
00503         painter->drawLine( pos - QPointF( 1,1), pos + QPointF( 1,1) );
00504         painter->drawLine( pos - QPointF(-1,1), pos + QPointF(-1,1) );
00505         */
00506 
00507         QTextDocument doc;
00508         if( Qt::mightBeRichText( roundedValue ) )
00509             doc.setHtml( roundedValue );
00510         else
00511             doc.setPlainText( roundedValue );
00512 
00513         const RelativePosition relPos( a.position( value >= 0.0 ) );
00514         const Qt::Alignment alignBottomLeft = Qt::AlignBottom | Qt::AlignLeft;
00515         const QFont calculatedFont( ta.calculatedFont( d->plane, KDChartEnums::MeasureOrientationMinimum ) );
00516         const QRectF boundRect( d->cachedFontMetrics( calculatedFont, painter->device() )->boundingRect( doc.toPlainText() ) );
00517 
00518         // To place correctly
00519         pt.ry() -= boundRect.height();
00520 
00521         //qDebug() << "calculatedFont's point size:" << calculatedFont.pointSizeF();
00522         // adjust the text start point position, if alignment is not Bottom/Left
00523         if( (relPos.alignment() & alignBottomLeft) != alignBottomLeft ){
00524             if( relPos.alignment() & Qt::AlignRight )
00525                 pt.rx() -= boundRect.width();
00526             else if( relPos.alignment() & Qt::AlignHCenter )
00527                 pt.rx() -= 0.5 * boundRect.width();
00528 
00529             if( relPos.alignment() & Qt::AlignTop )
00530                 pt.ry() += boundRect.height();
00531             else if( relPos.alignment() & Qt::AlignVCenter )
00532                 pt.ry() += 0.5 * boundRect.height();
00533         }
00534 
00535         // FIXME draw the non-text bits, background, etc
00536 
00537         if ( a.showRepetitiveDataLabels() ||
00538              pos.x() <= d->lastX ||
00539              d->lastRoundedValue != roundedValue ) {
00540             d->lastRoundedValue = roundedValue;
00541             d->lastX = pos.x();
00542             PainterSaver painterSaver( painter );
00543 
00544             doc.setDefaultFont( calculatedFont );
00545             QAbstractTextDocumentLayout::PaintContext context;
00546             context.palette = palette();
00547             context.palette.setColor(QPalette::Text, ta.pen().color() );
00548 
00549             painter->translate( pt );
00550             painter->rotate( ta.rotation() );
00551 
00552             QAbstractTextDocumentLayout* layout = doc.documentLayout();
00553             layout->draw( painter, context );
00554         }
00555     }
00556 }

void AbstractDiagram::paintDataValueTexts ( QPainter *  painter  )  [protected, virtual, inherited]

Definition at line 584 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractCoordinatePlane::translate().

00585 {
00586     if ( !checkInvariants() ) return;
00587     const int rowCount = model()->rowCount(rootIndex());
00588     const int columnCount = model()->columnCount(rootIndex());
00589     for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) {
00590        for ( int j=0; j< rowCount; ++j ) {
00591            const QModelIndex index = model()->index( j, i, rootIndex() );
00592            double value = model()->data( index ).toDouble();
00593            const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
00594            paintDataValueText( painter, index, pos, value );
00595        }
00596     }
00597 }

void BarDiagram::paintEvent ( QPaintEvent *   )  [protected]

Definition at line 305 of file KDChartBarDiagram.cpp.

References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().

00306 {
00307     QPainter painter ( viewport() );
00308     PaintContext ctx;
00309     ctx.setPainter ( &painter );
00310     ctx.setRectangle( QRectF ( 0, 0, width(), height() ) );
00311     paint ( &ctx );
00312 }

void AbstractDiagram::paintMarker ( QPainter *  painter,
const QModelIndex &  index,
const QPointF &  pos 
) [inherited]

Definition at line 600 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::brush(), KDChart::AbstractDiagram::checkInvariants(), d, KDChart::AbstractDiagram::dataValueAttributes(), KDChart::MarkerAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::DataValueAttributes::markerAttributes(), KDChart::MarkerAttributes::markerColor(), KDChart::MarkerAttributes::markerSize(), KDChart::AbstractDiagram::paintMarker(), and KDChart::MarkerAttributes::pen().

00603 {
00604     if ( !checkInvariants() ) return;
00605     DataValueAttributes a = dataValueAttributes(index);
00606     if ( !a.isVisible() ) return;
00607     const MarkerAttributes &ma = a.markerAttributes();
00608     if ( !ma.isVisible() ) return;
00609 
00610     PainterSaver painterSaver( painter );
00611     QSizeF maSize( ma.markerSize() );
00612     QBrush indexBrush( brush( index ) );
00613     QPen indexPen( ma.pen() );
00614     if ( ma.markerColor().isValid() )
00615         indexBrush.setColor( ma.markerColor() );
00616 
00617     paintMarker( painter, ma, indexBrush, indexPen, pos, maSize );
00618 
00619     // workaround: BC cannot be changed, otherwise we would pass the
00620     // index down to next-lower paintMarker function. So far, we
00621     // basically save a circle of radius maSize at pos in the
00622     // reverseMapper. This means that ^^^ this version of paintMarker
00623     // needs to be called to reverse-map the marker.
00624     d->reverseMapper.addCircle( index.row(), index.column(), pos, 2 * maSize );
00625 }

void AbstractDiagram::paintMarker ( QPainter *  painter,
const MarkerAttributes markerAttributes,
const QBrush &  brush,
const QPen &  ,
const QPointF &  point,
const QSizeF &  size 
) [virtual, inherited]

Definition at line 627 of file KDChartAbstractDiagram.cpp.

References KDChart::MarkerAttributes::Marker1Pixel, KDChart::MarkerAttributes::Marker4Pixels, KDChart::MarkerAttributes::MarkerCircle, KDChart::MarkerAttributes::MarkerCross, KDChart::MarkerAttributes::MarkerDiamond, KDChart::MarkerAttributes::MarkerFastCross, KDChart::MarkerAttributes::MarkerRing, KDChart::MarkerAttributes::MarkerSquare, and KDChart::MarkerAttributes::markerStyle().

Referenced by KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::MarkerLayoutItem::paintIntoRect(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractDiagram::paintMarkers().

00633 {
00634     const QPen oldPen( painter->pen() );
00635     // Pen is used to paint 4Pixels - 1 Pixel - Ring and FastCross types.
00636     // make sure to use the brush color - see above in those cases.
00637     const bool isFourPixels = (markerAttributes.markerStyle() == MarkerAttributes::Marker4Pixels);
00638     if( isFourPixels || (markerAttributes.markerStyle() == MarkerAttributes::Marker1Pixel) ){
00639         // for high-performance point charts with tiny point markers:
00640         painter->setPen( QPen( brush.color().light() ) );
00641         if( isFourPixels ){
00642             const qreal x = pos.x();
00643             const qreal y = pos.y();
00644             painter->drawLine( QPointF(x-1.0,y-1.0),
00645                                QPointF(x+1.0,y-1.0) );
00646             painter->drawLine( QPointF(x-1.0,y),
00647                                QPointF(x+1.0,y) );
00648             painter->drawLine( QPointF(x-1.0,y+1.0),
00649                                QPointF(x+1.0,y+1.0) );
00650         }
00651         painter->drawPoint( pos );
00652     }else{
00653         PainterSaver painterSaver( painter );
00654         // we only a solid line surrounding the markers
00655         QPen painterPen( pen );
00656         painterPen.setStyle( Qt::SolidLine );
00657         painter->setPen( painterPen );
00658         painter->setBrush( brush );
00659         painter->setRenderHint ( QPainter::Antialiasing );
00660         painter->translate( pos );
00661         switch ( markerAttributes.markerStyle() ) {
00662             case MarkerAttributes::MarkerCircle:
00663                 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
00664                             maSize.height(), maSize.width()) );
00665                 break;
00666             case MarkerAttributes::MarkerSquare:
00667                 {
00668                     QRectF rect( 0 - maSize.width()/2, 0 - maSize.height()/2,
00669                                 maSize.width(), maSize.height() );
00670                     painter->drawRect( rect );
00671                     break;
00672                 }
00673             case MarkerAttributes::MarkerDiamond:
00674                 {
00675                     QVector <QPointF > diamondPoints;
00676                     QPointF top, left, bottom, right;
00677                     top    = QPointF( 0, 0 - maSize.height()/2 );
00678                     left   = QPointF( 0 - maSize.width()/2, 0 );
00679                     bottom = QPointF( 0, maSize.height()/2 );
00680                     right  = QPointF( maSize.width()/2, 0 );
00681                     diamondPoints << top << left << bottom << right;
00682                     painter->drawPolygon( diamondPoints );
00683                     break;
00684                 }
00685             // both handled on top of the method:
00686             case MarkerAttributes::Marker1Pixel:
00687             case MarkerAttributes::Marker4Pixels:
00688                     break;
00689             case MarkerAttributes::MarkerRing:
00690                 {
00691                     painter->setPen( QPen( brush.color() ) );
00692                     painter->setBrush( Qt::NoBrush );
00693                     painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2,
00694                                         maSize.height(), maSize.width()) );
00695                     break;
00696                 }
00697             case MarkerAttributes::MarkerCross:
00698                 {
00699                     QRectF rect( maSize.width()*-0.5, maSize.height()*-0.2,
00700                                  maSize.width(), maSize.height()*0.4 );
00701                     painter->drawRect( rect );
00702                     rect.setTopLeft(QPointF( maSize.width()*-0.2, maSize.height()*-0.5 ));
00703                     rect.setSize(QSizeF( maSize.width()*0.4, maSize.height() ));
00704                     painter->drawRect( rect );
00705                     break;
00706                 }
00707             case MarkerAttributes::MarkerFastCross:
00708                 {
00709                     QPointF left, right, top, bottom;
00710                     left  = QPointF( -maSize.width()/2, 0 );
00711                     right = QPointF( maSize.width()/2, 0 );
00712                     top   = QPointF( 0, -maSize.height()/2 );
00713                     bottom= QPointF( 0, maSize.height()/2 );
00714                     painter->setPen( QPen( brush.color() ) );
00715                     painter->drawLine( left, right );
00716                     painter->drawLine(  top, bottom );
00717                     break;
00718                 }
00719             default:
00720                 Q_ASSERT_X ( false, "paintMarkers()",
00721                             "Type item does not match a defined Marker Type." );
00722         }
00723     }
00724     painter->setPen( oldPen );
00725 }

void AbstractDiagram::paintMarkers ( QPainter *  painter  )  [protected, virtual, inherited]

Definition at line 727 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::paintMarker(), and KDChart::AbstractCoordinatePlane::translate().

00728 {
00729     if ( !checkInvariants() ) return;
00730     const int rowCount = model()->rowCount(rootIndex());
00731     const int columnCount = model()->columnCount(rootIndex());
00732     for ( int i=datasetDimension()-1; i<columnCount; i += datasetDimension() ) {
00733        for ( int j=0; j< rowCount; ++j ) {
00734            const QModelIndex index = model()->index( j, i, rootIndex() );
00735            double value = model()->data( index ).toDouble();
00736            const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) );
00737            paintMarker( painter, index, pos );
00738        }
00739     }
00740 }

QPen AbstractDiagram::pen ( const QModelIndex &  index  )  const [inherited]

Retrieve the pen to be used, for painting the datapoint at the given index in the model.

Parameters:
index The index of the datapoint in the model.
Returns:
The pen to use for painting.

Definition at line 788 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, and KDChart::AbstractDiagram::pen().

00789 {
00790     if( datasetDimension() > 1 )
00791         return pen( index.column() );
00792     return qVariantValue<QPen>(
00793         attributesModel()->data(
00794             attributesModel()->mapFromSource( index ),
00795             DatasetPenRole ) );
00796 }

QPen AbstractDiagram::pen ( int  dataset  )  const [inherited]

Retrieve the pen to be used for the given dataset.

This will fall back automatically to what was set at model level, if there are no dataset specific settings.

Parameters:
dataset The dataset to retrieve the pen for.
Returns:
The pen to use for painting.

Definition at line 777 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::columnToIndex(), KDChart::AttributesModel::data(), KDChart::AbstractDiagram::datasetDimension(), and KDChart::DatasetPenRole.

00778 {
00779     if( datasetDimension() > 1 )
00780         dataset /= datasetDimension();
00781 
00782     return qVariantValue<QPen>(
00783         attributesModel()->data(
00784             attributesModel()->mapFromSource( columnToIndex( dataset ) ),
00785             DatasetPenRole ) );
00786 }

QPen AbstractDiagram::pen (  )  const [inherited]

Retrieve the pen to be used for painting datapoints globally.

This will fall back automatically to the default settings, if there are no specific settings.

Returns:
The pen to use for painting.

Definition at line 771 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AttributesModel::data(), and KDChart::DatasetPenRole.

Referenced by KDChart::TernaryPointDiagram::paint(), KDChart::TernaryLineDiagram::paint(), and KDChart::AbstractDiagram::pen().

00772 {
00773     return qVariantValue<QPen>(
00774         attributesModel()->data( DatasetPenRole ) );
00775 }

bool AbstractDiagram::percentMode (  )  const [inherited]

Definition at line 462 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::compare(), and KDChart::CartesianCoordinatePlane::getDataDimensionsList().

00463 {
00464     return d->percent;
00465 }

void KDChart::AbstractDiagram::propertiesChanged (  )  [signal, inherited]

Emitted upon change of a property of the Diagram.

Referenced by KDChart::Plotter::resetLineAttributes(), KDChart::LineDiagram::resetLineAttributes(), KDChart::AbstractDiagram::setAllowOverlappingDataValueTexts(), KDChart::AbstractDiagram::setAntiAliasing(), setBarAttributes(), KDChart::AbstractDiagram::setBrush(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::AbstractDiagram::setPen(), KDChart::AbstractDiagram::setPercentMode(), setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), setType(), KDChart::Plotter::setValueTrackerAttributes(), and KDChart::LineDiagram::setValueTrackerAttributes().

AbstractCartesianDiagram * AbstractCartesianDiagram::referenceDiagram (  )  const [virtual, inherited]

Returns:
this diagram's reference diagram

See also:
setReferenceDiagram

Definition at line 148 of file KDChartAbstractCartesianDiagram.cpp.

References d.

Referenced by KDChart::AbstractCartesianDiagram::compare(), and referenceDiagramIsBarDiagram().

00149 {
00150     return d->referenceDiagram;
00151 }

QPointF AbstractCartesianDiagram::referenceDiagramOffset (  )  const [virtual, inherited]

Returns:
the relative offset of this diagram's reference diagram

See also:
setReferenceDiagram

Definition at line 153 of file KDChartAbstractCartesianDiagram.cpp.

References d.

Referenced by KDChart::AbstractCartesianDiagram::compare().

00154 {
00155     return d->referenceDiagramOffset;
00156 }

void BarDiagram::resize ( const QSizeF &  area  )  [virtual]

Called by the widget's sizeEvent.

Adjust all internal structures, that are calculated, dependending on the size of the widget.

Parameters:
area 

Implements KDChart::AbstractDiagram.

Definition at line 331 of file KDChartBarDiagram.cpp.

References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().

00332 {
00333     d->compressor.setResolution( static_cast< int >( size.width() ),
00334                                  static_cast< int >( size.height() ) );
00335     setDataBoundariesDirty();
00336 }

void BarDiagram::resizeEvent ( QResizeEvent *   )  [protected]

Definition at line 289 of file KDChartBarDiagram.cpp.

00290 {
00291 
00292 }

void AbstractDiagram::scrollTo ( const QModelIndex &  index,
ScrollHint  hint = EnsureVisible 
) [virtual, inherited]

[reimplemented]

Definition at line 942 of file KDChartAbstractDiagram.cpp.

00943 {}

void AbstractDiagram::setAllowOverlappingDataValueTexts ( bool  allow  )  [inherited]

Set whether data value labels are allowed to overlap.

Parameters:
allow True means that overlapping labels are allowed.

Definition at line 434 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

00435 {
00436     d->allowOverlappingDataValueTexts = allow;
00437     emit propertiesChanged();
00438 }

void AbstractDiagram::setAntiAliasing ( bool  enabled  )  [inherited]

Set whether anti-aliasing is to be used while rendering this diagram.

Parameters:
enabled True means that AA is enabled.

Definition at line 445 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

00446 {
00447     d->antiAliasing = enabled;
00448     emit propertiesChanged();
00449 }

void AbstractCartesianDiagram::setAttributesModel ( AttributesModel model  )  [virtual, inherited]

Associate an AttributesModel with this diagram.

Note that the diagram does _not_ take ownership of the AttributesModel. This should thus only be used with AttributesModels that have been explicitely created by the user, and are owned by her. Setting an AttributesModel that is internal to another diagram is an error.

Correct:

 AttributesModel *am = new AttributesModel( model, 0 );
 diagram1->setAttributesModel( am );
 diagram2->setAttributesModel( am );

Wrong:

 diagram1->setAttributesModel( diagram2->attributesModel() );

Parameters:
model The AttributesModel to use for this diagram.
See also:
AttributesModel, usesExternalAttributesModel

Reimplemented from KDChart::AbstractDiagram.

Definition at line 170 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setAttributesModel().

00171 {
00172     AbstractDiagram::setAttributesModel( model );
00173     d->compressor.setModel( attributesModel() );
00174 }

void AbstractDiagram::setAttributesModelRootIndex ( const QModelIndex &   )  [protected, inherited]

Definition at line 293 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::setDataBoundariesDirty().

Referenced by KDChart::AbstractDiagram::setRootIndex().

00294 {
00295     d->attributesModelRootIndex=idx;
00296     setDataBoundariesDirty();
00297     scheduleDelayedItemsLayout();
00298 }

void BarDiagram::setBarAttributes ( const QModelIndex &  index,
const BarAttributes a 
)

Sets the line attributes for the model index index to ba.

Definition at line 164 of file KDChartBarDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::BarAttributesRole, d, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().

00165 {
00166     attributesModel()->setData(
00167         d->attributesModel->mapFromSource( index ),
00168         qVariantFromValue( ba ),
00169         BarAttributesRole );
00170     emit propertiesChanged();
00171 }

void BarDiagram::setBarAttributes ( int  column,
const BarAttributes a 
)

Sets the bar attributes of data set column to ba.

Definition at line 152 of file KDChartBarDiagram.cpp.

References KDChart::BarAttributesRole, d, and KDChart::AbstractDiagram::propertiesChanged().

00153 {
00154     d->attributesModel->setHeaderData(
00155         column, Qt::Vertical,
00156         qVariantFromValue( ba ),
00157         BarAttributesRole );
00158     emit propertiesChanged();
00159 }

void BarDiagram::setBarAttributes ( const BarAttributes a  ) 

Sets the global bar attributes to ba.

Definition at line 143 of file KDChartBarDiagram.cpp.

References KDChart::BarAttributesRole, d, and KDChart::AbstractDiagram::propertiesChanged().

00144 {
00145     d->attributesModel->setModelData( qVariantFromValue( ba ), BarAttributesRole );
00146     emit propertiesChanged();
00147 }

void AbstractDiagram::setBrush ( const QBrush &  brush  )  [inherited]

Set the brush to be used, for painting all datasets in the model.

Parameters:
brush The brush to use.

Definition at line 806 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().

00807 {
00808     attributesModel()->setModelData(
00809         qVariantFromValue( brush ), DatasetBrushRole );
00810     emit propertiesChanged();
00811 }

void AbstractDiagram::setBrush ( int  dataset,
const QBrush &  brush 
) [inherited]

Set the brush to be used, for painting the given dataset.

Parameters:
dataset The dataset's column in the model.
brush The brush to use.

Definition at line 813 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().

00814 {
00815     attributesModel()->setHeaderData(
00816         column, Qt::Vertical,
00817         qVariantFromValue( brush ),
00818         DatasetBrushRole );
00819     emit propertiesChanged();
00820 }

void AbstractDiagram::setBrush ( const QModelIndex &  index,
const QBrush &  brush 
) [inherited]

Set the brush to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint's index in the model.
brush The brush to use.

Definition at line 798 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetBrushRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().

00799 {
00800     attributesModel()->setData(
00801         attributesModel()->mapFromSource( index ),
00802         qVariantFromValue( brush ), DatasetBrushRole );
00803     emit propertiesChanged();
00804 }

void KDChart::AbstractCartesianDiagram::setCoordinatePlane ( AbstractCoordinatePlane plane  )  [virtual, inherited]

[reimplemented]

Reimplemented from KDChart::AbstractDiagram.

Definition at line 125 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::coordinatePlane(), and KDChart::AbstractDiagram::setCoordinatePlane().

00126 {
00127     if( coordinatePlane() ) disconnect( coordinatePlane() );
00128     AbstractDiagram::setCoordinatePlane(plane);
00129 
00130     // show the axes, after all have been adjusted
00131     // (because they might be dependend on each other)
00132     /*
00133     if( plane )
00134         Q_FOREACH( CartesianAxis* axis, d->axesList )
00135             axis->show();
00136     else
00137         Q_FOREACH( CartesianAxis* axis, d->axesList )
00138             axis->hide();
00139     */
00140 }

void AbstractDiagram::setDataBoundariesDirty (  )  const [protected, inherited]

Definition at line 234 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::dataChanged(), KDChart::Plotter::resize(), KDChart::LineDiagram::resize(), resize(), KDChart::AbstractDiagram::setAttributesModel(), KDChart::AbstractDiagram::setAttributesModelRootIndex(), KDChart::AbstractDiagram::setDatasetDimension(), KDChart::AbstractDiagram::setModel(), setThreeDBarAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setType(), KDChart::LineDiagram::setType(), and setType().

00235 {
00236     d->databoundariesDirty = true;
00237 }

void AbstractDiagram::setDatasetDimension ( int  dimension  )  [inherited]

Sets the dataset dimension of the diagram.

See also:
datasetDimension.
Parameters:
dimension 

Definition at line 1077 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::layoutChanged(), and KDChart::AbstractDiagram::setDataBoundariesDirty().

Referenced by KDChart::Widget::setType(), KDChart::TernaryLineDiagram::TernaryLineDiagram(), and KDChart::TernaryPointDiagram::TernaryPointDiagram().

01078 {
01079     if ( d->datasetDimension == dimension ) return;
01080     d->datasetDimension = dimension;
01081     setDataBoundariesDirty();
01082     emit layoutChanged( this );
01083 }

void AbstractDiagram::setDataValueAttributes ( const DataValueAttributes a  )  [inherited]

Set the DataValueAttributes for all datapoints in the model.

Parameters:
a The attributes to set.

Definition at line 428 of file KDChartAbstractDiagram.cpp.

References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00429 {
00430     d->attributesModel->setModelData( qVariantFromValue( a ), DataValueLabelAttributesRole );
00431     emit propertiesChanged();
00432 }

void AbstractDiagram::setDataValueAttributes ( int  dataset,
const DataValueAttributes a 
) [inherited]

Set the DataValueAttributes for the given dataset.

Parameters:
dataset The dataset to set the attributes for.
a The attributes to set.

Definition at line 400 of file KDChartAbstractDiagram.cpp.

References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00401 {
00402     d->attributesModel->setHeaderData(
00403         column, Qt::Vertical,
00404         qVariantFromValue( a ), DataValueLabelAttributesRole );
00405     emit propertiesChanged();
00406 }

void AbstractDiagram::setDataValueAttributes ( const QModelIndex &  index,
const DataValueAttributes a 
) [inherited]

Set the DataValueAttributes for the given index.

Parameters:
index The datapoint to set the attributes for.
a The attributes to set.

Definition at line 389 of file KDChartAbstractDiagram.cpp.

References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().

00391 {
00392     d->attributesModel->setData(
00393         d->attributesModel->mapFromSource( index ),
00394         qVariantFromValue( a ),
00395         DataValueLabelAttributesRole );
00396     emit propertiesChanged();
00397 }

void AbstractDiagram::setHidden ( bool  hidden  )  [inherited]

Hide (or unhide, resp.

) all datapoints in the model.

Note:
Hidden data are still taken into account by the coordinate plane, so neither the grid nor your axes' ranges will change, when you hide data. For totally removing data from KD Chart's view you can use another approach: e.g. you could define a proxy model on top of your data model, and register the proxy model calling setModel() instead of registering your real data model.
Parameters:
hidden The hidden status to set.

Definition at line 359 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.

00360 {
00361     d->attributesModel->setModelData(
00362         qVariantFromValue( hidden ),
00363         DataHiddenRole );
00364     emit dataHidden();
00365 }

void AbstractDiagram::setHidden ( int  column,
bool  hidden 
) [inherited]

Hide (or unhide, resp.

) a dataset.

Note:
Hidden data are still taken into account by the coordinate plane, so neither the grid nor your axes' ranges will change, when you hide data. For totally removing data from KD Chart's view you can use another approach: e.g. you could define a proxy model on top of your data model, and register the proxy model calling setModel() instead of registering your real data model.
Parameters:
column The dataset to set the hidden status for.
hidden The hidden status to set.

Definition at line 350 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.

00351 {
00352     d->attributesModel->setHeaderData(
00353         column, Qt::Vertical,
00354         qVariantFromValue( hidden ),
00355         DataHiddenRole );
00356     emit dataHidden();
00357 }

void AbstractDiagram::setHidden ( const QModelIndex &  index,
bool  hidden 
) [inherited]

Hide (or unhide, resp.

) a data cell.

Note:
Hidden data are still taken into account by the coordinate plane, so neither the grid nor your axes' ranges will change, when you hide data. For totally removing data from KD Chart's view you can use another approach: e.g. you could define a proxy model on top of your data model, and register the proxy model calling setModel() instead of registering your real data model.
Parameters:
index The datapoint to set the hidden status for.
hidden The hidden status to set.

Definition at line 341 of file KDChartAbstractDiagram.cpp.

References d, KDChart::AbstractDiagram::dataHidden(), and KDChart::DataHiddenRole.

00342 {
00343     d->attributesModel->setData(
00344         d->attributesModel->mapFromSource( index ),
00345         qVariantFromValue( hidden ),
00346         DataHiddenRole );
00347     emit dataHidden();
00348 }

void AbstractCartesianDiagram::setModel ( QAbstractItemModel *  model  )  [virtual, inherited]

Associate a model with the diagram.

Reimplemented from KDChart::AbstractDiagram.

Definition at line 164 of file KDChartAbstractCartesianDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), d, and KDChart::AbstractDiagram::setModel().

00165 {
00166     AbstractDiagram::setModel( model );
00167     d->compressor.setModel( attributesModel() );
00168 }

void AbstractDiagram::setPen ( const QPen &  pen  )  [inherited]

Set the pen to be used, for painting all datasets in the model.

Parameters:
pen The pen to use.

Definition at line 753 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setModelData().

00754 {
00755     attributesModel()->setModelData(
00756         qVariantFromValue( pen ), DatasetPenRole );
00757     emit propertiesChanged();
00758 }

void AbstractDiagram::setPen ( int  dataset,
const QPen &  pen 
) [inherited]

Set the pen to be used, for painting the given dataset.

Parameters:
dataset The dataset's row in the model.
pen The pen to use.

Definition at line 760 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setHeaderData().

00761 {
00762     if( datasetDimension() > 1 )
00763         column *= datasetDimension();
00764     attributesModel()->setHeaderData(
00765         column, Qt::Vertical,
00766         qVariantFromValue( pen ),
00767         DatasetPenRole );
00768     emit propertiesChanged();
00769 }

void AbstractDiagram::setPen ( const QModelIndex &  index,
const QPen &  pen 
) [inherited]

Set the pen to be used, for painting the datapoint at the given index.

Parameters:
index The datapoint's index in the model.
pen The pen to use.

Definition at line 743 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModel(), KDChart::AbstractDiagram::datasetDimension(), KDChart::DatasetPenRole, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().

00744 {
00745     if( datasetDimension() > 1 )
00746         return setPen( index.column(), pen );
00747     attributesModel()->setData(
00748         attributesModel()->mapFromSource( index ),
00749         qVariantFromValue( pen ), DatasetPenRole );
00750     emit propertiesChanged();
00751 }

void AbstractDiagram::setPercentMode ( bool  percent  )  [inherited]

Definition at line 456 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AbstractDiagram::propertiesChanged().

Referenced by KDChart::LineDiagram::setType(), and setType().

00457 {
00458     d->percent = percent;
00459     emit propertiesChanged();
00460 }

void AbstractCartesianDiagram::setReferenceDiagram ( AbstractCartesianDiagram diagram,
const QPointF &  offset = QPointF() 
) [virtual, inherited]

Makes this diagram use another diagram diagram as reference diagram with relative offset offset.

To share cartesian axes between different diagrams there might be cases when you need that. Normally you don't.

See also:
examples/SharedAbscissa

Definition at line 142 of file KDChartAbstractCartesianDiagram.cpp.

References d.

00143 {
00144     d->referenceDiagram = diagram;
00145     d->referenceDiagramOffset = offset;
00146 }

void AbstractCartesianDiagram::setRootIndex ( const QModelIndex &  index  )  [virtual, inherited]

Set the root index in the model, where the diagram starts referencing data for display.

[reimplemented]

Reimplemented from KDChart::AbstractDiagram.

Definition at line 158 of file KDChartAbstractCartesianDiagram.cpp.

References d, and KDChart::AbstractDiagram::setRootIndex().

00159 {
00160     d->compressor.setRootIndex( index );
00161     AbstractDiagram::setRootIndex( index );
00162 }

void AbstractDiagram::setSelection ( const QRect &  rect,
QItemSelectionModel::SelectionFlags  command 
) [virtual, inherited]

[reimplemented]

Definition at line 959 of file KDChartAbstractDiagram.cpp.

References d.

00960 {
00961     const QModelIndexList indexes = d->indexesIn( rect );
00962     QItemSelection selection;
00963     KDAB_FOREACH( const QModelIndex& index, indexes )
00964     {
00965         selection.append( QItemSelectionRange( index ) );
00966     }
00967     selectionModel()->select( selection, command );
00968 }

void BarDiagram::setThreeDBarAttributes ( const QModelIndex &  index,
const ThreeDBarAttributes a 
)

Sets the 3D line attributes of model index index to threeDAttrs.

Definition at line 233 of file KDChartBarDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.

00234 {
00235     setDataBoundariesDirty();
00236     d->attributesModel->setData(
00237         d->attributesModel->mapFromSource(index),
00238         qVariantFromValue( threeDAttrs ),
00239         ThreeDBarAttributesRole );
00240     //emit layoutChanged( this );
00241     emit propertiesChanged();
00242 }

void BarDiagram::setThreeDBarAttributes ( int  column,
const ThreeDBarAttributes a 
)

Sets the 3D bar attributes of dataset column to threeDAttrs.

Definition at line 218 of file KDChartBarDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.

00219 {
00220     setDataBoundariesDirty();
00221     d->attributesModel->setHeaderData(
00222         column, Qt::Vertical,
00223         qVariantFromValue( threeDAttrs ),
00224         ThreeDBarAttributesRole );
00225     //emit layoutChanged( this );
00226     emit propertiesChanged();
00227 
00228 }

void BarDiagram::setThreeDBarAttributes ( const ThreeDBarAttributes a  ) 

Sets the global 3D bar attributes to threeDAttrs.

Definition at line 207 of file KDChartBarDiagram.cpp.

References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.

00208 {
00209     setDataBoundariesDirty();
00210     d->attributesModel->setModelData( qVariantFromValue( threeDAttrs ), ThreeDBarAttributesRole );
00211     //emit layoutChanged( this );
00212      emit propertiesChanged();
00213 }

void BarDiagram::setType ( const BarType  type  ) 

Sets the bar diagram's type to type.

See also:
BarDiagram::BarType

Definition at line 103 of file KDChartBarDiagram.cpp.

References d, KDChart::AbstractDiagram::layoutChanged(), Normal, Percent, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), KDChart::AbstractDiagram::setPercentMode(), and Stacked.

Referenced by clone().

00104 {
00105     //if ( type == d->barType ) return;
00106      if ( d->implementor->type() == type ) return;
00107 
00108      switch( type ) {
00109      case Normal:
00110          d->implementor = d->normalDiagram;
00111          break;
00112      case Stacked:
00113          d->implementor = d->stackedDiagram;
00114          break;
00115      case Percent:
00116          d->implementor = d->percentDiagram;
00117          break;
00118      default:
00119          Q_ASSERT_X( false, "BarDiagram::setType", "unknown diagram subtype" );
00120      };
00121 
00122    Q_ASSERT( d->implementor->type() == type );
00123 
00124    //d->barType = type;
00125     // AbstractAxis settings - see AbstractDiagram and CartesianAxis
00126     setPercentMode( type == BarDiagram::Percent );
00127     setDataBoundariesDirty();
00128     emit layoutChanged( this );
00129     emit propertiesChanged();
00130 }

void AbstractDiagram::setUnitPrefix ( const QString &  prefix,
Qt::Orientation  orientation 
) [inherited]

Sets the unit prefix for all values.

Parameters:
prefix the prefix to be set
orientation the orientantion of the axis to set

Definition at line 864 of file KDChartAbstractDiagram.cpp.

References d.

00865 {
00866     d->unitPrefix[ orientation ] = prefix;
00867 }

void AbstractDiagram::setUnitPrefix ( const QString &  prefix,
int  column,
Qt::Orientation  orientation 
) [inherited]

Sets the unit prefix for one value.

Parameters:
prefix the prefix to be set
column the value using that prefix
orientation the orientantion of the axis to set

Definition at line 854 of file KDChartAbstractDiagram.cpp.

References d.

00855 {
00856     d->unitPrefixMap[ column ][ orientation ]= prefix;
00857 }

void AbstractDiagram::setUnitSuffix ( const QString &  suffix,
Qt::Orientation  orientation 
) [inherited]

Sets the unit suffix for all values.

Parameters:
suffix the suffix to be set
orientation the orientantion of the axis to set

Definition at line 885 of file KDChartAbstractDiagram.cpp.

References d.

00886 {
00887     d->unitSuffix[ orientation ] = suffix;
00888 }

void AbstractDiagram::setUnitSuffix ( const QString &  suffix,
int  column,
Qt::Orientation  orientation 
) [inherited]

Sets the unit suffix for one value.

Parameters:
suffix the suffix to be set
column the value using that suffix
orientation the orientantion of the axis to set

Definition at line 875 of file KDChartAbstractDiagram.cpp.

References d.

00876 {
00877     d->unitSuffixMap[ column ][ orientation ]= suffix;
00878 }

void AbstractCartesianDiagram::takeAxis ( CartesianAxis axis  )  [virtual, inherited]

Removes the axis from the diagram, without deleting it.

The diagram no longer owns the axis, so it is the caller's responsibility to delete the axis.

See also:
addAxis

Definition at line 100 of file KDChartAbstractCartesianDiagram.cpp.

References d, KDChart::AbstractAxis::deleteObserver(), KDChart::AbstractCartesianDiagram::layoutPlanes(), and KDChart::AbstractLayoutItem::setParentWidget().

Referenced by KDChart::Widget::setType(), and KDChart::CartesianAxis::~CartesianAxis().

00101 {
00102     const int idx = d->axesList.indexOf( axis );
00103     if( idx != -1 )
00104         d->axesList.takeAt( idx );
00105     axis->deleteObserver( this );
00106     axis->setParentWidget( 0 );
00107     layoutPlanes();
00108 }

ThreeDBarAttributes BarDiagram::threeDBarAttributes ( const QModelIndex &  index  )  const

Returns:
the 3D bar attributes of the model index index

Definition at line 267 of file KDChartBarDiagram.cpp.

References d, and KDChart::ThreeDBarAttributesRole.

00268 {
00269     return qVariantValue<ThreeDBarAttributes>(
00270         d->attributesModel->data(
00271             d->attributesModel->mapFromSource(index),
00272             KDChart::ThreeDBarAttributesRole ) );
00273 }

ThreeDBarAttributes BarDiagram::threeDBarAttributes ( int  column  )  const

Returns:
the 3D bar attributes of data set column

Definition at line 256 of file KDChartBarDiagram.cpp.

References KDChart::AbstractDiagram::columnToIndex(), d, and KDChart::ThreeDBarAttributesRole.

00257 {
00258     return qVariantValue<ThreeDBarAttributes>(
00259         d->attributesModel->data(
00260             d->attributesModel->mapFromSource( columnToIndex( column ) ),
00261             KDChart::ThreeDBarAttributesRole ) );
00262 }

ThreeDBarAttributes BarDiagram::threeDBarAttributes (  )  const

Returns:
the global 3D bar attributes

Definition at line 247 of file KDChartBarDiagram.cpp.

References d, and KDChart::ThreeDBarAttributesRole.

Referenced by threeDItemDepth().

00248 {
00249     return qVariantValue<ThreeDBarAttributes>(
00250         d->attributesModel->data( KDChart::ThreeDBarAttributesRole ) );
00251 }

double BarDiagram::threeDItemDepth ( int  column  )  const [protected, virtual]

Returns:
the 3D item depth of the data set column

Implements KDChart::AbstractCartesianDiagram.

Definition at line 280 of file KDChartBarDiagram.cpp.

References d, and KDChart::ThreeDBarAttributesRole.

00281 {
00282     return qVariantValue<ThreeDBarAttributes>(
00283         d->attributesModel->headerData (
00284             column,
00285             Qt::Vertical,
00286             KDChart::ThreeDBarAttributesRole ) ).validDepth();
00287 }

double BarDiagram::threeDItemDepth ( const QModelIndex &  index  )  const [protected, virtual]

Returns:
the 3D item depth of the model index index

Implements KDChart::AbstractCartesianDiagram.

Definition at line 275 of file KDChartBarDiagram.cpp.

References threeDBarAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().

00276 {
00277     return threeDBarAttributes( index ).validDepth();
00278 }

BarDiagram::BarType BarDiagram::type (  )  const

Returns:
the type of the line diagram

Definition at line 135 of file KDChartBarDiagram.cpp.

References d.

Referenced by clone(), and compare().

00136 {
00137     return d->implementor->type();
00138 }

QString AbstractDiagram::unitPrefix ( Qt::Orientation  orientation  )  const [inherited]

Returns the global unit prefix.

Parameters:
orientation the orientation of the axis
Returns:
the unit prefix

Definition at line 908 of file KDChartAbstractDiagram.cpp.

References d.

00909 {
00910     return d->unitPrefix[ orientation ];
00911 }

QString AbstractDiagram::unitPrefix ( int  column,
Qt::Orientation  orientation,
bool  fallback = false 
) const [inherited]

Returns the unit prefix for a special value.

Parameters:
column the value which's prefix is requested
orientation the orientation of the axis
fallback if true, the global prefix is return when no specific one is set for that value
Returns:
the unit prefix

Definition at line 897 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().

00898 {
00899     if( !fallback || d->unitPrefixMap[ column ].contains( orientation ) )
00900         return d->unitPrefixMap[ column ][ orientation ];
00901     return d->unitPrefix[ orientation ];
00902 }

QString AbstractDiagram::unitSuffix ( Qt::Orientation  orientation  )  const [inherited]

Returns the global unit suffix.

Parameters:
orientation the orientation of the axis
Returns:
the unit siffix

Definition at line 931 of file KDChartAbstractDiagram.cpp.

References d.

00932 {
00933     return d->unitSuffix[ orientation ];
00934 }

QString AbstractDiagram::unitSuffix ( int  column,
Qt::Orientation  orientation,
bool  fallback = false 
) const [inherited]

Returns the unit suffix for a special value.

Parameters:
column the value which's suffix is requested
orientation the orientation of the axis
fallback if true, the global suffix is return when no specific one is set for that value
Returns:
the unit suffix

Definition at line 920 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::itemRowLabels(), and KDChart::CartesianAxis::paintCtx().

00921 {
00922     if( !fallback || d->unitSuffixMap[ column ].contains( orientation ) )
00923         return d->unitSuffixMap[ column ][ orientation ];
00924     return d->unitSuffix[ orientation ];
00925 }

void AbstractDiagram::update (  )  const [inherited]

Definition at line 1091 of file KDChartAbstractDiagram.cpp.

References d.

Referenced by KDChart::AbstractDiagram::doItemsLayout().

01092 {
01093     //qDebug("KDChart::AbstractDiagram::update() called");
01094     if( d->plane )
01095         d->plane->update();
01096 }

void KDChart::AbstractDiagram::useDefaultColors (  )  [inherited]

Set the palette to be used, for painting datasets to the default palette.

See also:
KDChart::Palette. FIXME: fold into one usePalette (KDChart::Palette&) method

Definition at line 974 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AttributesModel::PaletteTypeDefault.

00975 {
00976     d->attributesModel->setPaletteType( AttributesModel::PaletteTypeDefault );
00977 }

void KDChart::AbstractDiagram::useRainbowColors (  )  [inherited]

Set the palette to be used, for painting datasets to the rainbow palette.

See also:
KDChart::Palette.

Definition at line 984 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AttributesModel::PaletteTypeRainbow.

00985 {
00986     d->attributesModel->setPaletteType( AttributesModel::PaletteTypeRainbow );
00987 }

bool AbstractDiagram::usesExternalAttributesModel (  )  const [virtual, inherited]

Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.

See also:
setAttributesModel

Definition at line 274 of file KDChartAbstractDiagram.cpp.

References d.

00275 {
00276     return d->usesExternalAttributesModel();
00277 }

void KDChart::AbstractDiagram::useSubduedColors (  )  [inherited]

Set the palette to be used, for painting datasets to the subdued palette.

See also:
KDChart::Palette.

Definition at line 979 of file KDChartAbstractDiagram.cpp.

References d, and KDChart::AttributesModel::PaletteTypeSubdued.

00980 {
00981     d->attributesModel->setPaletteType( AttributesModel::PaletteTypeSubdued );
00982 }

double AbstractDiagram::valueForCell ( int  row,
int  column 
) const [protected, inherited]

Helper method, retrieving the data value (DisplayRole) for a given row and column.

Parameters:
row The row to query.
column The column to query.
Returns:
The value of the display role at the given row and column as a double.
Deprecated:

Definition at line 1085 of file KDChartAbstractDiagram.cpp.

References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.

01086 {
01087     return d->attributesModel->data(
01088             d->attributesModel->index( row, column, attributesModelRootIndex() ) ).toDouble();
01089 }

int AbstractDiagram::verticalOffset (  )  const [virtual, inherited]

[reimplemented]

Definition at line 953 of file KDChartAbstractDiagram.cpp.

00954 { return 0; }

QRect AbstractDiagram::visualRect ( const QModelIndex &  index  )  const [virtual, inherited]

[reimplemented]

Definition at line 937 of file KDChartAbstractDiagram.cpp.

00938 {
00939     return QRect();
00940 }

QRegion AbstractDiagram::visualRegionForSelection ( const QItemSelection &  selection  )  const [virtual, inherited]

[reimplemented]

Definition at line 970 of file KDChartAbstractDiagram.cpp.

00971 { return QRegion(); }


The documentation for this class was generated from the following files:
Generated on Mon Sep 17 16:18:11 2007 for KD Chart 2 by  doxygen 1.5.1