![]() |
KD Chart API Documentation
3.1
|
#include <KDChartCartesianAxis.h>
Public Types | |
enum | Position { Bottom , Top , Right , Left } |
Public Slots | |
void | setCachedSizeDirty () const |
virtual int | tickLength (bool subUnitTicks=false) const |
![]() | |
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 |
![]() | |
AbstractAxis (AbstractDiagram *diagram=nullptr) | |
~AbstractAxis () override | |
bool | compare (const AbstractAxis *other) const |
virtual void | connectSignals () |
const AbstractCoordinatePlane * | coordinatePlane () 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 AbstractDiagram * | diagram () 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... | |
![]() | |
~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={}) | |
QLayout * | parentLayout () |
void | removeFromParentLayout () |
void | setParentLayout (QLayout *lay) |
virtual void | setParentWidget (QWidget *widget) |
virtual void | sizeHintChanged () const |
Additional Inherited Members | |
![]() | |
void | coordinateSystemChanged () |
![]() | |
void | positionChanged (AbstractArea *) |
![]() | |
static void | paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes) |
static void | paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes) |
![]() | |
virtual void | delayedInit () |
![]() | |
AbstractArea () | |
QRect | areaGeometry () const override |
void | positionHasChanged () override |
![]() | |
AbstractAreaBase () | |
virtual | ~AbstractAreaBase () |
QRect | innerRect () const |
![]() | |
QWidget * | mParent = nullptr |
QLayout * | mParentLayout = nullptr |
The class for cartesian axes.
For being useful, axes need to be assigned to a diagram, see AbstractCartesianDiagram::addAxis and AbstractCartesianDiagram::takeAxis.
Definition at line 30 of file KDChartCartesianAxis.h.
Enumerator | |
---|---|
Bottom | |
Top | |
Right | |
Left |
Definition at line 38 of file KDChartCartesianAxis.h.
|
explicit |
C'tor of the class for cartesian axes.
Definition at line 370 of file KDChartCartesianAxis.cpp.
|
override |
Definition at line 376 of file KDChartCartesianAxis.cpp.
References d, and KDChart::AbstractAxis::diagram().
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().
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().
int CartesianAxis::customTickLength | ( | ) | const |
Returns the length of custom ticks on the axis.
Definition at line 1103 of file KDChartCartesianAxis.cpp.
References d.
QList< qreal > CartesianAxis::customTicks | ( | ) | const |
Returns the currently set custom ticks on the axis.
Definition at line 1129 of file KDChartCartesianAxis.cpp.
References d.
|
override |
pure virtual in QLayoutItem
Definition at line 922 of file KDChartCartesianAxis.cpp.
References Bottom, Left, position(), Right, and Top.
|
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().
bool CartesianAxis::hasDefaultTitleTextAttributes | ( | ) | const |
Definition at line 453 of file KDChartCartesianAxis.cpp.
References d.
Referenced by titleTextAttributes().
|
virtual |
Definition at line 515 of file KDChartCartesianAxis.cpp.
References Bottom, d, Left, position(), referenceDiagramIsBarDiagram(), Right, and Top.
Referenced by isOrdinate(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), paintCtx(), and KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().
|
override |
pure virtual in QLayoutItem
Definition at line 916 of file KDChartCartesianAxis.cpp.
Referenced by paintCtx().
|
virtual |
Definition at line 523 of file KDChartCartesianAxis.cpp.
References isAbscissa().
Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate(), KDChart::LeveyJenningsAxis::paintCtx(), and KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().
|
virtual |
Definition at line 480 of file KDChartCartesianAxis.cpp.
References d, and KDChart::AbstractCoordinatePlane::layoutPlanes().
Referenced by resetTitleTextAttributes(), setAnnotations(), setCustomTickLength(), setCustomTicks(), setPosition(), setTitleText(), and setTitleTextAttributes().
|
override |
pure virtual in QLayoutItem
Definition at line 947 of file KDChartCartesianAxis.cpp.
References d.
Referenced by minimumSize(), and sizeHint().
|
override |
pure virtual in QLayoutItem
Definition at line 1067 of file KDChartCartesianAxis.cpp.
References maximumSize().
|
overridevirtual |
reimp
Implements KDChart::AbstractLayoutItem.
Definition at line 528 of file KDChartCartesianAxis.cpp.
References KDChart::AbstractArea::areaGeometry(), d, paintCtx(), KDChart::PaintContext::setCoordinatePlane(), KDChart::PaintContext::setPainter(), KDChart::PaintContext::setRectangle(), KDChart::AbstractCoordinatePlane::zoomFactorX(), and KDChart::AbstractCoordinatePlane::zoomFactorY().
|
overridevirtual |
reimp
Reimplemented from KDChart::AbstractLayoutItem.
Reimplemented in KDChart::LeveyJenningsAxis.
Definition at line 641 of file KDChartCartesianAxis.cpp.
References KDChart::AbstractArea::areaGeometry(), KDChart::TextAttributes::autoRotate(), Bottom, KDChart::PaintContext::coordinatePlane(), KDChart::AbstractAxis::customizedLabel(), d, KDChart::DataDimension::end, geometry(), KDChart::AbstractCoordinatePlane::gridDimensionsList(), KDChart::RulerAttributes::hasTickMarkPenAt(), isAbscissa(), isEmpty(), KDChart::TextAttributes::isVisible(), KDChart::RulerAttributes::labelMargin(), Left, KDChart::RulerAttributes::majorTickMarkPen(), KDChartEnums::MeasureOrientationMinimum, KDChart::RulerAttributes::minorTickMarkPen(), KDChart::PaintContext::painter(), KDChart::AbstractCoordinatePlane::parent(), position(), referenceDiagramNeedsCenteredAbscissaTicks(), Right, KDChart::TextAttributes::rotation(), KDChart::AbstractAxis::rulerAttributes(), KDChart::TextAttributes::setRotation(), KDChart::RulerAttributes::showFirstTick(), KDChart::DataDimension::start, KDChart::AbstractAxis::textAttributes(), tickLength(), KDChart::RulerAttributes::tickMarkPen(), titleText(), Top, and KDChart::CartesianCoordinatePlane::translate().
Referenced by paint(), and KDChart::LeveyJenningsAxis::paintAsAbscissa().
|
virtual |
Definition at line 475 of file KDChartCartesianAxis.cpp.
References d.
Referenced by compare(), expandingDirections(), isAbscissa(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), and paintCtx().
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().
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().
|
slot |
Definition at line 941 of file KDChartCartesianAxis.cpp.
References d.
Referenced by resetTitleTextAttributes(), setAnnotations(), setCustomTickLength(), setCustomTicks(), setGeometry(), setPosition(), setTitleText(), and setTitleTextAttributes().
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().
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().
|
overridevirtual |
pure virtual in QLayoutItem
Implements KDChart::AbstractAxis.
Definition at line 1079 of file KDChartCartesianAxis.cpp.
References d, and setCachedSizeDirty().
|
virtual |
Definition at line 458 of file KDChartCartesianAxis.cpp.
References d, layoutPlanes(), and setCachedSizeDirty().
void CartesianAxis::setTitleSize | ( | qreal | value | ) |
use setTitleTextAttributes() instead
Definition at line 585 of file KDChartCartesianAxis.cpp.
void CartesianAxis::setTitleSpace | ( | qreal | value | ) |
Definition at line 575 of file KDChartCartesianAxis.cpp.
References d.
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().
void CartesianAxis::setTitleTextAttributes | ( | const TextAttributes & | a | ) |
Definition at line 426 of file KDChartCartesianAxis.cpp.
References d, layoutPlanes(), and setCachedSizeDirty().
|
override |
pure virtual in QLayoutItem
Definition at line 1073 of file KDChartCartesianAxis.cpp.
References maximumSize().
|
virtualslot |
Definition at line 1108 of file KDChartCartesianAxis.cpp.
References KDChart::RulerAttributes::majorTickMarkLength(), KDChart::RulerAttributes::minorTickMarkLength(), and KDChart::AbstractAxis::rulerAttributes().
Referenced by paintCtx().
qreal CartesianAxis::titleSize | ( | ) | const |
Definition at line 591 of file KDChartCartesianAxis.cpp.
qreal CartesianAxis::titleSpace | ( | ) | const |
QString CartesianAxis::titleText | ( | ) | const |
Definition at line 421 of file KDChartCartesianAxis.cpp.
References d.
Referenced by compare(), and paintCtx().
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.
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().