KD Chart 2  [rev.2.5.1]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
KDChartCartesianAxis.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2013 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTCARTESIANAXIS_H
24 #define KDCHARTCARTESIANAXIS_H
25 
26 #include <QList>
27 
28 #include "KDChartAbstractAxis.h"
29 
30 namespace KDChart {
31 
32  class AbstractCartesianDiagram;
33 
42  class KDCHART_EXPORT CartesianAxis : public AbstractAxis
43  {
44  Q_OBJECT
45 
46  Q_DISABLE_COPY( CartesianAxis )
48 
49  public:
50  enum Position {
52  Top,
54  Left
55  };
56 
67  explicit CartesianAxis ( AbstractCartesianDiagram* diagram = 0 );
68  ~CartesianAxis();
69 
73  bool compare( const CartesianAxis* other ) const;
74 
76  virtual void paint( QPainter* );
78  virtual void paintCtx( PaintContext* );
79 
83  void setTitleText( const QString& text );
84  QString titleText() const;
85 
91  void setTitleSpace( qreal value );
92  qreal titleSpace() const;
93 
97  void setTitleSize(qreal value);
98  qreal titleSize() const;
99 
100  void setTitleTextAttributes( const TextAttributes &a );
108  TextAttributes titleTextAttributes() const;
115  void resetTitleTextAttributes();
116  bool hasDefaultTitleTextAttributes() const;
117 
118  virtual void setPosition ( Position p );
119 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
120  virtual const Position position () const;
121 #else
122  virtual Position position () const;
123 #endif
124 
125  virtual void layoutPlanes();
126 
127  virtual bool isAbscissa() const;
128  virtual bool isOrdinate() const;
129 
137  void setAnnotations( const QMap< qreal, QString >& annotations );
141  QMap< qreal, QString > annotations() const;
142 
147  void setCustomTicks( const QList< qreal >& ticksPostions );
151  QList< qreal > customTicks() const;
152 
156  void setCustomTickLength(int value);
160  int customTickLength() const;
161 
163  virtual bool isEmpty() const;
165  virtual Qt::Orientations expandingDirections() const;
167  virtual QSize maximumSize() const;
169  virtual QSize minimumSize() const;
171  virtual QSize sizeHint() const;
173  virtual void setGeometry( const QRect& r );
175  virtual QRect geometry() const;
176 
177  public Q_SLOTS:
178  void setCachedSizeDirty() const;
179 
180  virtual int tickLength( bool subUnitTicks = false ) const;
181  private Q_SLOTS:
182  void coordinateSystemChanged();
183  private:
184  friend class TickIterator;
185  };
186 
188 }
189 
190 #endif

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/