![]() |
KD Chart API Documentation
3.1
|
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane. More...
#include <KDChartAbstractCoordinatePlane.h>
Public Types | |
enum | AxesCalcMode { Linear , Logarithmic } |
Public Slots | |
void | layoutPlanes () |
void | relayout () |
void | setGridNeedsRecalculate () |
void | update () |
Signals | |
void | boundariesChanged () |
void | destroyedCoordinatePlane (AbstractCoordinatePlane *) |
void | geometryChanged (QRect, QRect) |
void | internal_geometryChanged (QRect, QRect) |
void | needLayoutPlanes () |
void | needRelayout () |
void | needUpdate () |
void | propertiesChanged () |
void | viewportCoordinateSystemChanged () |
![]() | |
void | positionChanged (AbstractArea *) |
Public Member Functions | |
~AbstractCoordinatePlane () override | |
virtual void | addDiagram (AbstractDiagram *diagram) |
AbstractDiagram * | diagram () |
AbstractDiagramList | diagrams () |
ConstAbstractDiagramList | diagrams () const |
Qt::Orientations | expandingDirections () const override |
QRect | geometry () const override |
GridAttributes | globalGridAttributes () const |
DataDimensionsList | gridDimensionsList () |
bool | isCornerSpacersEnabled () const |
bool | isEmpty () const override |
bool | isRubberBandZoomingEnabled () const |
bool | isVisiblePoint (const QPointF &point) const |
virtual void | layoutDiagrams ()=0 |
QSize | maximumSize () const override |
QSize | minimumSize () const override |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
Chart * | parent () |
const Chart * | parent () const |
AbstractCoordinatePlane * | referenceCoordinatePlane () const |
virtual void | replaceDiagram (AbstractDiagram *diagram, AbstractDiagram *oldDiagram=nullptr) |
void | setCornerSpacersEnabled (bool enable) |
void | setGeometry (const QRect &r) override |
void | setGlobalGridAttributes (const GridAttributes &) |
void | setParent (Chart *parent) |
void | setReferenceCoordinatePlane (AbstractCoordinatePlane *plane) |
void | setRubberBandZoomingEnabled (bool enable) |
virtual void | setZoomCenter (const QPointF ¢er) |
virtual void | setZoomFactors (qreal factorX, qreal factorY) |
virtual void | setZoomFactorX (qreal factor) |
virtual void | setZoomFactorY (qreal factor) |
virtual AbstractCoordinatePlane * | sharedAxisMasterPlane (QPainter *p=nullptr) |
QSize | sizeHint () const override |
virtual void | takeDiagram (AbstractDiagram *diagram) |
virtual const QPointF | translate (const QPointF &diagramPoint) const =0 |
virtual QPointF | zoomCenter () const |
virtual qreal | zoomFactorX () const |
virtual qreal | zoomFactorY () const |
![]() | |
~AbstractArea () override | |
virtual int | bottomOverlap (bool doNotRecalculate=false) const |
virtual int | leftOverlap (bool doNotRecalculate=false) const |
void | paintAll (QPainter &painter) override |
virtual void | paintIntoRect (QPainter &painter, const QRect &rect) |
Draws the background and frame, then calls paint(). More... | |
virtual int | rightOverlap (bool doNotRecalculate=false) const |
virtual int | topOverlap (bool doNotRecalculate=false) const |
![]() | |
void | alignToReferencePoint (const RelativePosition &position) |
BackgroundAttributes | backgroundAttributes () const |
bool | compare (const AbstractAreaBase *other) const |
FrameAttributes | frameAttributes () const |
void | getFrameLeadings (int &left, int &top, int &right, int &bottom) const |
virtual void | paintBackground (QPainter &painter, const QRect &rectangle) |
virtual void | paintFrame (QPainter &painter, const QRect &rectangle) |
void | setBackgroundAttributes (const BackgroundAttributes &a) |
void | setFrameAttributes (const FrameAttributes &a) |
![]() | |
AbstractLayoutItem (Qt::Alignment itemAlignment={}) | |
virtual void | paint (QPainter *)=0 |
virtual void | paintCtx (PaintContext *context) |
QLayout * | parentLayout () |
void | removeFromParentLayout () |
void | setParentLayout (QLayout *lay) |
virtual void | setParentWidget (QWidget *widget) |
virtual void | sizeHintChanged () const |
Protected Member Functions | |
AbstractCoordinatePlane (Chart *parent=nullptr) | |
virtual DataDimensionsList | getDataDimensionsList () const =0 |
![]() | |
AbstractArea () | |
QRect | areaGeometry () const override |
void | positionHasChanged () override |
![]() | |
AbstractAreaBase () | |
virtual | ~AbstractAreaBase () |
QRect | innerRect () const |
Additional Inherited Members | |
![]() | |
static void | paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes) |
static void | paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes) |
![]() | |
QWidget * | mParent = nullptr |
QLayout * | mParentLayout = nullptr |
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
Definition at line 32 of file KDChartAbstractCoordinatePlane.h.
Enumerator | |
---|---|
Linear | |
Logarithmic |
Definition at line 41 of file KDChartAbstractCoordinatePlane.h.
|
explicitprotected |
Definition at line 34 of file KDChartAbstractCoordinatePlane.cpp.
|
override |
Definition at line 41 of file KDChartAbstractCoordinatePlane.cpp.
References destroyedCoordinatePlane().
|
virtual |
Adds a diagram to this coordinate plane.
diagram | The diagram to add. |
Reimplemented in KDChart::TernaryCoordinatePlane, KDChart::PolarCoordinatePlane, KDChart::LeveyJenningsCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 54 of file KDChartAbstractCoordinatePlane.cpp.
References boundariesChanged(), KDChart::AbstractDiagram::boundariesChanged(), d, diagram(), layoutDiagrams(), layoutPlanes(), KDChart::AbstractDiagram::modelDataChanged(), KDChart::AbstractDiagram::modelsChanged(), relayout(), KDChart::AbstractDiagram::setCoordinatePlane(), and update().
Referenced by KDChart::CartesianCoordinatePlane::addDiagram(), KDChart::PolarCoordinatePlane::addDiagram(), KDChart::TernaryCoordinatePlane::addDiagram(), and replaceDiagram().
|
signal |
|
signal |
Emitted when this coordinate plane is destroyed.
Referenced by ~AbstractCoordinatePlane(), and KDChart::Chart::insertCoordinatePlane().
AbstractDiagram * AbstractCoordinatePlane::diagram | ( | ) |
Definition at line 110 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by addDiagram(), KDChart::CartesianCoordinatePlane::addDiagram(), KDChart::LeveyJenningsCoordinatePlane::addDiagram(), KDChart::PolarCoordinatePlane::addDiagram(), KDChart::TernaryCoordinatePlane::addDiagram(), KDChart::Widget::diagram(), findSharingAxisDiagrams(), KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::TernaryCoordinatePlane::layoutDiagrams(), replaceDiagram(), KDChart::CartesianCoordinatePlane::setGeometry(), KDChart::PolarCoordinatePlane::setStartPosition(), KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane(), and takeDiagram().
AbstractDiagramList AbstractCoordinatePlane::diagrams | ( | ) |
Definition at line 119 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by allAxisAnnotations(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::TernaryCoordinatePlane::layoutDiagrams(), KDChart::CartesianCoordinatePlane::paint(), KDChart::PolarCoordinatePlane::paint(), KDChart::TernaryCoordinatePlane::paint(), KDChart::CartesianCoordinatePlane::setAxesCalcModes(), and KDChart::CartesianCoordinatePlane::setGeometry().
ConstAbstractDiagramList AbstractCoordinatePlane::diagrams | ( | ) | const |
Definition at line 124 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
override |
pure virtual in QLayoutItem
Definition at line 190 of file KDChartAbstractCoordinatePlane.cpp.
|
override |
pure virtual in QLayoutItem
Definition at line 227 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::handleFixedDataCoordinateSpaceRelation(), KDChart::PolarDiagram::paint(), KDChart::RadarDiagram::paint(), KDChart::PolarCoordinatePlane::paint(), and KDChart::CartesianCoordinatePlane::setGeometry().
|
signal |
Emitted after the geometry of the Coordinate Plane has been changed. and control has returned to the event loop.
Parameters are the old geometry, the new geometry.
Referenced by KDChart::Plotter::connectAttributesModel().
|
protectedpure virtual |
Implemented in KDChart::TernaryCoordinatePlane, KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Referenced by KDChart::AbstractGrid::updateData().
GridAttributes KDChart::AbstractCoordinatePlane::globalGridAttributes | ( | ) | const |
Definition at line 142 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::gridAttributes().
KDChart::DataDimensionsList KDChart::AbstractCoordinatePlane::gridDimensionsList | ( | ) |
Returns the dimensions used for drawing the grid lines.
Returned data is the result of (cached) grid calculations, so - if you need that information for your own tasks - make sure to call again this function after every data modification that has changed the data range, since grid calculation is based upon the data range, thus the grid start/end might have changed if the data was changed.
Definition at line 147 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::layoutDiagrams(), and KDChart::CartesianAxis::paintCtx().
|
signal |
Referenced by KDChart::Plotter::connectAttributesModel().
bool KDChart::AbstractCoordinatePlane::isCornerSpacersEnabled | ( | ) | const |
Definition at line 274 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
override |
pure virtual in QLayoutItem
Definition at line 183 of file KDChartAbstractCoordinatePlane.cpp.
bool KDChart::AbstractCoordinatePlane::isRubberBandZoomingEnabled | ( | ) | const |
Definition at line 260 of file KDChartAbstractCoordinatePlane.cpp.
References d.
bool KDChart::AbstractCoordinatePlane::isVisiblePoint | ( | const QPointF & | point | ) | const |
Tests, if a point is visible on the coordinate plane.
Definition at line 393 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
pure virtual |
Distribute the available space among the diagrams and axes.
Implemented in KDChart::TernaryCoordinatePlane, KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Referenced by addDiagram(), replaceDiagram(), and takeDiagram().
|
slot |
Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes()
Definition at line 244 of file KDChartAbstractCoordinatePlane.cpp.
Referenced by addDiagram(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::CartesianAxis::layoutPlanes(), replaceDiagram(), and takeDiagram().
|
override |
pure virtual in QLayoutItem
Definition at line 195 of file KDChartAbstractCoordinatePlane.cpp.
|
override |
pure virtual in QLayoutItem
Definition at line 202 of file KDChartAbstractCoordinatePlane.cpp.
|
virtual |
Definition at line 313 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
virtual |
Definition at line 375 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
virtual |
Definition at line 279 of file KDChartAbstractCoordinatePlane.cpp.
References KDChart::ZoomParameters::center(), d, KDChart::ZoomParameters::xFactor, and KDChart::ZoomParameters::yFactor.
|
virtual |
Definition at line 325 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
signal |
Emitted when plane needs to trigger the Chart's layouting of the coord. planes.
Referenced by KDChart::Chart::insertCoordinatePlane().
|
signal |
Emitted when plane needs to trigger the Chart's layouting.
Referenced by KDChart::Chart::insertCoordinatePlane().
|
signal |
Emitted when plane needs to update its drawings.
Referenced by KDChart::Chart::insertCoordinatePlane().
KDChart::Chart * KDChart::AbstractCoordinatePlane::parent | ( | ) |
Definition at line 177 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by AbstractCoordinatePlane(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), and KDChart::CartesianAxis::paintCtx().
const KDChart::Chart * KDChart::AbstractCoordinatePlane::parent | ( | ) | const |
Definition at line 172 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
signal |
Emitted upon change of a property of the Coordinate Plane or any of its components.
Referenced by KDChart::CartesianCoordinatePlane::addDiagram(), KDChart::CartesianCoordinatePlane::adjustHorizontalRangeToData(), KDChart::CartesianCoordinatePlane::adjustRangesToData(), KDChart::CartesianCoordinatePlane::adjustVerticalRangeToData(), KDChart::CartesianCoordinatePlane::handleFixedDataCoordinateSpaceRelation(), KDChart::Chart::insertCoordinatePlane(), KDChart::CartesianCoordinatePlane::setAutoAdjustGridToZoom(), KDChart::CartesianCoordinatePlane::setAutoAdjustHorizontalRangeToData(), KDChart::CartesianCoordinatePlane::setAutoAdjustVerticalRangeToData(), KDChart::CartesianCoordinatePlane::setAxesCalcModes(), KDChart::CartesianCoordinatePlane::setAxesCalcModeX(), KDChart::CartesianCoordinatePlane::setAxesCalcModeY(), KDChart::CartesianCoordinatePlane::setGridAttributes(), KDChart::CartesianCoordinatePlane::setHorizontalRange(), KDChart::CartesianCoordinatePlane::setHorizontalRangeReversed(), KDChart::CartesianCoordinatePlane::setIsometricScaling(), KDChart::CartesianCoordinatePlane::setVerticalRange(), KDChart::CartesianCoordinatePlane::setVerticalRangeReversed(), KDChart::CartesianCoordinatePlane::setZoomCenter(), KDChart::CartesianCoordinatePlane::setZoomFactors(), KDChart::CartesianCoordinatePlane::setZoomFactorX(), and KDChart::CartesianCoordinatePlane::setZoomFactorY().
AbstractCoordinatePlane * KDChart::AbstractCoordinatePlane::referenceCoordinatePlane | ( | ) | const |
There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The first is the reference plane. If such a reference plane is set, on a plane, it will use the same cell in the layout as that one. In addition to this, planes can share an axis. In that case they will be laid out in relation to each other as suggested by the position of the axis. If, for example Plane1 and Plane2 share an axis at position Left, that will result in the layout: Axis Plane1 Plane 2, vertically. If Plane1 also happens to be Plane2's reference plane, both planes are drawn over each other. The reference plane concept allows two planes to share the same space even if neither has any axis, and in case there are shared axis, it is used to decided, whether the planes should be painted on top of each other or laid out vertically or horizontally next to each other.
Definition at line 162 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
slot |
Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout()
Definition at line 238 of file KDChartAbstractCoordinatePlane.cpp.
Referenced by addDiagram(), KDChart::AbstractCartesianDiagram::setCoordinatePlane(), and takeDiagram().
|
virtual |
Replaces the old diagram, or appends the diagram, it there is none yet.
diagram | The diagram to be used instead of the old diagram. This parameter must not be zero, or the method will do nothing. |
oldDiagram | The diagram to be removed by the new diagram. This diagram will be deleted automatically. If the parameter is omitted, the very first diagram will be replaced. In case, there was no diagram yet, the new diagram will just be added. |
Definition at line 74 of file KDChartAbstractCoordinatePlane.cpp.
References addDiagram(), d, diagram(), layoutDiagrams(), layoutPlanes(), takeDiagram(), and update().
Referenced by KDChart::Widget::setType().
void KDChart::AbstractCoordinatePlane::setCornerSpacersEnabled | ( | bool | enable | ) |
Enables or disables the use of spacers in the plane corners.
Definition at line 265 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
override |
pure virtual in QLayoutItem
Definition at line 214 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::setGeometry().
void KDChart::AbstractCoordinatePlane::setGlobalGridAttributes | ( | const GridAttributes & | a | ) |
Set the grid attributes to be used by this coordinate plane. To disable grid painting, for example, your code should like this:
Definition at line 136 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
slot |
Used by the chart to clear the cached grid data.
Definition at line 152 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::setAxesCalcModeY().
void KDChart::AbstractCoordinatePlane::setParent | ( | KDChart::Chart * | parent | ) |
Called internally by KDChart::Chart
Definition at line 167 of file KDChartAbstractCoordinatePlane.cpp.
References d.
Referenced by KDChart::Chart::insertCoordinatePlane(), and KDChart::Chart::takeCoordinatePlane().
void KDChart::AbstractCoordinatePlane::setReferenceCoordinatePlane | ( | AbstractCoordinatePlane * | plane | ) |
Set another coordinate plane to be used as the reference plane for this one.
plane | The coordinate plane to be used the reference plane for this one. |
Definition at line 157 of file KDChartAbstractCoordinatePlane.cpp.
References d.
void KDChart::AbstractCoordinatePlane::setRubberBandZoomingEnabled | ( | bool | enable | ) |
Enables or disables zooming with a rubber band using the mouse.
Definition at line 250 of file KDChartAbstractCoordinatePlane.cpp.
References d.
|
inlinevirtual |
Set the point (in value coordinates) to be used as the center point in zoom operations.
center | The point to use. |
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 190 of file KDChartAbstractCoordinatePlane.h.
|
inlinevirtual |
Sets both zoom factors in one go.
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 150 of file KDChartAbstractCoordinatePlane.h.
|
inlinevirtual |
Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.
factor | The new zoom factor |
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 161 of file KDChartAbstractCoordinatePlane.h.
|
inlinevirtual |
Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.
factor | The new zoom factor |
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 171 of file KDChartAbstractCoordinatePlane.h.
|
virtual |
Reimplemented in KDChart::CartesianCoordinatePlane.
Definition at line 398 of file KDChartAbstractCoordinatePlane.cpp.
Referenced by KDChart::LeveyJenningsGrid::drawGrid(), KDChart::BarDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), KDChart::LineDiagram::paint(), and KDChart::Plotter::paint().
|
override |
pure virtual in QLayoutItem
Definition at line 207 of file KDChartAbstractCoordinatePlane.cpp.
Referenced by KDChart::CartesianCoordinatePlane::sizeHint().
|
virtual |
Removes the diagram from the plane, without deleting it.
The plane no longer owns the diagram, so it is the caller's responsibility to delete the diagram.
Definition at line 95 of file KDChartAbstractCoordinatePlane.cpp.
References d, diagram(), layoutDiagrams(), layoutPlanes(), KDChart::AbstractDiagram::modelDataChanged(), KDChart::AbstractDiagram::modelsChanged(), relayout(), KDChart::AbstractDiagram::setCoordinatePlane(), and update().
Referenced by replaceDiagram().
|
pure virtual |
Translate the given point in value space coordinates to a position in pixel space.
diagramPoint | The point in value coordinates. |
Implemented in KDChart::TernaryCoordinatePlane, KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Referenced by KDChart::LeveyJenningsDiagram::drawDataPointSymbol(), KDChart::LeveyJenningsDiagram::drawFluidicsPackChangedSymbol(), KDChart::LeveyJenningsDiagram::drawLotChangeSymbol(), KDChart::LeveyJenningsDiagram::drawSensorChangedSymbol(), KDChart::LeveyJenningsDiagram::paint(), KDChart::PolarDiagram::paint(), and scaleToRealPosition().
|
slot |
Calling update() on the plane triggers the global KDChart::Chart::update()
Definition at line 232 of file KDChartAbstractCoordinatePlane.cpp.
Referenced by addDiagram(), KDChart::PolarCoordinatePlane::adjustZoomAndRepaint(), KDChart::CartesianCoordinatePlane::layoutDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), replaceDiagram(), KDChart::CartesianCoordinatePlane::resetGridAttributes(), KDChart::CartesianCoordinatePlane::setGridAttributes(), and takeDiagram().
|
signal |
Emitted upon change of the view coordinate system
Referenced by KDChart::CartesianCoordinatePlane::setAxesCalcModes(), KDChart::CartesianCoordinatePlane::setAxesCalcModeX(), KDChart::CartesianCoordinatePlane::setAxesCalcModeY(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().
|
inlinevirtual |
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 180 of file KDChartAbstractCoordinatePlane.h.
|
inlinevirtual |
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 132 of file KDChartAbstractCoordinatePlane.h.
Referenced by KDChart::PolarDiagram::paint(), KDChart::RadarDiagram::paint(), and KDChart::CartesianAxis::paint().
|
inlinevirtual |
Reimplemented in KDChart::PolarCoordinatePlane, and KDChart::CartesianCoordinatePlane.
Definition at line 141 of file KDChartAbstractCoordinatePlane.h.
Referenced by KDChart::PolarDiagram::paint(), KDChart::RadarDiagram::paint(), and KDChart::CartesianAxis::paint().