KD Chart 2  [rev.2.7]
KDChartCartesianAxis.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 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() override;
69 
73  bool compare( const CartesianAxis* other ) const;
74 
76  void paint( QPainter* ) override;
78  void paintCtx( PaintContext* ) override;
79 
83  void setTitleText( const QString& text );
84  QString titleText() const;
85 
92  void setTitleSpace( qreal value );
94  qreal titleSpace() const;
95 
97  void setTitleSize(qreal value);
99  qreal titleSize() const;
100 
101  void setTitleTextAttributes( const TextAttributes &a );
109  TextAttributes titleTextAttributes() const;
116  void resetTitleTextAttributes();
117  bool hasDefaultTitleTextAttributes() const;
118 
119  virtual void setPosition ( Position p );
120 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
121  virtual const Position position () const;
122 #else
123  virtual Position position () const;
124 #endif
125 
126  virtual void layoutPlanes();
127 
128  virtual bool isAbscissa() const;
129  virtual bool isOrdinate() const;
130 
138  void setAnnotations( const QMap< qreal, QString >& annotations );
142  QMap< qreal, QString > annotations() const;
143 
148  void setCustomTicks( const QList< qreal >& ticksPostions );
152  QList< qreal > customTicks() const;
153 
157  void setCustomTickLength(int value);
161  int customTickLength() const;
162 
164  bool isEmpty() const override;
166  Qt::Orientations expandingDirections() const override;
168  QSize maximumSize() const override;
170  QSize minimumSize() const override;
172  QSize sizeHint() const override;
174  void setGeometry( const QRect& r ) override;
176  QRect geometry() const override;
177 
178  public Q_SLOTS:
179  void setCachedSizeDirty() const;
180 
181  virtual int tickLength( bool subUnitTicks = false ) const;
182  private Q_SLOTS:
183  void coordinateSystemChanged();
184  };
185 
187 }
188 
189 #endif
The base class for axes.
AbstractDiagram defines the interface for diagram classes.
The class for cartesian axes.
Base class for diagrams based on a cartesian coordianate system.
Stores information about painting diagrams.
QList< CartesianAxis * > CartesianAxisList
A set of text attributes.
#define KDCHART_DECLARE_PRIVATE_DERIVED_PARENT(X, ParentType)
Definition: KDChartGlobal.h:58

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