KD Chart 2  [rev.2.7]
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KDChart::CartesianAxis Class Reference

The class for cartesian axes. More...

#include <KDChartCartesianAxis.h>

Inheritance diagram for KDChart::CartesianAxis:
Inheritance graph
[legend]
Collaboration diagram for KDChart::CartesianAxis:
Collaboration graph
[legend]

Public Types

enum  Position {
  Bottom,
  Top,
  Right,
  Left
}
 

Public Slots

void setCachedSizeDirty () const
 
virtual int tickLength (bool subUnitTicks=false) const
 
void update ()
 

Signals

void positionChanged (AbstractArea *)
 

Public Member Functions

void alignToReferencePoint (const RelativePosition &position)
 
QMap< qreal, QString > annotations () const
 Returns the currently set axis annotations. More...
 
BackgroundAttributes backgroundAttributes () const
 
virtual int bottomOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint(). More...
 
 CartesianAxis (AbstractCartesianDiagram *diagram=0)
 C'tor of the class for cartesian axes. More...
 
bool compare (const CartesianAxis *other) const
 Returns true if both axes have the same settings. More...
 
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings. More...
 
bool compare (const AbstractAxis *other) const
 Returns true if both axes have the same settings. More...
 
virtual void connectSignals ()
 Wireing the signal/slot connections. More...
 
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...
 
int customTickLength () const
 Returns the length of custom ticks on the axis. More...
 
QList< qreal > customTicks () const
 Returns the currently set custom ticks on the axis. More...
 
void deleteObserver (AbstractDiagram *diagram)
 
const AbstractDiagramdiagram () const
 
Qt::Orientations expandingDirections () const override
 pure virtual in QLayoutItem More...
 
FrameAttributes frameAttributes () const
 
QRect geometry () const override
 pure virtual in QLayoutItem More...
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
bool hasDefaultTitleTextAttributes () const
 
virtual bool isAbscissa () const
 
bool isEmpty () const override
 pure virtual in QLayoutItem More...
 
virtual bool isOrdinate () const
 
QStringList labels () const
 Returns a list of strings, that are used as axis labels, as set via setLabels. More...
 
virtual void layoutPlanes ()
 
virtual int leftOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
QSize maximumSize () const override
 pure virtual in QLayoutItem More...
 
QSize minimumSize () const override
 pure virtual in QLayoutItem More...
 
bool observedBy (AbstractDiagram *diagram) const
 
void paint (QPainter *) override
 reimpl More...
 
void paintAll (QPainter &painter) override
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. More...
 
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
 
void paintCtx (PaintContext *) override
 reimpl More...
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
QLayout * parentLayout ()
 
virtual const Position position () const
 
void removeFromParentLayout ()
 
void resetTitleTextAttributes ()
 Reset the title text attributes to the built-in default: More...
 
virtual int rightOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
RulerAttributes rulerAttributes () const
 Returns the attributes to be used for painting the rulers. More...
 
void setAnnotations (const QMap< qreal, QString > &annotations)
 Sets the axis annotations to annotations. More...
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setCustomTickLength (int value)
 Sets the length of custom ticks on the axis. More...
 
void setCustomTicks (const QList< qreal > &ticksPostions)
 Sets custom ticks on the axis. More...
 
void setFrameAttributes (const FrameAttributes &a)
 
void setGeometry (const QRect &r) override
 pure virtual in QLayoutItem More...
 
void setLabels (const QStringList &list)
 Use this to specify your own set of strings, to be used as axis labels. More...
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed. More...
 
virtual void setPosition (Position p)
 
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...
 
void setTitleSize (qreal value)
 use setTitleTextAttributes() instead More...
 
void setTitleSpace (qreal value)
 
void setTitleText (const QString &text)
 Sets the optional text displayed as chart title. More...
 
void setTitleTextAttributes (const TextAttributes &a)
 
QStringList shortLabels () const
 Returns a list of strings, that are used as axis labels, as set via setShortLabels. More...
 
QSize sizeHint () const override
 pure virtual in QLayoutItem More...
 
virtual void sizeHintChanged () const
 Report changed size hint: ask the parent widget to recalculate the layout. More...
 
TextAttributes textAttributes () const
 Returns the text attributes to be used for axis labels. More...
 
qreal titleSize () const
 
qreal titleSpace () const
 
QString titleText () const
 
TextAttributes titleTextAttributes () const
 Returns the text attributes that will be used for displaying the title text. More...
 
virtual int topOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
 ~CartesianAxis () override
 

Static Public Member Functions

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

virtual void delayedInit ()
 called for initializing after the c'tor has completed More...
 

Protected Member Functions

QRect areaGeometry () const override
 
QRect innerRect () const
 
void positionHasChanged () override
 

Protected Attributes

QWidgetmParent
 
QLayout * mParentLayout
 

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 42 of file KDChartCartesianAxis.h.

Member Enumeration Documentation

Enumerator
Bottom 
Top 
Right 
Left 

Definition at line 50 of file KDChartCartesianAxis.h.

Constructor & Destructor Documentation

CartesianAxis::CartesianAxis ( AbstractCartesianDiagram diagram = 0)
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 381 of file KDChartCartesianAxis.cpp.

CartesianAxis::~CartesianAxis ( )
override

Member Function Documentation

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position)
inherited

Definition at line 81 of file KDChartAbstractAreaBase.cpp.

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

Returns the currently set axis annotations.

Definition at line 1129 of file KDChartCartesianAxis.cpp.

References d.

Referenced by setAnnotations().

QRect AbstractArea::areaGeometry ( ) const
overrideprotectedvirtualinherited
BackgroundAttributes AbstractAreaBase::backgroundAttributes ( ) const
inherited

Definition at line 111 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().

int AbstractArea::bottomOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the bottom edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 98 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

bool CartesianAxis::compare ( const CartesianAxis other) const

Returns true if both axes have the same settings.

Definition at line 410 of file KDChartCartesianAxis.cpp.

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

bool AbstractAreaBase::compare ( const AbstractAreaBase other) const
inherited

Returns true if both areas have the same settings.

Definition at line 71 of file KDChartAbstractAreaBase.cpp.

References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().

Referenced by KDChart::Legend::compare().

bool AbstractAxis::compare ( const AbstractAxis other) const
inherited

Returns true if both axes have the same settings.

Definition at line 146 of file KDChartAbstractAxis.cpp.

References KDChart::AbstractAxis::labels(), KDChart::AbstractAxis::shortLabels(), and KDChart::AbstractAxis::textAttributes().

Referenced by KDChart::AbstractCartesianDiagram::compare(), and compare().

void AbstractAxis::connectSignals ( )
virtualinherited

Wireing the signal/slot connections.

This method gets called automatically, each time, when you assign the axis to a diagram, either by passing a diagram* to the c'tor, or by calling the diagram's setAxis method, resp.

If overwriting this method in derived classes, make sure to call this base method AbstractAxis::connectSignals(), so your axis gets connected to the diagram's built-in signals.

See also
AbstractCartesianDiagram::addAxis()

Definition at line 178 of file KDChartAbstractAxis.cpp.

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

const AbstractCoordinatePlane * AbstractAxis::coordinatePlane ( ) const
inherited

Convenience function, returns the coordinate plane, in which this axis is used.

If the axis is not used in a coordinate plane, the return value is Zero.

Definition at line 242 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().

void AbstractAxis::createObserver ( AbstractDiagram diagram)
inherited
const QString AbstractAxis::customizedLabel ( const QString &  label) const
virtualinherited

Reimplement this method if you want to adjust axis labels before they are printed.

KD Chart is calling this method immediately before drawing the text, this means: What you return here will be drawn without further modifications.

Parameters
labelThe text of the label as KD Chart has calculated it automatically (or as it was taken from a QStringList provided by you, resp.)
Note
If you reimplement this method in a subclass of KDChartCartesianAxis, and your reimplementation's return value depends on data other than label (so KDChart will not know when it changes), you must manually ensure that layouts are adapted to any changed sizes of the axis labels. To do that, call KDChartCartesianAxis::layoutPlanes() from your reimplementation when you know that the external data changed and it will change label sizes - or when you cannot exclude that.
Returns
The text to be drawn. By default this is the same as label.

Definition at line 162 of file KDChartAbstractAxis.cpp.

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

int CartesianAxis::customTickLength ( ) const

Returns the length of custom ticks on the axis.

Definition at line 1118 of file KDChartCartesianAxis.cpp.

References d.

Referenced by maximumSize().

QList< qreal > CartesianAxis::customTicks ( ) const

Returns the currently set custom ticks on the axis.

Definition at line 1144 of file KDChartCartesianAxis.cpp.

References d.

void AbstractAxis::delayedInit ( )
protectedvirtualslotinherited

called for initializing after the c'tor has completed

Definition at line 138 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::AbstractAxis::AbstractAxis().

void AbstractAxis::deleteObserver ( AbstractDiagram diagram)
inherited
const AbstractDiagram * KDChart::AbstractAxis::diagram ( ) const
inherited
Qt::Orientations CartesianAxis::expandingDirections ( ) const
override

pure virtual in QLayoutItem

Definition at line 934 of file KDChartCartesianAxis.cpp.

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

FrameAttributes AbstractAreaBase::frameAttributes ( ) const
inherited
QRect CartesianAxis::geometry ( ) const
overridevirtual
void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const
inherited
bool CartesianAxis::hasDefaultTitleTextAttributes ( ) const

Definition at line 467 of file KDChartCartesianAxis.cpp.

References d.

Referenced by titleTextAttributes().

QRect AbstractAreaBase::innerRect ( ) const
protectedinherited
bool CartesianAxis::isAbscissa ( ) const
virtual
bool CartesianAxis::isEmpty ( ) const
override

pure virtual in QLayoutItem

Definition at line 928 of file KDChartCartesianAxis.cpp.

Referenced by paintCtx().

bool CartesianAxis::isOrdinate ( ) const
virtual
QStringList AbstractAxis::labels ( ) const
inherited

Returns a list of strings, that are used as axis labels, as set via setLabels.

See also
setLabels

Definition at line 223 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::AbstractAxis::compare(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), KDChart::TernaryAxis::paintCtx(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().

void CartesianAxis::layoutPlanes ( )
virtual
int AbstractArea::leftOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the left edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 74 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

QSize CartesianAxis::maximumSize ( ) const
override
QSize CartesianAxis::minimumSize ( ) const
override

pure virtual in QLayoutItem

Definition at line 1082 of file KDChartCartesianAxis.cpp.

References maximumSize().

bool KDChart::AbstractAxis::observedBy ( AbstractDiagram diagram) const
inherited

Definition at line 254 of file KDChartAbstractAxis.cpp.

References d.

void CartesianAxis::paint ( QPainter *  painter)
overridevirtual
void AbstractArea::paintAll ( QPainter &  painter)
overridevirtualinherited

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.

Reimplemented from KDChart::AbstractLayoutItem.

Reimplemented in KDChart::TernaryAxis.

Definition at line 120 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::areaGeometry(), d, KDChart::AbstractAreaBase::innerRect(), KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and KDChart::AbstractAreaBase::paintFrame().

Referenced by KDChart::AbstractArea::paintIntoRect().

void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
)
staticinherited
void CartesianAxis::paintCtx ( PaintContext context)
overridevirtual

reimpl

Reimplemented from KDChart::AbstractLayoutItem.

Reimplemented in KDChart::LeveyJenningsAxis.

Definition at line 656 of file KDChartCartesianAxis.cpp.

References KDChart::AbstractArea::areaGeometry(), KDChart::TextAttributes::autoRotate(), Bottom, KDChart::TextLayoutItem::boundingPolygon(), KDChart::PaintContext::coordinatePlane(), KDChart::AbstractAxis::customizedLabel(), d, KDChart::DataDimension::end, geometry(), KDChart::RulerAttributes::hasTickMarkPenAt(), KDChart::TextLayoutItem::intersects(), isAbscissa(), isEmpty(), KDChart::TextAttributes::isVisible(), KDChart::RulerAttributes::labelMargin(), Left, KDChart::RulerAttributes::majorTickMarkPen(), KDChart::TextLayoutItem::marginWidth(), KDChartEnums::MeasureOrientationMinimum, KDChart::RulerAttributes::minorTickMarkPen(), KDChart::TextLayoutItem::paint(), KDChart::PaintContext::painter(), position(), KDChart::TextLayoutItem::realFont(), referenceDiagramNeedsCenteredAbscissaTicks(), Right, KDChart::TextAttributes::rotation(), KDChart::AbstractAxis::rulerAttributes(), KDChart::TextLayoutItem::setGeometry(), KDChart::TextAttributes::setRotation(), KDChart::TextLayoutItem::setText(), KDChart::TextLayoutItem::setTextAttributes(), KDChart::RulerAttributes::showFirstTick(), KDChart::RulerAttributes::showRulerLine(), KDChart::TextLayoutItem::sizeHint(), KDChart::DataDimension::start, KDChart::AbstractAxis::textAttributes(), tickLength(), KDChart::RulerAttributes::tickMarkPen(), titleText(), and Top.

Referenced by paint(), and KDChart::LeveyJenningsAxis::paintAsAbscissa().

void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
)
staticinherited
void AbstractArea::paintIntoRect ( QPainter &  painter,
const QRect &  rect 
)
virtualinherited

Draws the background and frame, then calls paint().

In most cases there is no need to overwrite this method in a derived class, but you would overwrite AbstractLayoutItem::paint() instead.

Definition at line 108 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::paintAll().

QLayout* KDChart::AbstractLayoutItem::parentLayout ( )
inherited

Definition at line 77 of file KDChartLayoutItems.h.

const CartesianAxis::Position CartesianAxis::position ( ) const
virtual
void KDChart::AbstractArea::positionChanged ( AbstractArea )
signalinherited
void AbstractArea::positionHasChanged ( )
overrideprotectedvirtualinherited

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 156 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::positionChanged().

void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inherited
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 460 of file KDChartCartesianAxis.cpp.

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

int AbstractArea::rightOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the right edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 82 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

RulerAttributes AbstractAxis::rulerAttributes ( ) const
inherited

Returns the attributes to be used for painting the rulers.

See also
setRulerAttributes

Definition at line 209 of file KDChartAbstractAxis.cpp.

References d.

Referenced by paintCtx(), and tickLength().

void CartesianAxis::setAnnotations ( const QMap< 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 1134 of file KDChartCartesianAxis.cpp.

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

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a)
inherited
void CartesianAxis::setCachedSizeDirty ( ) const
slot
void CartesianAxis::setCustomTickLength ( int  value)

Sets the length of custom ticks on the axis.

Definition at line 1108 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 1149 of file KDChartCartesianAxis.cpp.

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

void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a)
inherited
void CartesianAxis::setGeometry ( const QRect &  r)
overridevirtual

pure virtual in QLayoutItem

Implements KDChart::AbstractAxis.

Definition at line 1094 of file KDChartCartesianAxis.cpp.

References d, and setCachedSizeDirty().

void AbstractAxis::setLabels ( const QStringList &  list)
inherited

Use this to specify your own set of strings, to be used as axis labels.

Labels specified via setLabels take precedence: If a non-empty list is passed, KD Chart will use these strings as axis labels, instead of calculating them.

If you pass a smaller number of strings than the number of labels drawn at this axis, KD Chart will repeat the strings until all labels are drawn. As an example you could specify the seven days of the week as abscissa labels, which would be repeatedly used then.

By passing an empty QStringList you can reset the default behaviour.

See also
labels, setShortLabels

Definition at line 214 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::paintAsAbscissa(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().

void KDChart::AbstractLayoutItem::setParentLayout ( QLayout *  lay)
inherited
void KDChart::AbstractLayoutItem::setParentWidget ( QWidget widget)
virtualinherited

Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed.

Thus, you need to call setParentWidget on every item, that has a non-fixed size.

Definition at line 59 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::HeaderFooter::setParent(), KDChart::AbstractCartesianDiagram::takeAxis(), and updateToplevelLayout().

void CartesianAxis::setPosition ( Position  p)
virtual

Definition at line 472 of file KDChartCartesianAxis.cpp.

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

void AbstractAxis::setRulerAttributes ( const RulerAttributes a)
inherited

Use this to specify the attributes used to paint the axis ruler.

Every axis has a default set of ruler attributes that is exactly the same among them. Use this method to specify your own attributes.

See also
rulerAttributes

Definition at line 203 of file KDChartAbstractAxis.cpp.

References d.

void AbstractAxis::setShortLabels ( const QStringList &  list)
inherited

Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.

Note
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via setLabels too!

By passing an empty QStringList you can reset the default behaviour.

See also
shortLabels, setLabels

Definition at line 228 of file KDChartAbstractAxis.cpp.

References d.

void AbstractAxis::setTextAttributes ( const TextAttributes a)
inherited

Use this to specify the text attributes to be used for axis labels.

By default, the reference area will be set at painting time. It will be the then-valid coordinate plane's parent widget, so normally, it will be the KDChart::Chart. Thus the labels of all of your axes in all of your diagrams within that Chart will be drawn in same font size, by default.

See also
textAttributes, setLabels

Definition at line 188 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::LeveyJenningsAxis::setType().

void CartesianAxis::setTitleSize ( qreal  value)

use setTitleTextAttributes() instead

Deprecated:

Definition at line 600 of file KDChartCartesianAxis.cpp.

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 590 of file KDChartCartesianAxis.cpp.

References d.

void CartesianAxis::setTitleText ( const QString &  text)

Sets the optional text displayed as chart title.

Definition at line 428 of file KDChartCartesianAxis.cpp.

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

void CartesianAxis::setTitleTextAttributes ( const TextAttributes a)

Definition at line 440 of file KDChartCartesianAxis.cpp.

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

QStringList AbstractAxis::shortLabels ( ) const
inherited

Returns a list of strings, that are used as axis labels, as set via setShortLabels.

Note
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via setLabels too!
See also
setShortLabels

Definition at line 237 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::AbstractAxis::compare().

QSize CartesianAxis::sizeHint ( ) const
override

pure virtual in QLayoutItem

Definition at line 1088 of file KDChartCartesianAxis.cpp.

References maximumSize().

void KDChart::AbstractLayoutItem::sizeHintChanged ( ) const
virtualinherited

Report changed size hint: ask the parent widget to recalculate the layout.

Definition at line 81 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::TextLayoutItem::sizeHint().

TextAttributes AbstractAxis::textAttributes ( ) const
inherited
int CartesianAxis::tickLength ( bool  subUnitTicks = false) const
virtualslot
qreal CartesianAxis::titleSize ( ) const
qreal CartesianAxis::titleSpace ( ) const
Deprecated:

Definition at line 595 of file KDChartCartesianAxis.cpp.

References d.

QString CartesianAxis::titleText ( ) const

Definition at line 435 of file KDChartCartesianAxis.cpp.

References d.

Referenced by compare(), maximumSize(), paintCtx(), and titleSize().

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 448 of file KDChartCartesianAxis.cpp.

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

Referenced by compare(), and paint().

int AbstractArea::topOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the top edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 90 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

void KDChart::AbstractAxis::update ( )
slotinherited

Definition at line 259 of file KDChartAbstractAxis.cpp.

References d.

Member Data Documentation

QWidget* KDChart::AbstractLayoutItem::mParent
protectedinherited
QLayout* KDChart::AbstractLayoutItem::mParentLayout
protectedinherited

Definition at line 92 of file KDChartLayoutItems.h.

Referenced by KDChart::AutoSpacerLayoutItem::paint().


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

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/