![]() |
KD Chart API Documentation
3.1
|
BarDiagram defines a common bar diagram. More...
#include <KDChartBarDiagram.h>
Public Types | |
enum | BarType { Normal , Stacked , Percent , Q_DECL_ENUMERATOR_DEPRECATED } |
Public Member Functions | |
BarDiagram (QWidget *parent=nullptr, CartesianCoordinatePlane *plane=nullptr) | |
~BarDiagram () override | |
BarAttributes | barAttributes () const |
BarAttributes | barAttributes (const QModelIndex &index) const |
BarAttributes | barAttributes (int column) const |
virtual BarDiagram * | clone () const |
bool | compare (const BarDiagram *other) const |
int | numberOfAbscissaSegments () const override |
int | numberOfOrdinateSegments () const override |
Qt::Orientation | orientation () const |
void | resize (const QSizeF &area) override |
void | setBarAttributes (const BarAttributes &a) |
void | setBarAttributes (const QModelIndex &index, const BarAttributes &a) |
void | setBarAttributes (int column, const BarAttributes &a) |
void | setOrientation (Qt::Orientation orientation) |
void | setThreeDBarAttributes (const QModelIndex &index, const ThreeDBarAttributes &a) |
void | setThreeDBarAttributes (const ThreeDBarAttributes &a) |
void | setThreeDBarAttributes (int column, const ThreeDBarAttributes &a) |
void | setType (const BarType type) |
ThreeDBarAttributes | threeDBarAttributes () const |
ThreeDBarAttributes | threeDBarAttributes (const QModelIndex &index) const |
ThreeDBarAttributes | threeDBarAttributes (int column) const |
BarType | type () const |
![]() | |
AbstractCartesianDiagram (QWidget *parent=nullptr, CartesianCoordinatePlane *plane=nullptr) | |
~AbstractCartesianDiagram () override | |
virtual void | addAxis (CartesianAxis *axis) |
virtual KDChart::CartesianAxisList | axes () const |
bool | compare (const AbstractCartesianDiagram *other) const |
virtual void | layoutPlanes () |
virtual AbstractCartesianDiagram * | referenceDiagram () const |
virtual QPointF | referenceDiagramOffset () const |
void | setAttributesModel (AttributesModel *amodel) override |
Sets an external AttributesModel on this diagram. More... | |
void | setCoordinatePlane (AbstractCoordinatePlane *plane) override |
void | setModel (QAbstractItemModel *model) override |
virtual void | setReferenceDiagram (AbstractCartesianDiagram *diagram, const QPointF &offset=QPointF()) |
void | setRootIndex (const QModelIndex &index) override |
virtual void | takeAxis (CartesianAxis *axis) |
![]() | |
~AbstractDiagram () override | |
bool | allowOverlappingDataValueTexts () const |
bool | antiAliasing () const |
virtual AttributesModel * | attributesModel () const |
QBrush | brush () const |
QBrush | brush (const QModelIndex &index) const |
QBrush | brush (int dataset) const |
bool | compare (const AbstractDiagram *other) const |
AbstractCoordinatePlane * | coordinatePlane () const |
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). More... | |
void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >()) override |
QList< QBrush > | datasetBrushes () const |
int | datasetDimension () const |
QStringList | datasetLabels () const |
QList< MarkerAttributes > | datasetMarkers () const |
QList< QPen > | datasetPens () const |
DataValueAttributes | dataValueAttributes () const |
DataValueAttributes | dataValueAttributes (const QModelIndex &index) const |
DataValueAttributes | dataValueAttributes (int dataset) const |
void | doItemsLayout () override |
int | horizontalOffset () const override |
QModelIndex | indexAt (const QPoint &point) const override |
QModelIndexList | indexesAt (const QPoint &point) const |
QModelIndexList | indexesIn (const QRect &rect) const |
bool | isHidden () const |
bool | isHidden (const QModelIndex &index) const |
bool | isHidden (int dataset) const |
bool | isIndexHidden (const QModelIndex &index) const override |
QStringList | itemRowLabels () const |
QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override |
void | paintDataValueText (QPainter *painter, const QModelIndex &index, const QPointF &pos, qreal value) |
void | paintMarker (QPainter *painter, const DataValueAttributes &a, 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) |
void | paintMarker (QPainter *painter, const QModelIndex &index, const QPointF &pos) |
QPen | pen () const |
QPen | pen (const QModelIndex &index) const |
QPen | pen (int dataset) const |
bool | percentMode () const |
Returns whether this diagram is drawn in percent mode. More... | |
void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) override |
void | setAllowOverlappingDataValueTexts (bool allow) |
void | setAntiAliasing (bool enabled) |
void | setBrush (const QBrush &brush) |
void | setBrush (const QModelIndex &index, const QBrush &brush) |
void | setBrush (int dataset, const QBrush &brush) |
Q_DECL_DEPRECATED void | setDatasetDimension (int dimension) |
void | setDataValueAttributes (const DataValueAttributes &a) |
void | setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a) |
void | setDataValueAttributes (int dataset, const DataValueAttributes &a) |
void | setHidden (bool hidden) |
void | setHidden (const QModelIndex &index, bool hidden) |
void | setHidden (int dataset, bool hidden) |
void | setModel (QAbstractItemModel *model) override |
void | setPen (const QModelIndex &index, const QPen &pen) |
void | setPen (const QPen &pen) |
void | setPen (int dataset, const QPen &pen) |
Q_DECL_DEPRECATED void | setPercentMode (bool percent) |
Deprecated method that turns the percent mode of this diagram on or off. More... | |
void | setRootIndex (const QModelIndex &idx) override |
Reimplemented for internal purposes. More... | |
void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command) override |
void | setSelectionModel (QItemSelectionModel *selectionModel) override |
void | setUnitPrefix (const QString &prefix, int column, Qt::Orientation orientation) |
void | setUnitPrefix (const QString &prefix, Qt::Orientation orientation) |
void | setUnitSuffix (const QString &suffix, int column, Qt::Orientation orientation) |
void | setUnitSuffix (const QString &suffix, Qt::Orientation orientation) |
QString | unitPrefix (int column, Qt::Orientation orientation, bool fallback=false) const |
QString | unitPrefix (Qt::Orientation orientation) const |
QString | unitSuffix (int column, Qt::Orientation orientation, bool fallback=false) const |
QString | unitSuffix (Qt::Orientation orientation) const |
void | update () const |
void | useDefaultColors () |
void | useRainbowColors () |
virtual bool | usesExternalAttributesModel () const |
void | useSubduedColors () |
int | verticalOffset () const override |
QRect | visualRect (const QModelIndex &index) const override |
virtual QRegion | visualRegion (const QModelIndex &index) const |
QRegion | visualRegionForSelection (const QItemSelection &selection) const override |
Protected Member Functions | |
const QPair< QPointF, QPointF > | calculateDataBoundaries () const override |
void | paint (PaintContext *paintContext) override |
void | paintEvent (QPaintEvent *) override |
void | resizeEvent (QResizeEvent *) override |
qreal | threeDItemDepth (const QModelIndex &index) const override |
qreal | threeDItemDepth (int column) const override |
![]() | |
AbstractDiagram (Private *p, QWidget *parent, AbstractCoordinatePlane *plane) | |
AbstractDiagram (QWidget *parent=nullptr, AbstractCoordinatePlane *plane=nullptr) | |
QModelIndex | attributesModelRootIndex () const |
returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram. More... | |
virtual bool | checkInvariants (bool justReturnTheStatus=false) const |
virtual Q_DECL_DEPRECATED void | paintDataValueTexts (QPainter *painter) |
virtual Q_DECL_DEPRECATED void | paintMarkers (QPainter *painter) |
void | setAttributesModelRootIndex (const QModelIndex &) |
void | setDatasetDimensionInternal (int dimension) |
Q_DECL_DEPRECATED qreal | valueForCell (int row, int column) const |
Additional Inherited Members | |
![]() | |
void | aboutToBeDestroyed () |
void | attributesModelAboutToChange (AttributesModel *newModel, AttributesModel *oldModel) |
void | boundariesChanged () |
void | dataHidden () |
void | layoutChanged (AbstractDiagram *) |
void | modelDataChanged () |
void | modelsChanged () |
void | propertiesChanged () |
void | viewportCoordinateSystemChanged () |
![]() | |
void | connectAttributesModel (AttributesModel *) |
![]() | |
void | setDataBoundariesDirty () const |
BarDiagram defines a common bar diagram.
It provides different subtypes which are set using setType.
Definition at line 30 of file KDChartBarDiagram.h.
Enumerator | |
---|---|
Normal | |
Stacked | |
Percent | |
Q_DECL_ENUMERATOR_DEPRECATED |
|
Definition at line 52 of file KDChartBarDiagram.h.
|
explicit |
Definition at line 98 of file KDChartBarDiagram.cpp.
Referenced by clone().
|
override |
Definition at line 116 of file KDChartBarDiagram.cpp.
BarAttributes BarDiagram::barAttributes | ( | ) | const |
Definition at line 210 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, and d.
Referenced by barAttributes().
BarAttributes BarDiagram::barAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 229 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, and d.
BarAttributes BarDiagram::barAttributes | ( | int | column | ) | const |
Definition at line 218 of file KDChartBarDiagram.cpp.
References barAttributes(), KDChart::BarAttributesRole, and d.
|
overrideprotectedvirtual |
Reimplemented for internal purposes.
Implements KDChart::AbstractDiagram.
Definition at line 317 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractDiagram::coordinatePlane(), and d.
|
virtual |
Creates an exact copy of this diagram.
Definition at line 123 of file KDChartBarDiagram.cpp.
References BarDiagram(), d, and type().
bool BarDiagram::compare | ( | const BarDiagram * | other | ) | const |
Returns true if both diagrams have the same settings.
Definition at line 130 of file KDChartBarDiagram.cpp.
References type().
|
overridevirtual |
Reimplemented for internal purposes.
Implements KDChart::AbstractCartesianDiagram.
Definition at line 384 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
|
overridevirtual |
Reimplemented for internal purposes.
Implements KDChart::AbstractCartesianDiagram.
Definition at line 393 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
Qt::Orientation BarDiagram::orientation | ( | ) | const |
Definition at line 172 of file KDChartBarDiagram.cpp.
References d.
Referenced by setOrientation().
|
overrideprotectedvirtual |
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.
paintContext | All information needed for painting. |
Implements KDChart::AbstractDiagram.
Definition at line 342 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::checkInvariants(), KDChart::PaintContext::coordinatePlane(), d, KDChart::AbstractDiagram::dataBoundaries(), KDChart::AbstractGrid::isBoundariesValid(), KDChart::PaintContext::painter(), KDChart::PaintContext::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::sharedAxisMasterPlane().
Referenced by paintEvent().
|
overrideprotected |
Definition at line 333 of file KDChartBarDiagram.cpp.
References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().
|
overridevirtual |
Called by the widget's sizeEvent. Adjust all internal structures, that are calculated, depending on the size of the widget.
area | Size of the widget |
Implements KDChart::AbstractDiagram.
Definition at line 372 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), d, and KDChart::AbstractDiagram::setDataBoundariesDirty().
|
overrideprotected |
Definition at line 313 of file KDChartBarDiagram.cpp.
void BarDiagram::setBarAttributes | ( | const BarAttributes & | ba | ) |
Sets the global bar attributes to ba
Definition at line 180 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, d, and KDChart::AbstractDiagram::propertiesChanged().
void BarDiagram::setBarAttributes | ( | const QModelIndex & | index, |
const BarAttributes & | ba | ||
) |
Sets the line attributes for the model index index to ba
Definition at line 198 of file KDChartBarDiagram.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::BarAttributesRole, d, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::AttributesModel::setData().
void BarDiagram::setBarAttributes | ( | int | column, |
const BarAttributes & | ba | ||
) |
Sets the bar attributes of data set column to ba
Definition at line 189 of file KDChartBarDiagram.cpp.
References KDChart::BarAttributesRole, d, and KDChart::AbstractDiagram::propertiesChanged().
void BarDiagram::setOrientation | ( | Qt::Orientation | orientation | ) |
Sets the orientation of the bar diagram
Definition at line 164 of file KDChartBarDiagram.cpp.
References d, and orientation().
void BarDiagram::setThreeDBarAttributes | ( | const QModelIndex & | index, |
const ThreeDBarAttributes & | threeDAttrs | ||
) |
Sets the 3D line attributes of model index index to threeDAttrs
Definition at line 262 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.
void BarDiagram::setThreeDBarAttributes | ( | const ThreeDBarAttributes & | threeDAttrs | ) |
Sets the global 3D bar attributes to threeDAttrs
Definition at line 240 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::layoutChanged(), KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.
void BarDiagram::setThreeDBarAttributes | ( | int | column, |
const ThreeDBarAttributes & | threeDAttrs | ||
) |
Sets the 3D bar attributes of dataset column to threeDAttrs
Definition at line 251 of file KDChartBarDiagram.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), KDChart::AbstractDiagram::setDataBoundariesDirty(), and KDChart::ThreeDBarAttributesRole.
void BarDiagram::setType | ( | const BarType | type | ) |
Sets the bar diagram's type to type
Definition at line 148 of file KDChartBarDiagram.cpp.
ThreeDBarAttributes BarDiagram::threeDBarAttributes | ( | ) | const |
Definition at line 276 of file KDChartBarDiagram.cpp.
References d, and KDChart::ThreeDBarAttributesRole.
Referenced by threeDBarAttributes(), and threeDItemDepth().
ThreeDBarAttributes BarDiagram::threeDBarAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 295 of file KDChartBarDiagram.cpp.
References d, and KDChart::ThreeDBarAttributesRole.
ThreeDBarAttributes BarDiagram::threeDBarAttributes | ( | int | column | ) | const |
Definition at line 284 of file KDChartBarDiagram.cpp.
References d, threeDBarAttributes(), and KDChart::ThreeDBarAttributesRole.
|
overrideprotectedvirtual |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 303 of file KDChartBarDiagram.cpp.
References threeDBarAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
|
overrideprotectedvirtual |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 308 of file KDChartBarDiagram.cpp.
References threeDBarAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
BarDiagram::BarType BarDiagram::type | ( | ) | const |