KD Chart 2
[rev.2.7]
|
The class for ternary axes. More...
#include <KDChartTernaryAxis.h>
Public Slots | |
void | update () |
Signals | |
void | coordinateSystemChanged () |
void | positionChanged (AbstractArea *) |
Public Member Functions | |
void | alignToReferencePoint (const RelativePosition &position) |
BackgroundAttributes | backgroundAttributes () const |
virtual int | bottomOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint(). 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 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 |
Qt::Orientations | expandingDirections () const override |
FrameAttributes | frameAttributes () const |
QRect | geometry () const override |
void | getFrameLeadings (int &left, int &top, int &right, int &bottom) const |
bool | hasDefaultTitleTextAttributes () const |
bool | isEmpty () const override |
QStringList | labels () const |
Returns a list of strings, that are used as axis labels, as set via setLabels. More... | |
virtual int | leftOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More... | |
QSize | maximumSize () const override |
QSize | minimumSize () const override |
bool | observedBy (AbstractDiagram *diagram) const |
void | paint (QPainter *) override |
void | paintAll (QPainter &) 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 |
Default impl: Paint the complete item using its layouted position and size. 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 () |
QPair< QSizeF, QSizeF > | requiredMargins () const |
void | resetTitleTextAttributes () |
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 | setBackgroundAttributes (const BackgroundAttributes &a) |
void | setFrameAttributes (const FrameAttributes &a) |
void | setGeometry (const QRect &rect) override |
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 | setTitleText (const QString &text) |
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 |
virtual void | sizeHintChanged () const |
Report changed size hint: ask the parent widget to recalculate the layout. More... | |
TernaryAxis (AbstractTernaryDiagram *diagram=0) | |
TextAttributes | textAttributes () const |
Returns the text attributes to be used for axis labels. More... | |
QString | titleText () const |
TextAttributes | titleTextAttributes () const |
virtual int | topOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More... | |
~TernaryAxis () 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 | |
QWidget * | mParent |
QLayout * | mParentLayout |
The class for ternary axes.
Definition at line 40 of file KDChartTernaryAxis.h.
|
explicit |
Definition at line 43 of file KDChartTernaryAxis.cpp.
References KDChartEnums::PositionSouth, resetTitleTextAttributes(), setPosition(), and PrerenderedLabel::setText().
|
override |
Definition at line 56 of file KDChartTernaryAxis.cpp.
|
inherited |
Definition at line 81 of file KDChartAbstractAreaBase.cpp.
|
overrideprotectedvirtualinherited |
Implements KDChart::AbstractAreaBase.
Definition at line 151 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), KDChart::TernaryCoordinatePlane::layoutDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::TernaryCoordinatePlane::paint(), KDChart::CartesianAxis::paint(), KDChart::AbstractArea::paintAll(), and KDChart::CartesianAxis::paintCtx().
|
inherited |
Definition at line 111 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
|
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.
Definition at line 98 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
|
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().
|
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 KDChart::CartesianAxis::compare().
|
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.
Definition at line 178 of file KDChartAbstractAxis.cpp.
References KDChart::AbstractAxis::coordinateSystemChanged(), and d.
|
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().
|
signalinherited |
Referenced by KDChart::AbstractAxis::connectSignals().
|
inherited |
Definition at line 168 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::addAxis(), and KDChart::AbstractAxis::~AbstractAxis().
|
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.
label | The text of the label as KD Chart has calculated it automatically (or as it was taken from a QStringList provided by you, resp.) |
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.label
. Definition at line 162 of file KDChartAbstractAxis.cpp.
Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::CartesianAxis::paintCtx().
|
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().
|
inherited |
Definition at line 173 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::takeAxis(), and KDChart::AbstractCartesianDiagram::~AbstractCartesianDiagram().
|
inherited |
Definition at line 249 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::CartesianAxis::maximumSize(), KDChart::CartesianAxis::paint(), referenceDiagramIsBarDiagram(), referenceDiagramNeedsCenteredAbscissaTicks(), KDChart::CartesianAxis::titleSize(), KDChart::CartesianAxis::~CartesianAxis(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().
|
override |
Definition at line 123 of file KDChartTernaryAxis.cpp.
|
inherited |
Definition at line 97 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::Legend::clone(), KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
|
overridevirtual |
Implements KDChart::AbstractAxis.
Definition at line 97 of file KDChartTernaryAxis.cpp.
|
inherited |
Definition at line 213 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::AbstractAreaBase::innerRect(), and KDChart::AbstractAreaWidget::paintAll().
bool TernaryAxis::hasDefaultTitleTextAttributes | ( | ) | const |
Definition at line 194 of file KDChartTernaryAxis.cpp.
References AxisVector_B_A, AxisVector_B_C, AxisVector_C_A, KDChart::TextAttributes::font(), Norm_B_A, Norm_B_C, Norm_C_A, position(), KDChartEnums::PositionEast, KDChartEnums::PositionNorth, KDChartEnums::PositionSouth, KDChartEnums::PositionUnknown, KDChartEnums::PositionWest, RelMarkerLength, PrerenderedLabel::setAngle(), PrerenderedLabel::setFont(), PrerenderedElement::setPosition(), PrerenderedElement::setReferencePoint(), titleTextAttributes(), TriangleBottomLeft, TriangleBottomRight, and TriangleTop.
|
protectedinherited |
Definition at line 225 of file KDChartAbstractAreaBase.cpp.
References KDChart::AbstractAreaBase::areaGeometry(), and KDChart::AbstractAreaBase::getFrameLeadings().
Referenced by KDChart::AbstractArea::paintAll(), and KDChart::TextArea::paintAll().
|
override |
Definition at line 91 of file KDChartTernaryAxis.cpp.
|
inherited |
Returns a list of strings, that are used as axis labels, as set via setLabels.
Definition at line 223 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::AbstractAxis::compare(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), paintCtx(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().
|
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.
Definition at line 74 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
|
override |
Definition at line 113 of file KDChartTernaryAxis.cpp.
|
override |
Definition at line 107 of file KDChartTernaryAxis.cpp.
|
inherited |
Definition at line 254 of file KDChartAbstractAxis.cpp.
References d.
|
overridevirtual |
Implements KDChart::AbstractLayoutItem.
Definition at line 67 of file KDChartTernaryAxis.cpp.
|
overridevirtual |
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.
Reimplemented from KDChart::AbstractArea.
Definition at line 62 of file KDChartTernaryAxis.cpp.
|
virtualinherited |
Definition at line 189 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintBackgroundAttributes().
Referenced by KDChart::AbstractArea::paintAll(), KDChart::TextArea::paintAll(), and KDChart::AbstractAreaWidget::paintAll().
|
staticinherited |
Definition at line 118 of file KDChartAbstractAreaBase.cpp.
References KDChart::BackgroundAttributes::BackgroundPixmapModeCentered, KDChart::BackgroundAttributes::BackgroundPixmapModeNone, KDChart::BackgroundAttributes::BackgroundPixmapModeScaled, KDChart::BackgroundAttributes::BackgroundPixmapModeStretched, KDChart::BackgroundAttributes::brush(), KDChart::BackgroundAttributes::isVisible(), KDChart::BackgroundAttributes::pixmap(), and KDChart::BackgroundAttributes::pixmapMode().
Referenced by findSharingAxisDiagrams(), and KDChart::AbstractAreaBase::paintBackground().
|
overridevirtual |
Default impl: Paint the complete item using its layouted position and size.
Reimplemented from KDChart::AbstractLayoutItem.
Definition at line 72 of file KDChartTernaryAxis.cpp.
References KDChart::PaintContext::coordinatePlane(), KDChart::AbstractAxis::labels(), KDChart::PaintContext::painter(), PrerenderedLabel::pixmap(), PrerenderedElement::position(), PrerenderedLabel::referencePointLocation(), and KDChart::TernaryCoordinatePlane::translate().
|
virtualinherited |
Definition at line 205 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintFrameAttributes().
Referenced by KDChart::AbstractArea::paintAll(), KDChart::TextArea::paintAll(), and KDChart::AbstractAreaWidget::paintAll().
|
staticinherited |
Definition at line 168 of file KDChartAbstractAreaBase.cpp.
References KDChart::FrameAttributes::cornerRadius(), KDChart::FrameAttributes::isVisible(), KDChart::FrameAttributes::pen(), and KDChart::PrintingParameters::scalePen().
Referenced by findSharingAxisDiagrams(), and KDChart::AbstractAreaBase::paintFrame().
|
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().
|
inherited |
Definition at line 77 of file KDChartLayoutItems.h.
|
virtual |
Definition at line 128 of file KDChartTernaryAxis.cpp.
Referenced by hasDefaultTitleTextAttributes(), requiredMargins(), and setPosition().
|
signalinherited |
Referenced by KDChart::AbstractArea::positionHasChanged().
|
overrideprotectedvirtualinherited |
Reimplemented from KDChart::AbstractAreaBase.
Definition at line 156 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::positionChanged().
|
inherited |
Definition at line 81 of file KDChartLayoutItems.h.
Referenced by findSharingAxisDiagrams(), KDChart::Chart::takeCoordinatePlane(), and KDChart::Chart::takeHeaderFooter().
QPair< QSizeF, QSizeF > TernaryAxis::requiredMargins | ( | ) | const |
Definition at line 253 of file KDChartTernaryAxis.cpp.
References PrerenderedLabel::pixmap(), position(), KDChartEnums::PositionEast, KDChartEnums::PositionSouth, KDChartEnums::PositionWest, and PrerenderedLabel::referencePointLocation().
Referenced by KDChart::TernaryCoordinatePlane::layoutDiagrams().
void TernaryAxis::resetTitleTextAttributes | ( | ) |
Definition at line 187 of file KDChartTernaryAxis.cpp.
Referenced by TernaryAxis().
|
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.
Definition at line 82 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
|
inherited |
Returns the attributes to be used for painting the rulers.
Definition at line 209 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::CartesianAxis::paintCtx(), and KDChart::CartesianAxis::tickLength().
|
inherited |
Definition at line 102 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
|
inherited |
Definition at line 88 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
Referenced by KDChart::Legend::clone(), and KDChart::Legend::~Legend().
|
overridevirtual |
Implements KDChart::AbstractAxis.
Definition at line 102 of file KDChartTernaryAxis.cpp.
|
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.
Definition at line 214 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::LeveyJenningsAxis::paintAsAbscissa(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().
|
inherited |
Definition at line 73 of file KDChartLayoutItems.h.
Referenced by KDChart::Chart::addHeaderFooter(), findSharingAxisDiagrams(), and KDChart::Chart::takeHeaderFooter().
|
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().
|
virtual |
Definition at line 133 of file KDChartTernaryAxis.cpp.
References position(), KDChartEnums::PositionEast, KDChartEnums::PositionSouth, KDChartEnums::PositionWest, PrerenderedLabel::setText(), and KDChart::Position::value().
Referenced by TernaryAxis().
|
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.
Definition at line 203 of file KDChartAbstractAxis.cpp.
References d.
|
inherited |
Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.
By passing an empty QStringList you can reset the default behaviour.
Definition at line 228 of file KDChartAbstractAxis.cpp.
References d.
|
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.
Definition at line 188 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::LeveyJenningsAxis::setType().
void TernaryAxis::setTitleText | ( | const QString & | text | ) |
Definition at line 165 of file KDChartTernaryAxis.cpp.
References PrerenderedLabel::setText().
void TernaryAxis::setTitleTextAttributes | ( | const TextAttributes & | a | ) |
Definition at line 176 of file KDChartTernaryAxis.cpp.
|
inherited |
Returns a list of strings, that are used as axis labels, as set via setShortLabels.
Definition at line 237 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::AbstractAxis::compare().
|
override |
Definition at line 118 of file KDChartTernaryAxis.cpp.
|
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().
|
inherited |
Returns the text attributes to be used for axis labels.
Definition at line 197 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::AbstractAxis::compare(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), KDChart::CartesianAxis::paintCtx(), KDChart::LeveyJenningsAxis::setType(), and KDChart::CartesianAxis::titleTextAttributes().
QString TernaryAxis::titleText | ( | ) | const |
Definition at line 171 of file KDChartTernaryAxis.cpp.
References PrerenderedLabel::text().
TextAttributes TernaryAxis::titleTextAttributes | ( | ) | const |
Definition at line 182 of file KDChartTernaryAxis.cpp.
Referenced by hasDefaultTitleTextAttributes().
|
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.
Definition at line 90 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
|
slotinherited |
Definition at line 259 of file KDChartAbstractAxis.cpp.
References d.
|
protectedinherited |
|
protectedinherited |
Definition at line 92 of file KDChartLayoutItems.h.
Referenced by KDChart::AutoSpacerLayoutItem::paint().