 |
KD Chart 2
[rev.2.8]
|
Go to the documentation of this file.
24 #include "KDChartAbstractAxis_p.h"
30 #include <KDABLibFakes>
45 AbstractAxis::Private::~Private()
51 bool AbstractAxis::Private::setDiagram(
AbstractDiagram* diagram_,
bool delayedInit )
60 ((diagram == mDiagram) || secondaryDiagrams.contains( diagram )) )
63 bool bNewDiagramStored =
false;
69 const bool con = connect( observer, SIGNAL( diagramDataChanged(
AbstractDiagram *) ),
70 mAxis, SIGNAL( coordinateSystemChanged() ) );
73 bNewDiagramStored =
true;
79 secondaryDiagrams.enqueue( diagram );
81 return bNewDiagramStored;
86 if ( diagram == mDiagram ) {
91 secondaryDiagrams.removeAll( diagram );
93 if ( !secondaryDiagrams.isEmpty() ) {
95 setDiagram( nextDiagram );
99 bool AbstractAxis::Private::hasDiagram(
AbstractDiagram* diagram )
const
101 return diagram == mDiagram || secondaryDiagrams.contains( diagram );
104 void AbstractAxis::Private::updateLayouts()
106 if (
CartesianAxis* cartesianAxis = qobject_cast< CartesianAxis* >( mAxis ) ) {
107 cartesianAxis->layoutPlanes();
123 d->secondaryDiagrams.clear();
127 void AbstractAxis::init()
130 d->textAttributes.setFontSize( m );
133 d->textAttributes.setMinimalFontSize( m );
143 d->setDiagram( 0,
true );
148 if ( other ==
this ) {
181 const bool con = connect(
d->observer, SIGNAL( diagramDataChanged(
AbstractDiagram *) ),
190 if (
d->textAttributes == a )
193 d->textAttributes = a;
199 return d->textAttributes;
205 d->rulerAttributes = a;
211 return d->rulerAttributes;
216 if (
d->hardLabels == list )
219 d->hardLabels = list;
225 return d->hardLabels;
230 if (
d->hardShortLabels == list )
233 d->hardShortLabels = list;
239 return d->hardShortLabels;
245 return d->diagram()->coordinatePlane();
256 return d->hasDiagram( diagram );
262 d->diagram()->update();
A DiagramObserver watches the associated diagram for changes and deletion and emits corresponsing sig...
void setRulerAttributes(const RulerAttributes &a)
Use this to specify the attributes used to paint the axis ruler.
void coordinateSystemChanged()
@ MeasureCalculationModeAuto
void setTextAttributes(const TextAttributes &a)
Use this to specify the text attributes to be used for axis labels.
The class for cartesian axes.
QStringList shortLabels() const
Returns a list of strings, that are used as axis labels, as set via setShortLabels.
Base class for AbstractArea and AbstractAreaWidget: An area in the chart with a background,...
virtual void connectSignals()
Wireing the signal/slot connections.
void deleteObserver(AbstractDiagram *diagram)
A set of text attributes.
Measure is used to specify relative and absolute sizes in KDChart, e.g.
void setLabels(const QStringList &list)
Use this to specify your own set of strings, to be used as axis labels.
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...
QStringList labels() const
Returns a list of strings, that are used as axis labels, as set via setLabels.
A set of attributes controlling the appearance of axis rulers.
Definition of global enums.
const AbstractCoordinatePlane * coordinatePlane() const
Convenience function, returns the coordinate plane, in which this axis is used.
@ MeasureCalculationModeAbsolute
AbstractDiagram defines the interface for diagram classes.
bool observedBy(AbstractDiagram *diagram) const
virtual const QString customizedLabel(const QString &label) const
Reimplement this method if you want to adjust axis labels before they are printed.
virtual void delayedInit()
called for initializing after the c'tor has completed
An area in the chart with a background, a frame, etc.
void createObserver(AbstractDiagram *diagram)
const AbstractDiagram * diagram() const
Declaring the class KDChart::Measure.
bool compare(const AbstractAxis *other) const
Returns true if both axes have the same settings.
RulerAttributes rulerAttributes() const
Returns the attributes to be used for painting the rulers.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
TextAttributes textAttributes() const
Returns the text attributes to be used for axis labels.