KChart::CartesianCoordinatePlane

Search for usage in LXR

#include <KChartCartesianCoordinatePlane.h>

Inheritance diagram for KChart::CartesianCoordinatePlane:

Public Slots

void adjustHorizontalRangeToData ()
 
void adjustRangesToData ()
 
void adjustVerticalRangeToData ()
 
- Public Slots inherited from KChart::AbstractCoordinatePlane
void layoutPlanes ()
 
void relayout ()
 
void setGridNeedsRecalculate ()
 
void update ()
 

Public Member Functions

 CartesianCoordinatePlane (Chart *parent=nullptr)
 
void addDiagram (AbstractDiagram *diagram) override
 
bool autoAdjustGridToZoom () const
 
unsigned int autoAdjustHorizontalRangeToData () const
 
unsigned int autoAdjustVerticalRangeToData () const
 
AxesCalcMode axesCalcModeX () const
 
AxesCalcMode axesCalcModeY () const
 
QRectF diagramArea () const
 
bool doesIsometricScaling () const
 
Qt::Orientations expandingDirections () const override
 
const GridAttributes gridAttributes (Qt::Orientation orientation) const
 
bool hasFixedDataCoordinateSpaceRelation () const
 
bool hasOwnGridAttributes (Qt::Orientation orientation) const
 
QPair< qreal, qreal > horizontalRange () const
 
bool isHorizontalRangeReversed () const
 
bool isVerticalRangeReversed () const
 
QRectF logicalArea () const
 
void paint (QPainter *) override
 
void resetGridAttributes (Qt::Orientation orientation)
 
void setAutoAdjustGridToZoom (bool autoAdjust)
 
void setAutoAdjustHorizontalRangeToData (unsigned int percentEmpty=67)
 
void setAutoAdjustVerticalRangeToData (unsigned int percentEmpty=67)
 
void setAxesCalcModes (AxesCalcMode mode)
 
void setAxesCalcModeX (AxesCalcMode mode)
 
void setAxesCalcModeY (AxesCalcMode mode)
 
void setFixedDataCoordinateSpaceRelation (bool fixed)
 
void setGeometry (const QRect &r) override
 
void setGridAttributes (Qt::Orientation orientation, const GridAttributes &)
 
void setHorizontalRange (const QPair< qreal, qreal > &range)
 
void setHorizontalRangeReversed (bool reverse)
 
void setIsometricScaling (bool onOff)
 
void setVerticalRange (const QPair< qreal, qreal > &range)
 
void setVerticalRangeReversed (bool reverse)
 
void setXAxisStartAtZero (bool fixedStart)
 
void setZoomCenter (const QPointF &center) override
 
void setZoomFactors (qreal factorX, qreal factorY) override
 
void setZoomFactorX (qreal factor) override
 
void setZoomFactorY (qreal factor) override
 
AbstractCoordinatePlanesharedAxisMasterPlane (QPainter *p=nullptr) override
 
const QPointF translate (const QPointF &diagramPoint) const override
 
const QPointF translateBack (const QPointF &screenPoint) const
 
QPair< qreal, qreal > verticalRange () const
 
QRectF visibleDataRange () const
 
QRectF visibleDiagramArea () const
 
bool xAxisStartAtZero () const
 
QPointF zoomCenter () const override
 
qreal zoomFactorX () const override
 
qreal zoomFactorY () const override
 
- Public Member Functions inherited from KChart::AbstractCoordinatePlane
AbstractDiagramdiagram ()
 
AbstractDiagramList diagrams ()
 
ConstAbstractDiagramList diagrams () const
 
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
 
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)
 
Chartparent ()
 
const Chartparent () const
 
AbstractCoordinatePlanereferenceCoordinatePlane () const
 
virtual void replaceDiagram (AbstractDiagram *diagram, AbstractDiagram *oldDiagram=nullptr)
 
void setCornerSpacersEnabled (bool enable)
 
void setGlobalGridAttributes (const GridAttributes &)
 
void setParent (Chart *parent)
 
void setReferenceCoordinatePlane (AbstractCoordinatePlane *plane)
 
void setRubberBandZoomingEnabled (bool enable)
 
virtual void takeDiagram (AbstractDiagram *diagram)
 
- Public Member Functions inherited from KChart::AbstractArea
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)
 
virtual int rightOverlap (bool doNotRecalculate=false) const
 
virtual int topOverlap (bool doNotRecalculate=false) const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Public Member Functions inherited from KChart::AbstractAreaBase
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)
 
- Public Member Functions inherited from KChart::AbstractLayoutItem
 AbstractLayoutItem (Qt::Alignment itemAlignment=Qt::Alignment())
 
virtual void paintCtx (PaintContext *context)
 
QLayoutparentLayout ()
 
void removeFromParentLayout ()
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 
virtual void sizeHintChanged () const
 
- Public Member Functions inherited from QLayoutItem
 QLayoutItem (Qt::Alignment alignment)
 
Qt::Alignment alignment () const const
 
virtual QSizePolicy::ControlTypes controlTypes () const const
 
virtual void invalidate ()
 
virtual QLayoutlayout ()
 
virtual int minimumHeightForWidth (int w) const const
 
void setAlignment (Qt::Alignment alignment)
 
virtual QSpacerItemspacerItem ()
 
virtual QWidgetwidget ()
 

Protected Slots

void slotLayoutChanged (KChart::AbstractDiagram *)
 

Protected Member Functions

QRectF adjustedToMaxEmptyInnerPercentage (const QRectF &r, unsigned int percentX, unsigned int percentY) const
 
virtual QRectF calculateRawDataBoundingRect () const
 
bool doneSetZoomCenter (const QPointF &center)
 
bool doneSetZoomFactorX (qreal factor)
 
bool doneSetZoomFactorY (qreal factor)
 
virtual QRectF drawingArea () const
 
DataDimensionsList getDataDimensionsList () const override
 
QRectF getRawDataBoundingRectFromDiagrams () const
 
void handleFixedDataCoordinateSpaceRelation (const QRectF &geometry)
 
bool hasHeightForWidth () const override
 
int heightForWidth (int w) const override
 
void layoutDiagrams () override
 
void paintEvent (QPaintEvent *)
 
QSize sizeHint () const override
 
- Protected Member Functions inherited from KChart::AbstractCoordinatePlane
 AbstractCoordinatePlane (Chart *parent=nullptr)
 
- Protected Member Functions inherited from KChart::AbstractArea
QRect areaGeometry () const override
 
void positionHasChanged () override
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Member Functions inherited from KChart::AbstractAreaBase
QRect innerRect () const
 

Additional Inherited Members

- Public Types inherited from KChart::AbstractCoordinatePlane
enum  AxesCalcMode { Linear , Logarithmic }
 
- Properties inherited from QObject
 objectName
 
- Signals inherited from KChart::AbstractCoordinatePlane
void boundariesChanged ()
 
void destroyedCoordinatePlane (KChart::AbstractCoordinatePlane *)
 
void geometryChanged (QRect, QRect)
 
void internal_geometryChanged (QRect, QRect)
 
void needLayoutPlanes ()
 
void needRelayout ()
 
void needUpdate ()
 
void propertiesChanged ()
 
void viewportCoordinateSystemChanged ()
 
- Signals inherited from KChart::AbstractArea
void positionChanged (KChart::AbstractArea *)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Public Member Functions inherited from KChart::AbstractAreaBase
static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KChart::BackgroundAttributes &attributes)
 
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KChart::FrameAttributes &attributes)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Attributes inherited from KChart::AbstractLayoutItem
QWidgetmParent
 
QLayoutmParentLayout
 

Detailed Description

Cartesian coordinate plane.

Definition at line 25 of file KChartCartesianCoordinatePlane.h.

Constructor & Destructor Documentation

◆ CartesianCoordinatePlane()

CartesianCoordinatePlane::CartesianCoordinatePlane ( Chart * parent = nullptr)
explicit

Definition at line 55 of file KChartCartesianCoordinatePlane.cpp.

◆ ~CartesianCoordinatePlane()

CartesianCoordinatePlane::~CartesianCoordinatePlane ( )
override

Definition at line 61 of file KChartCartesianCoordinatePlane.cpp.

Member Function Documentation

◆ addDiagram()

void CartesianCoordinatePlane::addDiagram ( AbstractDiagram * diagram)
overridevirtual

Adds a diagram to this coordinate plane.

Parameters
diagramThe diagram to add.
See also
replaceDiagram, takeDiagram

Reimplemented from KChart::AbstractCoordinatePlane.

Reimplemented in KChart::LeveyJenningsCoordinatePlane.

Definition at line 72 of file KChartCartesianCoordinatePlane.cpp.

◆ adjustedToMaxEmptyInnerPercentage()

QRectF CartesianCoordinatePlane::adjustedToMaxEmptyInnerPercentage ( const QRectF & r,
unsigned int percentX,
unsigned int percentY ) const
protected

Definition at line 168 of file KChartCartesianCoordinatePlane.cpp.

◆ adjustHorizontalRangeToData

void CartesianCoordinatePlane::adjustHorizontalRangeToData ( )
slot

Adjust horizontal range settings to the ranges covered by the model's data values.

See also
adjustRangesToData

Definition at line 653 of file KChartCartesianCoordinatePlane.cpp.

◆ adjustRangesToData

void CartesianCoordinatePlane::adjustRangesToData ( )
slot

Adjust both, horizontal and vertical range settings to the ranges covered by the model's data values.

See also
setHorizontalRange, setVerticalRange
adjustHorizontalRangeToData, adjustVerticalRangeToData
setAutoAdjustHorizontalRangeToData, setAutoAdjustVerticalRangeToData

Definition at line 642 of file KChartCartesianCoordinatePlane.cpp.

◆ adjustVerticalRangeToData

void CartesianCoordinatePlane::adjustVerticalRangeToData ( )
slot

Adjust vertical range settings to the ranges covered by the model's data values.

See also
adjustRangesToData

Definition at line 662 of file KChartCartesianCoordinatePlane.cpp.

◆ autoAdjustGridToZoom()

bool CartesianCoordinatePlane::autoAdjustGridToZoom ( ) const

Return the status of the built-in grid adjusting feature.

See also
setAutoAdjustGridToZoom

Definition at line 763 of file KChartCartesianCoordinatePlane.cpp.

◆ autoAdjustHorizontalRangeToData()

unsigned int CartesianCoordinatePlane::autoAdjustHorizontalRangeToData ( ) const

Returns the maximal allowed percent of the horizontal space covered by the coordinate plane that may be empty.

Returns
A percent value indicating how much of the horizontal space may be empty. If more than this is empty, automatic range adjusting is applied. A return value of 100 indicates that no such automatic adjusting is done at all.
See also
setAutoAdjustHorizontalRangeToData, adjustRangesToData

Definition at line 695 of file KChartCartesianCoordinatePlane.cpp.

◆ autoAdjustVerticalRangeToData()

unsigned int CartesianCoordinatePlane::autoAdjustVerticalRangeToData ( ) const

Returns the maximal allowed percent of the vertical space covered by the coordinate plane that may be empty.

Returns
A percent value indicating how much of the vertical space may be empty. If more than this is empty, automatic range adjusting is applied. A return value of 100 indicates that no such automatic adjusting is done at all.
See also
setAutoAdjustVerticalRangeToData, adjustRangesToData

Definition at line 700 of file KChartCartesianCoordinatePlane.cpp.

◆ axesCalcModeX()

CartesianCoordinatePlane::AxesCalcMode CartesianCoordinatePlane::axesCalcModeX ( ) const

Definition at line 559 of file KChartCartesianCoordinatePlane.cpp.

◆ axesCalcModeY()

CartesianCoordinatePlane::AxesCalcMode CartesianCoordinatePlane::axesCalcModeY ( ) const

Definition at line 554 of file KChartCartesianCoordinatePlane.cpp.

◆ calculateRawDataBoundingRect()

QRectF CartesianCoordinatePlane::calculateRawDataBoundingRect ( ) const
protectedvirtual

Definition at line 209 of file KChartCartesianCoordinatePlane.cpp.

◆ diagramArea()

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),

diagramArea() == drawingArea()
QRectF diagramArea() const
Returns the (physical) area occupied by the diagram.

.

See also
setFixedDataCoordinateSpaceRelation
drawingArea

Definition at line 340 of file KChartCartesianCoordinatePlane.cpp.

◆ doesIsometricScaling()

bool CartesianCoordinatePlane::doesIsometricScaling ( ) const

Definition at line 465 of file KChartCartesianCoordinatePlane.cpp.

◆ doneSetZoomCenter()

bool CartesianCoordinatePlane::doneSetZoomCenter ( const QPointF & center)
protected

Definition at line 494 of file KChartCartesianCoordinatePlane.cpp.

◆ doneSetZoomFactorX()

bool CartesianCoordinatePlane::doneSetZoomFactorX ( qreal factor)
protected

Definition at line 470 of file KChartCartesianCoordinatePlane.cpp.

◆ doneSetZoomFactorY()

bool CartesianCoordinatePlane::doneSetZoomFactorY ( qreal factor)
protected

Definition at line 482 of file KChartCartesianCoordinatePlane.cpp.

◆ drawingArea()

QRectF CartesianCoordinatePlane::drawingArea ( ) const
protectedvirtual

Definition at line 307 of file KChartCartesianCoordinatePlane.cpp.

◆ expandingDirections()

Qt::Orientations CartesianCoordinatePlane::expandingDirections ( ) const
overridevirtual

pure virtual in QLayoutItem

Reimplemented from KChart::AbstractCoordinatePlane.

Definition at line 884 of file KChartCartesianCoordinatePlane.cpp.

◆ getDataDimensionsList()

DataDimensionsList CartesianCoordinatePlane::getDataDimensionsList ( ) const
overrideprotectedvirtual

◆ getRawDataBoundingRectFromDiagrams()

QRectF CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams ( ) const
protected

Definition at line 141 of file KChartCartesianCoordinatePlane.cpp.

◆ gridAttributes()

const GridAttributes CartesianCoordinatePlane::gridAttributes ( Qt::Orientation orientation) const
Returns
The attributes used for grid lines drawn in horizontal direction (or in vertical direction, resp.).
Note
This function always returns a valid set of grid attributes: If no special grid attributes were set foe this orientation the global attributes are returned, as returned by AbstractCoordinatePlane::globalGridAttributes.
See also
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 724 of file KChartCartesianCoordinatePlane.cpp.

◆ handleFixedDataCoordinateSpaceRelation()

void CartesianCoordinatePlane::handleFixedDataCoordinateSpaceRelation ( const QRectF & geometry)
protected

Definition at line 400 of file KChartCartesianCoordinatePlane.cpp.

◆ hasFixedDataCoordinateSpaceRelation()

bool CartesianCoordinatePlane::hasFixedDataCoordinateSpaceRelation ( ) const

Definition at line 382 of file KChartCartesianCoordinatePlane.cpp.

◆ hasHeightForWidth()

bool CartesianCoordinatePlane::hasHeightForWidth ( ) const
overrideprotectedvirtual

Reimplemented from QLayoutItem.

Definition at line 890 of file KChartCartesianCoordinatePlane.cpp.

◆ hasOwnGridAttributes()

bool CartesianCoordinatePlane::hasOwnGridAttributes ( Qt::Orientation orientation) const
Returns
Returns whether the grid attributes have been set for the respective direction via setGridAttributes( orientation ).

If false, the grid will use the global attributes set by AbstractCoordinatePlane::globalGridAttributes (or the default attributes, resp.)

See also
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes

Definition at line 745 of file KChartCartesianCoordinatePlane.cpp.

◆ heightForWidth()

int CartesianCoordinatePlane::heightForWidth ( int w) const
overrideprotectedvirtual

Reimplemented from QLayoutItem.

Definition at line 895 of file KChartCartesianCoordinatePlane.cpp.

◆ horizontalRange()

QPair< qreal, qreal > CartesianCoordinatePlane::horizontalRange ( ) const
Returns
The largest and smallest visible horizontal value space value. If this is not explicitly set,or if both values are the same, the plane will use the union of the dataBoundaries of all associated diagrams.
See also
KChart::AbstractDiagram::dataBoundaries

Definition at line 632 of file KChartCartesianCoordinatePlane.cpp.

◆ isHorizontalRangeReversed()

bool CartesianCoordinatePlane::isHorizontalRangeReversed ( ) const
Returns
Whether the horizontal range is reversed or not

Definition at line 825 of file KChartCartesianCoordinatePlane.cpp.

◆ isVerticalRangeReversed()

bool CartesianCoordinatePlane::isVerticalRangeReversed ( ) const
Returns
Whether the vertical range is reversed or not

Definition at line 840 of file KChartCartesianCoordinatePlane.cpp.

◆ layoutDiagrams()

void CartesianCoordinatePlane::layoutDiagrams ( )
overrideprotectedvirtual

Distribute the available space among the diagrams and axes.

Implements KChart::AbstractCoordinatePlane.

Definition at line 354 of file KChartCartesianCoordinatePlane.cpp.

◆ logicalArea()

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 319 of file KChartCartesianCoordinatePlane.cpp.

◆ paint()

void CartesianCoordinatePlane::paint ( QPainter * painter)
overridevirtual

reimpl

Implements KChart::AbstractLayoutItem.

Definition at line 85 of file KChartCartesianCoordinatePlane.cpp.

◆ resetGridAttributes()

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.

See also
setGridAttributes, gridAttributes
setAutoAdjustGridToZoom
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 718 of file KChartCartesianCoordinatePlane.cpp.

◆ setAutoAdjustGridToZoom()

void CartesianCoordinatePlane::setAutoAdjustGridToZoom ( bool autoAdjust)

Disable / re-enable the built-in grid adjusting feature.

By default additional lines will be drawn in a Linear grid when zooming in.

See also
autoAdjustGridToZoom, setGridAttributes

Definition at line 751 of file KChartCartesianCoordinatePlane.cpp.

◆ setAutoAdjustHorizontalRangeToData()

void CartesianCoordinatePlane::setAutoAdjustHorizontalRangeToData ( unsigned int percentEmpty = 67)

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.

Parameters
percentEmptyThe maximal percentage of horizontal space that may be empty.
See also
horizontalRangeAutomaticallyAdjusted
autoAdjustHorizontalRangeToData, adjustRangesToData
setHorizontalRange, setVerticalRange
setAutoAdjustVerticalRangeToData

Definition at line 671 of file KChartCartesianCoordinatePlane.cpp.

◆ setAutoAdjustVerticalRangeToData()

void CartesianCoordinatePlane::setAutoAdjustVerticalRangeToData ( unsigned int percentEmpty = 67)

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.

Parameters
percentEmptyThe maximal percentage of horizontal space that may be empty.
See also
verticalRangeAutomaticallyAdjusted
autoAdjustVerticalRangeToData, adjustRangesToData
setHorizontalRange, setVerticalRange
setAutoAdjustHorizontalRangeToData

Definition at line 683 of file KChartCartesianCoordinatePlane.cpp.

◆ setAxesCalcModes()

void CartesianCoordinatePlane::setAxesCalcModes ( AxesCalcMode mode)

Specifies the calculation modes for all axes.

Definition at line 564 of file KChartCartesianCoordinatePlane.cpp.

◆ setAxesCalcModeX()

void CartesianCoordinatePlane::setAxesCalcModeX ( AxesCalcMode mode)

Specifies the calculation mode for all Abscissa axes.

Definition at line 588 of file KChartCartesianCoordinatePlane.cpp.

◆ setAxesCalcModeY()

void CartesianCoordinatePlane::setAxesCalcModeY ( AxesCalcMode mode)

Specifies the calculation mode for all Ordinate axes.

Definition at line 578 of file KChartCartesianCoordinatePlane.cpp.

◆ setFixedDataCoordinateSpaceRelation()

void CartesianCoordinatePlane::setFixedDataCoordinateSpaceRelation ( bool fixed)

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 375 of file KChartCartesianCoordinatePlane.cpp.

◆ setGeometry()

void CartesianCoordinatePlane::setGeometry ( const QRect & r)
overridevirtual

reimplemented from AbstractCoordinatePlane

Reimplemented from KChart::AbstractCoordinatePlane.

Definition at line 857 of file KChartCartesianCoordinatePlane.cpp.

◆ setGridAttributes()

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:

GridAttributes ga = plane->gridAttributes( Qt::Horizontal );
ga.setGridVisible( false );
void setGridAttributes(Qt::Orientation orientation, const GridAttributes &)
Set the attributes to be used for grid lines drawn in horizontal direction (or in vertical direction,...
A set of attributes controlling the appearance of grids.
T qobject_cast(QObject *object)
Horizontal
Note
setGridAttributes overwrites the global attributes that were set by AbstractCoordinatePlane::setGlobalGridAttributes. To re-activate these global attributes you can call resetGridAttributes.
See also
resetGridAttributes, gridAttributes
setAutoAdjustGridToZoom
AbstractCoordinatePlane::setGlobalGridAttributes
hasOwnGridAttributes

Definition at line 705 of file KChartCartesianCoordinatePlane.cpp.

◆ setHorizontalRange()

void CartesianCoordinatePlane::setHorizontalRange ( const QPair< qreal, qreal > & range)

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.

Note
By default the visible data range often is larger than the range calculated from the data model (or set by setHoriz.|Vert.Range(), resp.). This is due to the built-in grid calculation feature: The visible start/end values get adjusted so that they match a main-grid line. You can turn this feature off for any of the four bounds by calling GridAttributes::setAdjustBoundsToGrid() for either the global grid-attributes or for the horizontal/vertical attrs separately.
To set only one of the ends of the range to a fixed value while keeping the other dynamically adjusted, use std::numeric_limits< qreal >::quiet_NaN() for the dynamic value.
If you use user defined vertical ranges together with logarithmic scale, only positive values are supported. If you set it to negative values, the result is undefined.
Parameters
rangea pair of values representing the smallest and the largest horizontal value space coordinate displayed.
See also
setAutoAdjustHorizontalRangeToData, setVerticalRange
GridAttributes::setAdjustBoundsToGrid()

Definition at line 608 of file KChartCartesianCoordinatePlane.cpp.

◆ setHorizontalRangeReversed()

void CartesianCoordinatePlane::setHorizontalRangeReversed ( bool reverse)

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.

Parameters
reverseWhether the horizontal range should be reversed or not

Definition at line 815 of file KChartCartesianCoordinatePlane.cpp.

◆ setIsometricScaling()

void CartesianCoordinatePlane::setIsometricScaling ( bool onOff)

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 456 of file KChartCartesianCoordinatePlane.cpp.

◆ setVerticalRange()

void CartesianCoordinatePlane::setVerticalRange ( const QPair< qreal, qreal > & range)

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.

Note
By default the visible data range often is larger than the range calculated from the data model (or set by setHoriz.|Vert.Range(), resp.). This is due to the built-in grid calculation feature: The visible start/end values get adjusted so that they match a main-grid line. You can turn this feature off for any of the four bounds by calling GridAttributes::setAdjustBoundsToGrid() for either the global grid-attributes or for the horizontal/vertical attrs separately.
To set only one of the ends of the range to a fixed value while keeping the other dynamically adjusted, use std::numeric_limits< qreal >::quiet_NaN() for the dynamic value.
If you use user defined vertical ranges together with logarithmic scale, only positive values are supported. If you set it to negative values, the result is undefined.
Parameters
rangea pair of values representing the smallest and the largest vertical value space coordinate displayed.
See also
setAutoAdjustVerticalRangeToData, setHorizontalRange
GridAttributes::setAdjustBoundsToGrid()

Definition at line 620 of file KChartCartesianCoordinatePlane.cpp.

◆ setVerticalRangeReversed()

void CartesianCoordinatePlane::setVerticalRangeReversed ( bool reverse)

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.

Parameters
reverseWhether the vertical range should be reversed or not

Definition at line 830 of file KChartCartesianCoordinatePlane.cpp.

◆ setXAxisStartAtZero()

void CartesianCoordinatePlane::setXAxisStartAtZero ( bool fixedStart)

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 KChart auto-adjust the ranges, or this method can be used to disable this behavior.

Definition at line 387 of file KChartCartesianCoordinatePlane.cpp.

◆ setZoomCenter()

void CartesianCoordinatePlane::setZoomCenter ( const QPointF & center)
overridevirtual

◆ setZoomFactors()

void CartesianCoordinatePlane::setZoomFactors ( qreal factorX,
qreal factorY )
overridevirtual

◆ setZoomFactorX()

void CartesianCoordinatePlane::setZoomFactorX ( qreal factor)
overridevirtual
See also
zoomFactorX, setZoomCenter

Reimplemented from KChart::AbstractCoordinatePlane.

Definition at line 514 of file KChartCartesianCoordinatePlane.cpp.

◆ setZoomFactorY()

void CartesianCoordinatePlane::setZoomFactorY ( qreal factor)
overridevirtual
See also
zoomFactorY, setZoomCenter

Reimplemented from KChart::AbstractCoordinatePlane.

Definition at line 522 of file KChartCartesianCoordinatePlane.cpp.

◆ sharedAxisMasterPlane()

AbstractCoordinatePlane * CartesianCoordinatePlane::sharedAxisMasterPlane ( QPainter * p = nullptr)
overridevirtual

reimpl

Reimplemented from KChart::AbstractCoordinatePlane.

Definition at line 768 of file KChartCartesianCoordinatePlane.cpp.

◆ sizeHint()

QSize CartesianCoordinatePlane::sizeHint ( ) const
overrideprotectedvirtual

pure virtual in QLayoutItem

Reimplemented from KChart::AbstractCoordinatePlane.

Definition at line 904 of file KChartCartesianCoordinatePlane.cpp.

◆ slotLayoutChanged

void CartesianCoordinatePlane::slotLayoutChanged ( KChart::AbstractDiagram * )
protectedslot

Definition at line 136 of file KChartCartesianCoordinatePlane.cpp.

◆ translate()

const QPointF CartesianCoordinatePlane::translate ( const QPointF & diagramPoint) const
overridevirtual

Translate the given point in value space coordinates to a position in pixel space.

Parameters
diagramPointThe point in value coordinates.
Returns
The translated point.

Implements KChart::AbstractCoordinatePlane.

Definition at line 442 of file KChartCartesianCoordinatePlane.cpp.

◆ translateBack()

const QPointF CartesianCoordinatePlane::translateBack ( const QPointF & screenPoint) const

Definition at line 451 of file KChartCartesianCoordinatePlane.cpp.

◆ verticalRange()

QPair< qreal, qreal > CartesianCoordinatePlane::verticalRange ( ) const
Returns
The largest and smallest visible horizontal value space value. If this is not explicitly set, or if both values are the same, the plane will use the union of the dataBoundaries of all associated diagrams.
See also
KChart::AbstractDiagram::dataBoundaries

Definition at line 637 of file KChartCartesianCoordinatePlane.cpp.

◆ visibleDataRange()

QRectF CartesianCoordinatePlane::visibleDataRange ( ) const

Returns the currently visible data range.

Might be greater than the range of the grid.

Definition at line 845 of file KChartCartesianCoordinatePlane.cpp.

◆ visibleDiagramArea()

QRectF CartesianCoordinatePlane::visibleDiagramArea ( ) const

Returns the visible part of the diagram area, i.e.

diagramArea().intersected( drawingArea() )
QRectF intersected(const QRectF &rectangle) const const
See also
diagramArea

Definition at line 349 of file KChartCartesianCoordinatePlane.cpp.

◆ xAxisStartAtZero()

bool CartesianCoordinatePlane::xAxisStartAtZero ( ) const

Definition at line 395 of file KChartCartesianCoordinatePlane.cpp.

◆ zoomCenter()

QPointF CartesianCoordinatePlane::zoomCenter ( ) const
overridevirtual

◆ zoomFactorX()

qreal CartesianCoordinatePlane::zoomFactorX ( ) const
overridevirtual

◆ zoomFactorY()

qreal CartesianCoordinatePlane::zoomFactorY ( ) const
overridevirtual

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:40:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.