KD Chart API Documentation  3.1
Public Types | Public Slots | Public Member Functions | List of all members
KDChart::CartesianAxis Class Reference

#include <KDChartCartesianAxis.h>

Inheritance diagram for KDChart::CartesianAxis:
KDChart::AbstractAxis KDChart::AbstractArea KDChart::AbstractAreaBase KDChart::AbstractLayoutItem KDChart::LeveyJenningsAxis

Public Types

enum  Position { Bottom , Top , Right , Left }
 

Public Slots

void setCachedSizeDirty () const
 
virtual int tickLength (bool subUnitTicks=false) const
 
- Public Slots inherited from KDChart::AbstractAxis
void update ()
 

Public Member Functions

 CartesianAxis (AbstractCartesianDiagram *diagram=nullptr)
 
 ~CartesianAxis () override
 
QMultiMap< qreal, QString > annotations () const
 
bool compare (const CartesianAxis *other) const
 
int customTickLength () const
 
QList< qreal > customTicks () const
 
Qt::Orientations expandingDirections () const override
 
QRect geometry () const override
 
bool hasDefaultTitleTextAttributes () const
 
virtual bool isAbscissa () const
 
bool isEmpty () const override
 
virtual bool isOrdinate () const
 
virtual void layoutPlanes ()
 
QSize maximumSize () const override
 
QSize minimumSize () const override
 
void paint (QPainter *) override
 
void paintCtx (PaintContext *) override
 
virtual Position position () const
 
void resetTitleTextAttributes ()
 
void setAnnotations (const QMultiMap< qreal, QString > &annotations)
 
void setCustomTickLength (int value)
 
void setCustomTicks (const QList< qreal > &ticksPostions)
 
void setGeometry (const QRect &r) override
 
virtual void setPosition (Position p)
 
Q_DECL_DEPRECATED void setTitleSize (qreal value)
 use setTitleTextAttributes() instead More...
 
Q_DECL_DEPRECATED void setTitleSpace (qreal value)
 
void setTitleText (const QString &text)
 
void setTitleTextAttributes (const TextAttributes &a)
 
QSize sizeHint () const override
 
Q_DECL_DEPRECATED qreal titleSize () const
 
Q_DECL_DEPRECATED qreal titleSpace () const
 
QString titleText () const
 
TextAttributes titleTextAttributes () const
 
- Public Member Functions inherited from KDChart::AbstractAxis
 AbstractAxis (AbstractDiagram *diagram=nullptr)
 
 ~AbstractAxis () override
 
bool compare (const AbstractAxis *other) const
 
virtual void connectSignals ()
 
const AbstractCoordinatePlanecoordinatePlane () const
 Convenience function, returns the coordinate plane, in which this axis is used. More...
 
void createObserver (AbstractDiagram *diagram)
 
virtual const QString customizedLabel (const QString &label) const
 Reimplement this method if you want to adjust axis labels before they are printed. More...
 
void deleteObserver (AbstractDiagram *diagram)
 
const AbstractDiagramdiagram () const
 
QStringList labels () const
 
bool observedBy (AbstractDiagram *diagram) const
 
RulerAttributes rulerAttributes () const
 Returns the attributes to be used for painting the rulers. More...
 
void setLabels (const QStringList &list)
 Use this to specify your own set of strings, to be used as axis labels. More...
 
void setRulerAttributes (const RulerAttributes &a)
 Use this to specify the attributes used to paint the axis ruler. More...
 
void setShortLabels (const QStringList &list)
 Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long. More...
 
void setTextAttributes (const TextAttributes &a)
 Use this to specify the text attributes to be used for axis labels. More...
 
QStringList shortLabels () const
 
TextAttributes textAttributes () const
 Returns the text attributes to be used for axis labels. More...
 
- Public Member Functions inherited from KDChart::AbstractArea
 ~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
 
- Public Member Functions inherited from KDChart::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 KDChart::AbstractLayoutItem
 AbstractLayoutItem (Qt::Alignment itemAlignment={})
 
QLayout * parentLayout ()
 
void removeFromParentLayout ()
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 
virtual void sizeHintChanged () const
 

Additional Inherited Members

- Signals inherited from KDChart::AbstractAxis
void coordinateSystemChanged ()
 
- Signals inherited from KDChart::AbstractArea
void positionChanged (AbstractArea *)
 
- Static Public Member Functions inherited from KDChart::AbstractAreaBase
static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes)
 
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes)
 
- Protected Slots inherited from KDChart::AbstractAxis
virtual void delayedInit ()
 
- Protected Member Functions inherited from KDChart::AbstractArea
 AbstractArea ()
 
QRect areaGeometry () const override
 
void positionHasChanged () override
 
- Protected Member Functions inherited from KDChart::AbstractAreaBase
 AbstractAreaBase ()
 
virtual ~AbstractAreaBase ()
 
QRect innerRect () const
 
- Protected Attributes inherited from KDChart::AbstractLayoutItem
QWidget * mParent = nullptr
 
QLayout * mParentLayout = nullptr
 

Detailed Description

The class for cartesian axes.

For being useful, axes need to be assigned to a diagram, see AbstractCartesianDiagram::addAxis and AbstractCartesianDiagram::takeAxis.

See also
PolarAxis, AbstractCartesianDiagram

Definition at line 30 of file KDChartCartesianAxis.h.

Member Enumeration Documentation

◆ Position

Enumerator
Bottom 
Top 
Right 
Left 

Definition at line 38 of file KDChartCartesianAxis.h.

Constructor & Destructor Documentation

◆ CartesianAxis()

CartesianAxis::CartesianAxis ( AbstractCartesianDiagram diagram = nullptr)
explicit

C'tor of the class for cartesian axes.

Note
If you pass a null parent to the constructor, you need to call your diagram's addAxis function to add your axis to the diagram. Otherwise there is no need to call addAxis, since the constructor does it already.
See also
AbstractCartesianDiagram::addAxis

Definition at line 370 of file KDChartCartesianAxis.cpp.

◆ ~CartesianAxis()

CartesianAxis::~CartesianAxis ( )
override

Definition at line 376 of file KDChartCartesianAxis.cpp.

References d, and KDChart::AbstractAxis::diagram().

Member Function Documentation

◆ annotations()

QMultiMap< qreal, QString > CartesianAxis::annotations ( ) const

Returns the currently set axis annotations.

Definition at line 1114 of file KDChartCartesianAxis.cpp.

References d.

Referenced by setAnnotations().

◆ compare()

bool CartesianAxis::compare ( const CartesianAxis other) const

Returns true if both axes have the same settings.

Definition at line 398 of file KDChartCartesianAxis.cpp.

References KDChart::AbstractAxis::compare(), position(), titleText(), and titleTextAttributes().

◆ customTickLength()

int CartesianAxis::customTickLength ( ) const

Returns the length of custom ticks on the axis.

Definition at line 1103 of file KDChartCartesianAxis.cpp.

References d.

◆ customTicks()

QList< qreal > CartesianAxis::customTicks ( ) const

Returns the currently set custom ticks on the axis.

Definition at line 1129 of file KDChartCartesianAxis.cpp.

References d.

◆ expandingDirections()

Qt::Orientations CartesianAxis::expandingDirections ( ) const
override

pure virtual in QLayoutItem

Definition at line 922 of file KDChartCartesianAxis.cpp.

References Bottom, Left, position(), Right, and Top.

◆ geometry()

QRect CartesianAxis::geometry ( ) const
overridevirtual

pure virtual in QLayoutItem

Implements KDChart::AbstractAxis.

Definition at line 1088 of file KDChartCartesianAxis.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), and paintCtx().

◆ hasDefaultTitleTextAttributes()

bool CartesianAxis::hasDefaultTitleTextAttributes ( ) const

Definition at line 453 of file KDChartCartesianAxis.cpp.

References d.

Referenced by titleTextAttributes().

◆ isAbscissa()

bool CartesianAxis::isAbscissa ( ) const
virtual

◆ isEmpty()

bool CartesianAxis::isEmpty ( ) const
override

pure virtual in QLayoutItem

Definition at line 916 of file KDChartCartesianAxis.cpp.

Referenced by paintCtx().

◆ isOrdinate()

bool CartesianAxis::isOrdinate ( ) const
virtual

◆ layoutPlanes()

void CartesianAxis::layoutPlanes ( )
virtual

◆ maximumSize()

QSize CartesianAxis::maximumSize ( ) const
override

pure virtual in QLayoutItem

Definition at line 947 of file KDChartCartesianAxis.cpp.

References d.

Referenced by minimumSize(), and sizeHint().

◆ minimumSize()

QSize CartesianAxis::minimumSize ( ) const
override

pure virtual in QLayoutItem

Definition at line 1067 of file KDChartCartesianAxis.cpp.

References maximumSize().

◆ paint()

void CartesianAxis::paint ( QPainter *  painter)
overridevirtual

◆ paintCtx()

void CartesianAxis::paintCtx ( PaintContext context)
overridevirtual

◆ position()

CartesianAxis::Position CartesianAxis::position ( ) const
virtual

◆ resetTitleTextAttributes()

void CartesianAxis::resetTitleTextAttributes ( )

Reset the title text attributes to the built-in default:

Same font and pen as AbstractAxis::textAttributes() and 1.5 times their size.

Definition at line 446 of file KDChartCartesianAxis.cpp.

References d, layoutPlanes(), and setCachedSizeDirty().

◆ setAnnotations()

void CartesianAxis::setAnnotations ( const QMultiMap< qreal, QString > &  annotations)

Sets the axis annotations to annotations. Annotations are a QMap of qreals and QStrings defining special markers and their position. If you use annotations, the normal ticks and values will be invisible. To unset the annotations, pass an empty QMap.

Definition at line 1119 of file KDChartCartesianAxis.cpp.

References annotations(), d, layoutPlanes(), and setCachedSizeDirty().

◆ setCachedSizeDirty

void CartesianAxis::setCachedSizeDirty ( ) const
slot

◆ setCustomTickLength()

void CartesianAxis::setCustomTickLength ( int  value)

Sets the length of custom ticks on the axis.

Definition at line 1093 of file KDChartCartesianAxis.cpp.

References d, layoutPlanes(), and setCachedSizeDirty().

◆ setCustomTicks()

void CartesianAxis::setCustomTicks ( const QList< qreal > &  ticksPostions)

Sets custom ticks on the axis. Ticks are a QList of qreals defining their special position.

Definition at line 1134 of file KDChartCartesianAxis.cpp.

References d, layoutPlanes(), and setCachedSizeDirty().

◆ setGeometry()

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

pure virtual in QLayoutItem

Implements KDChart::AbstractAxis.

Definition at line 1079 of file KDChartCartesianAxis.cpp.

References d, and setCachedSizeDirty().

◆ setPosition()

void CartesianAxis::setPosition ( Position  p)
virtual

Definition at line 458 of file KDChartCartesianAxis.cpp.

References d, layoutPlanes(), and setCachedSizeDirty().

◆ setTitleSize()

void CartesianAxis::setTitleSize ( qreal  value)

use setTitleTextAttributes() instead

Deprecated:

Definition at line 585 of file KDChartCartesianAxis.cpp.

◆ setTitleSpace()

void CartesianAxis::setTitleSpace ( qreal  value)
Deprecated:
Sets the spacing between the title and the diagram. Be aware that setting this value can lead to collisions between axis labels and the title

Definition at line 575 of file KDChartCartesianAxis.cpp.

References d.

◆ setTitleText()

void CartesianAxis::setTitleText ( const QString &  text)

Sets the optional text displayed as chart title.

Definition at line 414 of file KDChartCartesianAxis.cpp.

References d, layoutPlanes(), and setCachedSizeDirty().

◆ setTitleTextAttributes()

void CartesianAxis::setTitleTextAttributes ( const TextAttributes a)

Definition at line 426 of file KDChartCartesianAxis.cpp.

References d, layoutPlanes(), and setCachedSizeDirty().

◆ sizeHint()

QSize CartesianAxis::sizeHint ( ) const
override

pure virtual in QLayoutItem

Definition at line 1073 of file KDChartCartesianAxis.cpp.

References maximumSize().

◆ tickLength

int CartesianAxis::tickLength ( bool  subUnitTicks = false) const
virtualslot

◆ titleSize()

qreal CartesianAxis::titleSize ( ) const
Deprecated:

Definition at line 591 of file KDChartCartesianAxis.cpp.

◆ titleSpace()

qreal CartesianAxis::titleSpace ( ) const
Deprecated:

Definition at line 580 of file KDChartCartesianAxis.cpp.

References d.

◆ titleText()

QString CartesianAxis::titleText ( ) const

Definition at line 421 of file KDChartCartesianAxis.cpp.

References d.

Referenced by compare(), and paintCtx().

◆ titleTextAttributes()

TextAttributes CartesianAxis::titleTextAttributes ( ) const

Returns the text attributes that will be used for displaying the title text. This is either the text attributes as specified by setTitleTextAttributes, or (if setTitleTextAttributes() was not called) the default text attributes.

See also
resetTitleTextAttributes, hasDefaultTitleTextAttributes

Definition at line 434 of file KDChartCartesianAxis.cpp.

References d, KDChart::TextAttributes::fontSize(), hasDefaultTitleTextAttributes(), KDChart::TextAttributes::setFontSize(), KDChart::Measure::setValue(), KDChart::AbstractAxis::textAttributes(), and KDChart::Measure::value().

Referenced by compare().


The documentation for this class was generated from the following files:

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated by doxygen 1.9.1