![]() |
KD Chart API Documentation
3.1
|
Plotter defines a diagram type plotting two-dimensional data. More...
#include <KDChartPlotter.h>
Public Types | |
| enum | CompressionMode { SLOPE , DISTANCE , BOTH , NONE } |
| enum | PlotType { Normal = 0 , Percent } |
Public Member Functions | |
| Plotter (QWidget *parent=nullptr, CartesianCoordinatePlane *plane=nullptr) | |
| ~Plotter () override | |
| virtual Plotter * | clone () const |
| bool | compare (const Plotter *other) const |
| LineAttributes | lineAttributes () const |
| LineAttributes | lineAttributes (const QModelIndex &index) const |
| LineAttributes | lineAttributes (int column) const |
| qreal | maxSlopeChange () const |
| qreal | mergeRadiusPercentage () const |
| int | numberOfAbscissaSegments () const override |
| int | numberOfOrdinateSegments () const override |
| void | resetLineAttributes (const QModelIndex &index) |
| void | resetLineAttributes (int column) |
| void | resize (const QSizeF &area) override |
| void | setLineAttributes (const LineAttributes &a) |
| void | setLineAttributes (const QModelIndex &index, const LineAttributes &a) |
| void | setLineAttributes (int column, const LineAttributes &a) |
| void | setMaxSlopeChange (qreal value) |
| void | setMergeRadiusPercentage (qreal value) |
| void | setThreeDLineAttributes (const QModelIndex &index, const ThreeDLineAttributes &a) |
| void | setThreeDLineAttributes (const ThreeDLineAttributes &a) |
| void | setThreeDLineAttributes (int column, const ThreeDLineAttributes &a) |
| void | setType (const PlotType type) |
| void | setUseDataCompression (CompressionMode value) |
| void | setValueTrackerAttributes (const QModelIndex &index, const ValueTrackerAttributes &a) |
| ThreeDLineAttributes | threeDLineAttributes () const |
| ThreeDLineAttributes | threeDLineAttributes (const QModelIndex &index) const |
| ThreeDLineAttributes | threeDLineAttributes (int column) const |
| PlotType | type () const |
| CompressionMode | useDataCompression () const |
| ValueTrackerAttributes | valueTrackerAttributes (const QModelIndex &index) const |
Public Member Functions inherited from KDChart::AbstractCartesianDiagram | |
| 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) |
Public Member Functions inherited from KDChart::AbstractDiagram | |
| ~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 Slots | |
| void | calcMergeRadius () |
| void | connectAttributesModel (AttributesModel *) |
| void | setDataBoundariesDirty () |
Protected Slots inherited from KDChart::AbstractCartesianDiagram | |
| void | connectAttributesModel (AttributesModel *) |
Protected Slots inherited from KDChart::AbstractDiagram | |
| void | setDataBoundariesDirty () const |
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 |
Protected Member Functions inherited from KDChart::AbstractDiagram | |
| 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 |
Properties | |
| qreal | mergeRadiusPercentage |
| CompressionMode | useDataCompression |
Additional Inherited Members | |
Signals inherited from KDChart::AbstractDiagram | |
| void | aboutToBeDestroyed () |
| void | attributesModelAboutToChange (AttributesModel *newModel, AttributesModel *oldModel) |
| void | boundariesChanged () |
| void | dataHidden () |
| void | layoutChanged (AbstractDiagram *) |
| void | modelDataChanged () |
| void | modelsChanged () |
| void | propertiesChanged () |
| void | viewportCoordinateSystemChanged () |
Plotter defines a diagram type plotting two-dimensional data.
Definition at line 26 of file KDChartPlotter.h.
| Enumerator | |
|---|---|
| SLOPE | |
| DISTANCE | |
| BOTH | |
| NONE | |
Definition at line 40 of file KDChartPlotter.h.
| Enumerator | |
|---|---|
| Normal | |
| Percent | |
Definition at line 60 of file KDChartPlotter.h.
|
explicit |
Definition at line 36 of file KDChartPlotter.cpp.
Referenced by clone().
|
override |
Definition at line 59 of file KDChartPlotter.cpp.
|
protectedslot |
Definition at line 435 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::coordinatePlane(), and d.
Referenced by connectAttributesModel(), resize(), and setDataBoundariesDirty().
|
overrideprotectedvirtual |
Reimplemented for internal purposes.
Implements KDChart::AbstractDiagram.
Definition at line 366 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::checkInvariants(), and d.
|
virtual |
Creates an exact copy of this diagram.
Definition at line 66 of file KDChartPlotter.cpp.
| bool Plotter::compare | ( | const Plotter * | other | ) | const |
Returns true if both diagrams have the same settings.
Definition at line 73 of file KDChartPlotter.cpp.
References type().
|
protectedslot |
Definition at line 85 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::attributesModel(), KDChart::PlotterDiagramCompressor::boundariesChanged(), calcMergeRadius(), KDChart::AbstractCartesianDiagram::connectAttributesModel(), KDChart::AbstractDiagram::coordinatePlane(), d, KDChart::AbstractCoordinatePlane::geometryChanged(), KDChart::AbstractCoordinatePlane::internal_geometryChanged(), NONE, setDataBoundariesDirty(), SLOPE, and useDataCompression.
| LineAttributes Plotter::lineAttributes | ( | ) | const |
Definition at line 245 of file KDChartPlotter.cpp.
References d, and KDChart::LineAttributesRole.
Referenced by lineAttributes().
| LineAttributes Plotter::lineAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 264 of file KDChartPlotter.cpp.
References d, and KDChart::LineAttributesRole.
| LineAttributes Plotter::lineAttributes | ( | int | column | ) | const |
Definition at line 253 of file KDChartPlotter.cpp.
References d, lineAttributes(), and KDChart::LineAttributesRole.
| qreal Plotter::maxSlopeChange | ( | ) | const |
Definition at line 127 of file KDChartPlotter.cpp.
References d.
| qreal Plotter::mergeRadiusPercentage | ( | ) | const |
Definition at line 137 of file KDChartPlotter.cpp.
References d.
|
overridevirtual |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 453 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
|
overridevirtual |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 462 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::attributesModelRootIndex(), and d.
|
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 388 of file KDChartPlotter.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 379 of file KDChartPlotter.cpp.
References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().
| void Plotter::resetLineAttributes | ( | const QModelIndex & | index | ) |
Remove any explicit line attributes settings that might have been specified before.
Definition at line 235 of file KDChartPlotter.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
| void Plotter::resetLineAttributes | ( | int | column | ) |
Resets the line attributes of data set column
Definition at line 216 of file KDChartPlotter.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
|
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 415 of file KDChartPlotter.cpp.
References BOTH, calcMergeRadius(), KDChart::AbstractDiagram::coordinatePlane(), d, DISTANCE, setDataBoundariesDirty(), and useDataCompression.
|
overrideprotected |
Definition at line 362 of file KDChartPlotter.cpp.
|
protectedslot |
Definition at line 426 of file KDChartPlotter.cpp.
References BOTH, calcMergeRadius(), DISTANCE, KDChart::AbstractDiagram::setDataBoundariesDirty(), and useDataCompression.
Referenced by connectAttributesModel(), resize(), setThreeDLineAttributes(), and setType().
| void Plotter::setLineAttributes | ( | const LineAttributes & | la | ) |
Sets the global line attributes to la
Definition at line 198 of file KDChartPlotter.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
| void Plotter::setLineAttributes | ( | const QModelIndex & | index, |
| const LineAttributes & | la | ||
| ) |
Sets the line attributes for the model index index to la
Definition at line 225 of file KDChartPlotter.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
| void Plotter::setLineAttributes | ( | int | column, |
| const LineAttributes & | la | ||
| ) |
Sets the line attributes of data set column to la
Definition at line 207 of file KDChartPlotter.cpp.
References d, KDChart::LineAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
| void Plotter::setMaxSlopeChange | ( | qreal | value | ) |
Definition at line 132 of file KDChartPlotter.cpp.
References d.
| void Plotter::setMergeRadiusPercentage | ( | qreal | value | ) |
Definition at line 142 of file KDChartPlotter.cpp.
References d.
| void Plotter::setThreeDLineAttributes | ( | const QModelIndex & | index, |
| const ThreeDLineAttributes & | la | ||
| ) |
Sets the 3D line attributes of model index index to la
Definition at line 294 of file KDChartPlotter.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.
| void Plotter::setThreeDLineAttributes | ( | const ThreeDLineAttributes & | la | ) |
Sets the global 3D line attributes to la
Definition at line 274 of file KDChartPlotter.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.
| void Plotter::setThreeDLineAttributes | ( | int | column, |
| const ThreeDLineAttributes & | la | ||
| ) |
Sets the 3D line attributes of data set column to la
Definition at line 284 of file KDChartPlotter.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), setDataBoundariesDirty(), and KDChart::ThreeDLineAttributesRole.
| void Plotter::setType | ( | const PlotType | type | ) |
Sets the plotter's type to type
Definition at line 154 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::boundariesChanged(), d, KDChart::AbstractDiagram::datasetDimension(), KDChart::AbstractDiagram::layoutChanged(), Normal, Percent, KDChart::AbstractDiagram::propertiesChanged(), setDataBoundariesDirty(), and type().
| void Plotter::setUseDataCompression | ( | Plotter::CompressionMode | value | ) |
Definition at line 115 of file KDChartPlotter.cpp.
References KDChart::AbstractDiagram::attributesModel(), d, NONE, and useDataCompression.
| void Plotter::setValueTrackerAttributes | ( | const QModelIndex & | index, |
| const ValueTrackerAttributes & | va | ||
| ) |
Sets the value tracker attributes of the model index index to va
Definition at line 345 of file KDChartPlotter.cpp.
References d, KDChart::AbstractDiagram::propertiesChanged(), and KDChart::ValueTrackerAttributesRole.
|
overrideprotectedvirtual |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 332 of file KDChartPlotter.cpp.
References threeDLineAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
|
overrideprotectedvirtual |
Implements KDChart::AbstractCartesianDiagram.
Definition at line 337 of file KDChartPlotter.cpp.
References threeDLineAttributes(), and KDChart::AbstractThreeDAttributes::validDepth().
| ThreeDLineAttributes Plotter::threeDLineAttributes | ( | ) | const |
Definition at line 305 of file KDChartPlotter.cpp.
References d, and KDChart::ThreeDLineAttributesRole.
Referenced by threeDItemDepth(), and threeDLineAttributes().
| ThreeDLineAttributes Plotter::threeDLineAttributes | ( | const QModelIndex & | index | ) | const |
Definition at line 325 of file KDChartPlotter.cpp.
References d, and KDChart::ThreeDLineAttributesRole.
| ThreeDLineAttributes Plotter::threeDLineAttributes | ( | int | column | ) | const |
Definition at line 313 of file KDChartPlotter.cpp.
References d, threeDLineAttributes(), and KDChart::ThreeDLineAttributesRole.
| Plotter::PlotType Plotter::type | ( | ) | const |
| Plotter::CompressionMode Plotter::useDataCompression | ( | ) | const |
Definition at line 110 of file KDChartPlotter.cpp.
References d.
| ValueTrackerAttributes Plotter::valueTrackerAttributes | ( | const QModelIndex & | index | ) | const |
Returns the value tracker attributes of the model index index
Definition at line 355 of file KDChartPlotter.cpp.
References d, and KDChart::ValueTrackerAttributesRole.
|
readwrite |
Definition at line 1 of file KDChartPlotter.h.
|
readwrite |
Definition at line 1 of file KDChartPlotter.h.
Referenced by connectAttributesModel(), resize(), setDataBoundariesDirty(), and setUseDataCompression().