KChart
KChartCartesianCoordinatePlane.cpp
153 //qDebug() << "CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams()\ngets diagram->dataBoundaries: " << dataBoundariesPair.first << dataBoundariesPair.second;
160 //qDebug() << "CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams()\nreturns data boundaries: " << QRectF( QPointF(minX, minY), QSizeF(maxX - minX, maxY - minY) );
172 if ( ( axesCalcModeX() != Logarithmic || r.left() < 0.0 ) && percentX > 0 && percentX != 100 ) {
189 if ( ( axesCalcModeY() != Logarithmic || r.bottom() < 0.0 ) && percentY > 0 && percentY != 100 ) {
215 const bool bHardHorizontalRange = (!bAutoAdjustHorizontalRange) && (d->horizontalMin != d->horizontalMax || (ISNAN(d->horizontalMin) != ISNAN(d->horizontalMax)));
216 const bool bHardVerticalRange = (!bAutoAdjustVerticalRange) && (d->verticalMin != d->verticalMax || (ISNAN(d->verticalMin) != ISNAN(d->verticalMax)));
271 // same time won't work, and thus the orientation for all diagrams is the same as for the first one.
272 const Qt::Orientation diagramOrientation = barDiagram != nullptr ? barDiagram->orientation() : Qt::Vertical;
411 // this is relevant for the cooperation between this method, setFixedDataCoordinateSpaceRelation(),
415 d->fixedDataCoordinateSpaceRelationPinnedZoom = ZoomParameters( zoomFactorX(), zoomFactorY(), zoomCenter() );
421 const qreal widthScaling = d->fixedDataCoordinateSpaceRelationPinnedSize.width() / geometry.width();
422 const qreal heightScaling = d->fixedDataCoordinateSpaceRelationPinnedSize.height() / geometry.height();
427 const QPointF newCenter = QPointF( d->fixedDataCoordinateSpaceRelationPinnedZoom.xCenter / widthScaling,
724const GridAttributes CartesianCoordinatePlane::gridAttributes( Qt::Orientation orientation ) const
799 const qreal factor = (translate( tenX ) - translate( zero ) ).x() / ( plane->translate( tenX ) - plane->translate( zero ) ).x();
QRect areaGeometry() const override
Definition KChartAbstractArea.cpp:137
Base class for diagrams based on a cartesian coordianate system.
Definition KChartAbstractCartesianDiagram.h:28
virtual KChart::CartesianAxisList axes() const
Definition KChartAbstractCartesianDiagram.cpp:90
virtual AbstractCartesianDiagram * referenceDiagram() const
Definition KChartAbstractCartesianDiagram.cpp:140
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
Definition KChartAbstractCoordinatePlane.h:31
virtual void addDiagram(AbstractDiagram *diagram)
Adds a diagram to this coordinate plane.
Definition KChartAbstractCoordinatePlane.cpp:57
void propertiesChanged()
Emitted upon change of a property of the Coordinate Plane or any of its components.
QSize sizeHint() const override
pure virtual in QLayoutItem
Definition KChartAbstractCoordinatePlane.cpp:212
void setGeometry(const QRect &r) override
pure virtual in QLayoutItem
Definition KChartAbstractCoordinatePlane.cpp:219
QRect geometry() const override
pure virtual in QLayoutItem
Definition KChartAbstractCoordinatePlane.cpp:232
void update()
Calling update() on the plane triggers the global KChart::Chart::update()
Definition KChartAbstractCoordinatePlane.cpp:237
void setGridNeedsRecalculate()
Used by the chart to clear the cached grid data.
Definition KChartAbstractCoordinatePlane.cpp:157
void viewportCoordinateSystemChanged()
Emitted upon change of the view coordinate system.
AbstractDiagramList diagrams()
Definition KChartAbstractCoordinatePlane.cpp:124
AbstractDiagram * diagram()
Definition KChartAbstractCoordinatePlane.cpp:114
GridAttributes globalGridAttributes() const
Definition KChartAbstractCoordinatePlane.cpp:147
DataDimensionsList gridDimensionsList()
Returns the dimensions used for drawing the grid lines.
Definition KChartAbstractCoordinatePlane.cpp:152
AbstractDiagram defines the interface for diagram classes.
Definition KChartAbstractDiagram.h:37
virtual void resize(const QSizeF &area)
Called by the widget's sizeEvent.
Definition KChartAbstractDiagram.cpp:116
const QPair< QPointF, QPointF > dataBoundaries() const
Return the bottom left and top right data point, that the diagram will display (unless the grid adjus...
Definition KChartAbstractDiagram.cpp:101
void propertiesChanged()
Emitted upon change of a property of the Diagram.
void layoutChanged(KChart::AbstractDiagram *)
Diagrams are supposed to emit this signal, when the layout of one of their element changes.
int datasetDimension() const
The dataset dimension of a diagram determines how many value dimensions it expects each datapoint to ...
Definition KChartAbstractDiagram.cpp:1138
Qt::Orientation orientation() const
Definition KChartBarDiagram.cpp:163
Cartesian coordinate plane.
Definition KChartCartesianCoordinatePlane.h:26
QRectF visibleDataRange() const
Returns the currently visible data range.
Definition KChartCartesianCoordinatePlane.cpp:845
void setAxesCalcModeX(AxesCalcMode mode)
Specifies the calculation mode for all Abscissa axes.
Definition KChartCartesianCoordinatePlane.cpp:588
QRectF visibleDiagramArea() const
Returns the visible part of the diagram area, i.e.
Definition KChartCartesianCoordinatePlane.cpp:349
bool hasOwnGridAttributes(Qt::Orientation orientation) const
Definition KChartCartesianCoordinatePlane.cpp:745
void setVerticalRange(const QPair< qreal, qreal > &range)
Set the boundaries of the visible value space displayed in vertical direction.
Definition KChartCartesianCoordinatePlane.cpp:620
unsigned int autoAdjustVerticalRangeToData() const
Returns the maximal allowed percent of the vertical space covered by the coordinate plane that may be...
Definition KChartCartesianCoordinatePlane.cpp:700
void adjustVerticalRangeToData()
Adjust vertical range settings to the ranges covered by the model's data values.
Definition KChartCartesianCoordinatePlane.cpp:662
void adjustHorizontalRangeToData()
Adjust horizontal range settings to the ranges covered by the model's data values.
Definition KChartCartesianCoordinatePlane.cpp:653
unsigned int autoAdjustHorizontalRangeToData() const
Returns the maximal allowed percent of the horizontal space covered by the coordinate plane that may ...
Definition KChartCartesianCoordinatePlane.cpp:695
void layoutDiagrams() override
Distribute the available space among the diagrams and axes.
Definition KChartCartesianCoordinatePlane.cpp:354
void setZoomFactorY(qreal factor) override
Definition KChartCartesianCoordinatePlane.cpp:522
void setZoomFactors(qreal factorX, qreal factorY) override
Definition KChartCartesianCoordinatePlane.cpp:506
bool isVerticalRangeReversed() const
Definition KChartCartesianCoordinatePlane.cpp:840
void setGeometry(const QRect &r) override
reimplemented from AbstractCoordinatePlane
Definition KChartCartesianCoordinatePlane.cpp:857
void adjustRangesToData()
Adjust both, horizontal and vertical range settings to the ranges covered by the model's data values.
Definition KChartCartesianCoordinatePlane.cpp:642
QPointF zoomCenter() const override
Definition KChartCartesianCoordinatePlane.cpp:538
const QPointF translate(const QPointF &diagramPoint) const override
Translate the given point in value space coordinates to a position in pixel space.
Definition KChartCartesianCoordinatePlane.cpp:442
void setAutoAdjustGridToZoom(bool autoAdjust)
Disable / re-enable the built-in grid adjusting feature.
Definition KChartCartesianCoordinatePlane.cpp:751
QPair< qreal, qreal > horizontalRange() const
Definition KChartCartesianCoordinatePlane.cpp:632
bool isHorizontalRangeReversed() const
Definition KChartCartesianCoordinatePlane.cpp:825
void setVerticalRangeReversed(bool reverse)
Sets whether the vertical range should be reversed or not, i.e.
Definition KChartCartesianCoordinatePlane.cpp:830
QPair< qreal, qreal > verticalRange() const
Definition KChartCartesianCoordinatePlane.cpp:637
AbstractCoordinatePlane * sharedAxisMasterPlane(QPainter *p=nullptr) override
reimpl
Definition KChartCartesianCoordinatePlane.cpp:768
void setZoomFactorX(qreal factor) override
Definition KChartCartesianCoordinatePlane.cpp:514
Qt::Orientations expandingDirections() const override
pure virtual in QLayoutItem
Definition KChartCartesianCoordinatePlane.cpp:884
void setAutoAdjustVerticalRangeToData(unsigned int percentEmpty=67)
Automatically adjust vertical range settings to the ranges covered by the model's values,...
Definition KChartCartesianCoordinatePlane.cpp:683
const GridAttributes gridAttributes(Qt::Orientation orientation) const
Definition KChartCartesianCoordinatePlane.cpp:724
void addDiagram(AbstractDiagram *diagram) override
Adds a diagram to this coordinate plane.
Definition KChartCartesianCoordinatePlane.cpp:72
void setXAxisStartAtZero(bool fixedStart)
Allows to fix the lower bound of X axis to zero when diagram is in first quadrant.
Definition KChartCartesianCoordinatePlane.cpp:387
void setHorizontalRangeReversed(bool reverse)
Sets whether the horizontal range should be reversed or not, i.e.
Definition KChartCartesianCoordinatePlane.cpp:815
QRectF logicalArea() const
Returns the logical area, i.e., the rectangle defined by the very top left and very bottom right coor...
Definition KChartCartesianCoordinatePlane.cpp:319
QSize sizeHint() const override
pure virtual in QLayoutItem
Definition KChartCartesianCoordinatePlane.cpp:904
void setIsometricScaling(bool onOff)
If onOff is true, enforce that X and Y distances are scaled by the same factor.
Definition KChartCartesianCoordinatePlane.cpp:456
void setAxesCalcModes(AxesCalcMode mode)
Specifies the calculation modes for all axes.
Definition KChartCartesianCoordinatePlane.cpp:564
void setAutoAdjustHorizontalRangeToData(unsigned int percentEmpty=67)
Automatically adjust horizontal range settings to the ranges covered by the model's values,...
Definition KChartCartesianCoordinatePlane.cpp:671
qreal zoomFactorX() const override
Definition KChartCartesianCoordinatePlane.cpp:543
void setZoomCenter(const QPointF ¢er) override
Definition KChartCartesianCoordinatePlane.cpp:530
void setFixedDataCoordinateSpaceRelation(bool fixed)
Allows to specify a fixed data-space / coordinate-space relation.
Definition KChartCartesianCoordinatePlane.cpp:375
void setHorizontalRange(const QPair< qreal, qreal > &range)
Set the boundaries of the visible value space displayed in horizontal direction.
Definition KChartCartesianCoordinatePlane.cpp:608
QRectF diagramArea() const
Returns the (physical) area occupied by the diagram.
Definition KChartCartesianCoordinatePlane.cpp:340
bool autoAdjustGridToZoom() const
Return the status of the built-in grid adjusting feature.
Definition KChartCartesianCoordinatePlane.cpp:763
void resetGridAttributes(Qt::Orientation orientation)
Reset the attributes to be used for grid lines drawn in horizontal direction (or in vertical directio...
Definition KChartCartesianCoordinatePlane.cpp:718
void setGridAttributes(Qt::Orientation orientation, const GridAttributes &)
Set the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction,...
Definition KChartCartesianCoordinatePlane.cpp:705
void setAxesCalcModeY(AxesCalcMode mode)
Specifies the calculation mode for all Ordinate axes.
Definition KChartCartesianCoordinatePlane.cpp:578
qreal zoomFactorY() const override
Definition KChartCartesianCoordinatePlane.cpp:548
Helper class for one dimension of data, e.g.
Definition KChartAbstractCoordinatePlane.h:364
qreal distance() const
Returns the size of the distance, equivalent to the width() (or height(), resp.) of a QRectF.
Definition KChartAbstractCoordinatePlane.h:397
A set of attributes controlling the appearance of grids.
Definition KChartGridAttributes.h:26
ZoomParameters stores the center and the factor of zooming internally.
Definition KChartZoomParameters.h:28
qint64 elapsed() const const
void start()
void append(QList< T > &&value)
bool isEmpty() const const
qsizetype size() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
T qobject_cast(QObject *object)
void scale(qreal sx, qreal sy)
void setClipRegion(const QRegion ®ion, Qt::ClipOperation operation)
void translate(const QPoint &offset)
qreal x() const const
qreal y() const const
QRect adjusted(int dx1, int dy1, int dx2, int dy2) const const
int height() const const
bool isValid() const const
QSize size() const const
int width() const const
QRectF adjusted(qreal dx1, qreal dy1, qreal dx2, qreal dy2) const const
qreal bottom() const const
QPointF bottomRight() const const
qreal height() const const
QRectF intersected(const QRectF &rectangle) const const
qreal left() const const
QRectF normalized() const const
qreal right() const const
void setBottom(qreal y)
void setBottomLeft(const QPointF &position)
void setBottomRight(const QPointF &position)
void setLeft(qreal x)
void setRight(qreal x)
void setTop(qreal y)
void setTopLeft(const QPointF &position)
void setTopRight(const QPointF &position)
QRect toRect() const const
qreal top() const const
QPointF topLeft() const const
qreal width() const const
void setHeight(int height)
int width() const const
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.