12 #include "KDChartAbstractAxis_p.h"
18 #include <KDABLibFakes>
33 AbstractAxis::Private::~Private()
39 bool AbstractAxis::Private::setDiagram(
AbstractDiagram *diagram_,
bool delayedInit)
47 if (diagram && ((diagram == mDiagram) || secondaryDiagrams.contains(diagram)))
50 bool bNewDiagramStored =
false;
56 const bool con = connect(observer, &DiagramObserver::diagramDataChanged,
57 mAxis, &AbstractAxis::coordinateSystemChanged);
60 bNewDiagramStored =
true;
66 secondaryDiagrams.enqueue(diagram);
68 return bNewDiagramStored;
73 if (diagram == mDiagram) {
78 secondaryDiagrams.removeAll(diagram);
80 if (!secondaryDiagrams.isEmpty()) {
82 setDiagram(nextDiagram);
88 return diagram == mDiagram || secondaryDiagrams.contains(diagram);
91 void AbstractAxis::Private::updateLayouts()
93 if (
auto *cartesianAxis = qobject_cast<CartesianAxis *>(mAxis)) {
94 cartesianAxis->layoutPlanes();
109 d->mDiagram =
nullptr;
110 d->secondaryDiagrams.clear();
113 void AbstractAxis::init()
116 d->textAttributes.setFontSize(m);
119 d->textAttributes.setMinimalFontSize(m);
129 d->setDiagram(
nullptr,
true );
171 if (
d->textAttributes == a)
174 d->textAttributes = a;
180 return d->textAttributes;
185 d->rulerAttributes = a;
191 return d->rulerAttributes;
196 if (
d->hardLabels == list)
199 d->hardLabels = list;
205 return d->hardLabels;
210 if (
d->hardShortLabels == list)
213 d->hardShortLabels = list;
219 return d->hardShortLabels;
225 return d->diagram()->coordinatePlane();
236 return d->hasDiagram(diagram);
242 d->diagram()->update();
Definition of global enums.
Declaring the class KDChart::Measure.
@ MeasureCalculationModeAbsolute
@ MeasureCalculationModeAuto
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background,...
An area in the chart with a background, a frame, etc.
RulerAttributes rulerAttributes() const
Returns the attributes to be used for painting the rulers.
virtual const QString customizedLabel(const QString &label) const
Reimplement this method if you want to adjust axis labels before they are printed.
const AbstractDiagram * diagram() const
bool observedBy(AbstractDiagram *diagram) const
void setLabels(const QStringList &list)
Use this to specify your own set of strings, to be used as axis labels.
void deleteObserver(AbstractDiagram *diagram)
void createObserver(AbstractDiagram *diagram)
void coordinateSystemChanged()
QStringList labels() const
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...
void setRulerAttributes(const RulerAttributes &a)
Use this to specify the attributes used to paint the axis ruler.
void setTextAttributes(const TextAttributes &a)
Use this to specify the text attributes to be used for axis labels.
bool compare(const AbstractAxis *other) const
TextAttributes textAttributes() const
Returns the text attributes to be used for axis labels.
QStringList shortLabels() const
const AbstractCoordinatePlane * coordinatePlane() const
Convenience function, returns the coordinate plane, in which this axis is used.
virtual void delayedInit()
virtual void connectSignals()
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
AbstractDiagram defines the interface for diagram classes.
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponding sig...
void diagramDataChanged(AbstractDiagram *diagram)
Measure is used to specify relative and absolute sizes in KDChart, e.g. font sizes.
A set of attributes controlling the appearance of axis rulers.
A set of text attributes.