KD Chart API Documentation 3.1
|
Cartesian coordinate plane. More...
#include <KDChartCartesianCoordinatePlane.h>
Public Slots | |
void | adjustHorizontalRangeToData () |
void | adjustRangesToData () |
Adjust both, horizontal and vertical range settings to the ranges covered by the model's data values. | |
void | adjustVerticalRangeToData () |
Public Slots inherited from KDChart::AbstractCoordinatePlane | |
void | layoutPlanes () |
void | relayout () |
void | setGridNeedsRecalculate () |
void | update () |
Protected Slots | |
void | slotLayoutChanged (AbstractDiagram *) |
Cartesian coordinate plane.
Definition at line 27 of file KDChartCartesianCoordinatePlane.h.
Definition at line 42 of file KDChartCartesianCoordinatePlane.cpp.
|
override |
Definition at line 48 of file KDChartCartesianCoordinatePlane.cpp.
|
overridevirtual |
Adds a diagram to this coordinate plane.
diagram | The diagram to add. |
Reimplemented from KDChart::AbstractCoordinatePlane.
Reimplemented in KDChart::LeveyJenningsCoordinatePlane.
Definition at line 58 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::addDiagram(), QObject::connect(), KDChart::AbstractCoordinatePlane::diagram(), KDChart::AbstractDiagram::layoutChanged(), KDChart::AbstractCoordinatePlane::propertiesChanged(), KDChart::AbstractDiagram::propertiesChanged(), QObject::qobject_cast(), and slotLayoutChanged().
Referenced by KDChart::LeveyJenningsCoordinatePlane::addDiagram().
|
protected |
Definition at line 151 of file KDChartCartesianCoordinatePlane.cpp.
References axesCalcModeX(), axesCalcModeY(), QRectF::bottom(), d, QRectF::left(), KDChart::AbstractCoordinatePlane::Logarithmic, QObject::qobject_cast(), QRectF::right(), and QRectF::top().
Referenced by calculateRawDataBoundingRect().
|
slot |
Adjust horizontal range settings to the ranges covered by the model's data values.
Definition at line 633 of file KDChartCartesianCoordinatePlane.cpp.
References d, getRawDataBoundingRectFromDiagrams(), layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
|
slot |
Adjust both, horizontal and vertical range settings to the ranges covered by the model's data values.
Definition at line 622 of file KDChartCartesianCoordinatePlane.cpp.
References d, getRawDataBoundingRectFromDiagrams(), layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
|
slot |
Adjust vertical range settings to the ranges covered by the model's data values.
Definition at line 642 of file KDChartCartesianCoordinatePlane.cpp.
References d, getRawDataBoundingRectFromDiagrams(), layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
bool CartesianCoordinatePlane::autoAdjustGridToZoom | ( | ) | const |
Return the status of the built-in grid adjusting feature.
Definition at line 742 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Returns the maximal allowed percent of the horizontal space covered by the coordinate plane that may be empty.
Definition at line 673 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Returns the maximal allowed percent of the vertical space covered by the coordinate plane that may be empty.
Definition at line 678 of file KDChartCartesianCoordinatePlane.cpp.
References d.
CartesianCoordinatePlane::AxesCalcMode CartesianCoordinatePlane::axesCalcModeX | ( | ) | const |
Definition at line 537 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by adjustedToMaxEmptyInnerPercentage(), and getDataDimensionsList().
CartesianCoordinatePlane::AxesCalcMode CartesianCoordinatePlane::axesCalcModeY | ( | ) | const |
Definition at line 532 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by adjustedToMaxEmptyInnerPercentage(), and getDataDimensionsList().
|
protectedvirtual |
Definition at line 191 of file KDChartCartesianCoordinatePlane.cpp.
References adjustedToMaxEmptyInnerPercentage(), d, getRawDataBoundingRectFromDiagrams(), QObject::qobject_cast(), and QRectF::setLeft().
Referenced by getDataDimensionsList().
QRectF CartesianCoordinatePlane::diagramArea | ( | ) | const |
Returns the (physical) area occupied by the diagram. Unless zoom is applied (which is also true when a fixed data coordinate / space relation is used),
.
Definition at line 319 of file KDChartCartesianCoordinatePlane.cpp.
References d, logicalArea(), QRectF::normalized(), and QObject::qobject_cast().
Referenced by visibleDiagramArea().
bool CartesianCoordinatePlane::doesIsometricScaling | ( | ) | const |
Definition at line 444 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Definition at line 473 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by handleFixedDataCoordinateSpaceRelation(), and setZoomCenter().
Definition at line 449 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
Referenced by handleFixedDataCoordinateSpaceRelation(), setZoomFactors(), and setZoomFactorX().
Definition at line 461 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
Referenced by handleFixedDataCoordinateSpaceRelation(), setZoomFactors(), and setZoomFactorY().
|
protectedvirtual |
Definition at line 287 of file KDChartCartesianCoordinatePlane.cpp.
References QRectF::adjusted(), and KDChart::AbstractArea::areaGeometry().
Referenced by layoutDiagrams(), paint(), setFixedDataCoordinateSpaceRelation(), setZoomCenter(), setZoomFactors(), setZoomFactorX(), setZoomFactorY(), visibleDataRange(), and visibleDiagramArea().
|
overridevirtual |
pure virtual in QLayoutItem
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 855 of file KDChartCartesianCoordinatePlane.cpp.
References d, Qt::Horizontal, and Qt::Vertical.
|
overrideprotectedvirtual |
Implements KDChart::AbstractCoordinatePlane.
Definition at line 239 of file KDChartCartesianCoordinatePlane.cpp.
References axesCalcModeX(), axesCalcModeY(), QRectF::bottom(), calculateRawDataBoundingRect(), KDChart::AbstractCoordinatePlane::diagrams(), gridAttributes(), Qt::Horizontal, QList::isEmpty(), QRectF::left(), QObject::qobject_cast(), QRectF::right(), QRectF::top(), and Qt::Vertical.
|
protected |
Definition at line 122 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractDiagram::dataBoundaries(), KDChart::AbstractCoordinatePlane::diagram(), KDChart::AbstractCoordinatePlane::diagrams(), QObject::qobject_cast(), and QRectF::setBottomLeft().
Referenced by adjustHorizontalRangeToData(), adjustRangesToData(), adjustVerticalRangeToData(), and calculateRawDataBoundingRect().
const GridAttributes CartesianCoordinatePlane::gridAttributes | ( | Qt::Orientation | orientation | ) | const |
Definition at line 702 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::AbstractCoordinatePlane::globalGridAttributes(), hasOwnGridAttributes(), and Qt::Horizontal.
Referenced by getDataDimensionsList().
|
protected |
Definition at line 379 of file KDChartCartesianCoordinatePlane.cpp.
References d, doneSetZoomCenter(), doneSetZoomFactorX(), doneSetZoomFactorY(), KDChart::AbstractCoordinatePlane::geometry(), QRect::height(), QRect::isValid(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), QObject::qobject_cast(), QRect::size(), QRect::width(), zoomCenter(), zoomFactorX(), and zoomFactorY().
Referenced by layoutDiagrams(), and setFixedDataCoordinateSpaceRelation().
bool CartesianCoordinatePlane::hasFixedDataCoordinateSpaceRelation | ( | ) | const |
Definition at line 361 of file KDChartCartesianCoordinatePlane.cpp.
References d.
|
overrideprotectedvirtual |
Reimplemented from QLayoutItem.
Definition at line 861 of file KDChartCartesianCoordinatePlane.cpp.
References d.
bool CartesianCoordinatePlane::hasOwnGridAttributes | ( | Qt::Orientation | orientation | ) | const |
If false, the grid will use the global attributes set by AbstractCoordinatePlane::globalGridAttributes (or the default attributes, resp.)
Definition at line 723 of file KDChartCartesianCoordinatePlane.cpp.
References d, and Qt::Horizontal.
Referenced by gridAttributes().
Reimplemented from QLayoutItem.
Definition at line 866 of file KDChartCartesianCoordinatePlane.cpp.
References logicalArea(), and QObject::qobject_cast().
Referenced by setGeometry(), and sizeHint().
Definition at line 612 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
bool CartesianCoordinatePlane::isHorizontalRangeReversed | ( | ) | const |
Definition at line 797 of file KDChartCartesianCoordinatePlane.cpp.
References d.
bool CartesianCoordinatePlane::isVerticalRangeReversed | ( | ) | const |
Definition at line 812 of file KDChartCartesianCoordinatePlane.cpp.
References d.
|
overrideprotectedvirtual |
Distribute the available space among the diagrams and axes.
Implements KDChart::AbstractCoordinatePlane.
Definition at line 333 of file KDChartCartesianCoordinatePlane.cpp.
References d, drawingArea(), KDChart::AbstractCoordinatePlane::gridDimensionsList(), handleFixedDataCoordinateSpaceRelation(), logicalArea(), QObject::qobject_cast(), and KDChart::AbstractCoordinatePlane::update().
Referenced by adjustHorizontalRangeToData(), adjustRangesToData(), adjustVerticalRangeToData(), setAutoAdjustHorizontalRangeToData(), setAutoAdjustVerticalRangeToData(), setHorizontalRange(), setHorizontalRangeReversed(), setIsometricScaling(), setVerticalRange(), setVerticalRangeReversed(), and slotLayoutChanged().
QRectF CartesianCoordinatePlane::logicalArea | ( | ) | const |
Returns the logical area, i.e., the rectangle defined by the very top left and very bottom right coordinate.
Definition at line 298 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
Referenced by diagramArea(), heightForWidth(), layoutDiagrams(), setZoomCenter(), setZoomFactors(), setZoomFactorX(), and setZoomFactorY().
reimp
Implements KDChart::AbstractLayoutItem.
Definition at line 70 of file KDChartCartesianCoordinatePlane.cpp.
References QRect::adjusted(), d, KDChart::AbstractCoordinatePlane::diagrams(), drawingArea(), QObject::qobject_cast(), QPainter::setClipRegion(), KDChart::PaintContext::setPainter(), and QElapsedTimer::start().
|
protected |
void CartesianCoordinatePlane::resetGridAttributes | ( | Qt::Orientation | orientation | ) |
Reset the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction, resp.). By calling this method you specify that the global attributes set by AbstractCoordinatePlane::setGlobalGridAttributes be used.
Definition at line 696 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::update().
Disable / re-enable the built-in grid adjusting feature.
By default additional lines will be drawn in a Linear grid when zooming in.
Definition at line 729 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Automatically adjust horizontal range settings to the ranges covered by the model's values, when ever the data have changed, and then emit horizontalRangeAutomaticallyAdjusted.
By default the horizontal range is adjusted automatically, if more than 67 percent of the available horizontal space would be empty otherwise.
Range setting is adjusted if more than percentEmpty
percent of the horizontal space covered by the coordinate plane would otherwise be empty. Automatic range adjusting can happen, when either all of the data are positive or all are negative.
Set percentEmpty to 100 to disable automatic range adjusting.
percentEmpty | The maximal percentage of horizontal space that may be empty. |
Definition at line 651 of file KDChartCartesianCoordinatePlane.cpp.
References d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Automatically adjust vertical range settings to the ranges covered by the model's values, when ever the data have changed, and then emit verticalRangeAutomaticallyAdjusted.
By default the vertical range is adjusted automatically, if more than 67 percent of the available vertical space would be empty otherwise.
Range setting is adjusted if more than percentEmpty
percent of the horizontal space covered by the coordinate plane would otherwise be empty. Automatic range adjusting can happen, when either all of the data are positive or all are negative.
Set percentEmpty to 100 to disable automatic range adjusting.
percentEmpty | The maximal percentage of horizontal space that may be empty. |
Definition at line 662 of file KDChartCartesianCoordinatePlane.cpp.
References d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
void CartesianCoordinatePlane::setAxesCalcModes | ( | AxesCalcMode | mode | ) |
Specifies the calculation modes for all axes
Definition at line 542 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::AbstractCoordinatePlane::diagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), QObject::qobject_cast(), slotLayoutChanged(), and KDChart::AbstractCoordinatePlane::viewportCoordinateSystemChanged().
void CartesianCoordinatePlane::setAxesCalcModeX | ( | AxesCalcMode | mode | ) |
Specifies the calculation mode for all Abscissa axes
Definition at line 566 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and KDChart::AbstractCoordinatePlane::viewportCoordinateSystemChanged().
void CartesianCoordinatePlane::setAxesCalcModeY | ( | AxesCalcMode | mode | ) |
Specifies the calculation mode for all Ordinate axes
Definition at line 556 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), KDChart::AbstractCoordinatePlane::setGridNeedsRecalculate(), and KDChart::AbstractCoordinatePlane::viewportCoordinateSystemChanged().
Allows to specify a fixed data-space / coordinate-space relation. If set to true then fixed bar widths are used, so you see more bars as the window is made wider.
This allows to completely restrict the size of bars in a graph such that, upon resizing a window, the graphs coordinate plane will grow (add more ticks to x- and y-coordinates) rather than have the image grow.
Definition at line 354 of file KDChartCartesianCoordinatePlane.cpp.
References d, drawingArea(), and handleFixedDataCoordinateSpaceRelation().
reimplemented from AbstractCoordinatePlane
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 829 of file KDChartCartesianCoordinatePlane.cpp.
References d, KDChart::AbstractCoordinatePlane::diagram(), KDChart::AbstractCoordinatePlane::diagrams(), KDChart::AbstractCoordinatePlane::geometry(), QRect::height(), heightForWidth(), QObject::qobject_cast(), KDChart::AbstractDiagram::resize(), KDChart::AbstractCoordinatePlane::setGeometry(), and QRect::width().
void CartesianCoordinatePlane::setGridAttributes | ( | Qt::Orientation | orientation, |
const GridAttributes & | a | ||
) |
Set the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction, resp.).
To disable horizontal grid painting, for example, your code should like this:
Definition at line 683 of file KDChartCartesianCoordinatePlane.cpp.
References d, Qt::Horizontal, KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and KDChart::AbstractCoordinatePlane::update().
Set the boundaries of the visible value space displayed in horizontal direction.
This is also known as the horizontal viewport.
By default the horizontal range is adjusted to the range covered by the model's data, see setAutoAdjustHorizontalRangeToData for details. Calling setHorizontalRange with a valid range disables this default automatic adjusting, while on the other hand automatic adjusting will set these ranges.
To disable use of this range you can either pass an empty pair by using the default constructor QPair() or you can set both values to the same which constitutes a null range.
range | a pair of values representing the smallest and the largest horizontal value space coordinate displayed. |
Definition at line 586 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::boundariesChanged(), d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Sets whether the horizontal range should be reversed or not, i.e. small values to the left and large values to the right (the default) or vice versa.
reverse | Whether the horizontal range should be reversed or not |
Definition at line 787 of file KDChartCartesianCoordinatePlane.cpp.
References d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
If onOff
is true, enforce that X and Y distances are scaled by the same factor. This makes the plane's height a function of its width, and hasHeightForWidth() will return true.
Definition at line 435 of file KDChartCartesianCoordinatePlane.cpp.
References d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Set the boundaries of the visible value space displayed in vertical direction.
This is also known as the vertical viewport.
By default the vertical range is adjusted to the range covered by the model's data, see setAutoAdjustVerticalRangeToData for details. Calling setVerticalRange with a valid range disables this default automatic adjusting, while on the other hand automatic adjusting will set these ranges.
To disable use of this range you can either pass an empty pair by using the default constructor QPair() or you can set setting both values to the same which constitutes a null range.
range | a pair of values representing the smallest and the largest vertical value space coordinate displayed. |
Definition at line 599 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::boundariesChanged(), d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Sets whether the vertical range should be reversed or not, i.e. small values at the bottom and large values at the top (the default) or vice versa.
reverse | Whether the vertical range should be reversed or not |
Definition at line 802 of file KDChartCartesianCoordinatePlane.cpp.
References d, layoutDiagrams(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Allows to fix the lower bound of X axis to zero when diagram is in first quadrant.
The default behavior is to lower x or y bound to be 0. If this behaviour is not wanted, either CartesianCoordinatePlane::setHorizontalRange could be used instead of letting KDChart auto-adjust the ranges, or this method can be used to disable this behavior.
Definition at line 366 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 509 of file KDChartCartesianCoordinatePlane.cpp.
References d, doneSetZoomCenter(), drawingArea(), logicalArea(), KDChart::AbstractCoordinatePlane::propertiesChanged(), and QObject::Q_EMIT().
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 485 of file KDChartCartesianCoordinatePlane.cpp.
References d, doneSetZoomFactorX(), doneSetZoomFactorY(), drawingArea(), logicalArea(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 493 of file KDChartCartesianCoordinatePlane.cpp.
References d, doneSetZoomFactorX(), drawingArea(), logicalArea(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 501 of file KDChartCartesianCoordinatePlane.cpp.
References d, doneSetZoomFactorY(), drawingArea(), logicalArea(), KDChart::AbstractCoordinatePlane::propertiesChanged(), QObject::Q_EMIT(), and QObject::qobject_cast().
|
overridevirtual |
reimp
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 747 of file KDChartCartesianCoordinatePlane.cpp.
References KDChart::AbstractCoordinatePlane::diagram(), QObject::qobject_cast(), QPainter::scale(), translate(), QPainter::translate(), QPointF::x(), and QPointF::y().
|
overrideprotectedvirtual |
pure virtual in QLayoutItem
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 875 of file KDChartCartesianCoordinatePlane.cpp.
References d, heightForWidth(), QObject::qobject_cast(), and KDChart::AbstractCoordinatePlane::sizeHint().
|
protectedslot |
Definition at line 117 of file KDChartCartesianCoordinatePlane.cpp.
References layoutDiagrams().
Referenced by addDiagram(), and setAxesCalcModes().
|
overridevirtual |
Translate the given point in value space coordinates to a position in pixel space.
diagramPoint | The point in value coordinates. |
Implements KDChart::AbstractCoordinatePlane.
Definition at line 421 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
Referenced by KDChart::CartesianAxis::paintCtx(), and sharedAxisMasterPlane().
Definition at line 430 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
Referenced by KDChart::LeveyJenningsCoordinatePlane::translateBack(), and visibleDataRange().
Definition at line 617 of file KDChartCartesianCoordinatePlane.cpp.
References d, and QObject::qobject_cast().
QRectF CartesianCoordinatePlane::visibleDataRange | ( | ) | const |
Returns the currently visible data range. Might be greater than the range of the grid.
Definition at line 817 of file KDChartCartesianCoordinatePlane.cpp.
References drawingArea(), QObject::qobject_cast(), QRectF::setBottomRight(), QRectF::setTopLeft(), and translateBack().
QRectF CartesianCoordinatePlane::visibleDiagramArea | ( | ) | const |
Returns the visible part of the diagram area, i.e.
Definition at line 328 of file KDChartCartesianCoordinatePlane.cpp.
References diagramArea(), drawingArea(), and QRectF::intersected().
bool CartesianCoordinatePlane::xAxisStartAtZero | ( | ) | const |
Definition at line 374 of file KDChartCartesianCoordinatePlane.cpp.
References d.
|
overridevirtual |
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 517 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by handleFixedDataCoordinateSpaceRelation().
|
overridevirtual |
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 522 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by handleFixedDataCoordinateSpaceRelation().
|
overridevirtual |
Reimplemented from KDChart::AbstractCoordinatePlane.
Definition at line 527 of file KDChartCartesianCoordinatePlane.cpp.
References d.
Referenced by handleFixedDataCoordinateSpaceRelation().