Main Page · Class Overview · Hierarchy · All Classes
axis.h
1 /***************************************************************************
2 ** **
3 ** QCustomPlot, an easy to use, modern plotting widget for Qt **
4 ** Copyright (C) 2011, 2012, 2013, 2014 Emanuel Eichhammer **
5 ** **
6 ** This program is free software: you can redistribute it and/or modify **
7 ** it under the terms of the GNU General Public License as published by **
8 ** the Free Software Foundation, either version 3 of the License, or **
9 ** (at your option) any later version. **
10 ** **
11 ** This program is distributed in the hope that it will be useful, **
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
14 ** GNU General Public License for more details. **
15 ** **
16 ** You should have received a copy of the GNU General Public License **
17 ** along with this program. If not, see http://www.gnu.org/licenses/. **
18 ** **
19 ****************************************************************************
20 ** Author: Emanuel Eichhammer **
21 ** Website/Contact: http://www.qcustomplot.com/ **
22 ** Date: 27.12.14 **
23 ** Version: 1.3.0 **
24 ****************************************************************************/
25 
26 #ifndef QCP_AXIS_H
27 #define QCP_AXIS_H
28 
29 #include "global.h"
30 #include "range.h"
31 #include "layer.h"
32 #include "layout.h"
33 #include "lineending.h"
34 
35 class QCPPainter;
36 class QCustomPlot;
37 class QCPAxis;
38 class QCPAxisRect;
39 class QCPAxisPainterPrivate;
41 class QCPGraph;
42 class QCPAbstractItem;
43 
44 class QCP_LIB_DECL QCPGrid :public QCPLayerable
45 {
46  Q_OBJECT
48  Q_PROPERTY(bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
49  Q_PROPERTY(bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
50  Q_PROPERTY(bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
51  Q_PROPERTY(QPen pen READ pen WRITE setPen)
52  Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
53  Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
55 public:
56  QCPGrid(QCPAxis *parentAxis);
57 
58  // getters:
59  bool subGridVisible() const { return mSubGridVisible; }
60  bool antialiasedSubGrid() const { return mAntialiasedSubGrid; }
61  bool antialiasedZeroLine() const { return mAntialiasedZeroLine; }
62  QPen pen() const { return mPen; }
63  QPen subGridPen() const { return mSubGridPen; }
64  QPen zeroLinePen() const { return mZeroLinePen; }
65 
66  // setters:
67  void setSubGridVisible(bool visible);
68  void setAntialiasedSubGrid(bool enabled);
69  void setAntialiasedZeroLine(bool enabled);
70  void setPen(const QPen &pen);
71  void setSubGridPen(const QPen &pen);
72  void setZeroLinePen(const QPen &pen);
73 
74 protected:
75  // property members:
76  bool mSubGridVisible;
77  bool mAntialiasedSubGrid, mAntialiasedZeroLine;
78  QPen mPen, mSubGridPen, mZeroLinePen;
79  // non-property members:
80  QCPAxis *mParentAxis;
81 
82  // reimplemented virtual methods:
83  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
84  virtual void draw(QCPPainter *painter);
85 
86  // non-virtual methods:
87  void drawGridLines(QCPPainter *painter) const;
88  void drawSubGridLines(QCPPainter *painter) const;
89 
90  friend class QCPAxis;
91 };
92 
93 
94 class QCP_LIB_DECL QCPAxis : public QCPLayerable
95 {
96  Q_OBJECT
98  Q_PROPERTY(AxisType axisType READ axisType)
99  Q_PROPERTY(QCPAxisRect* axisRect READ axisRect)
100  Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
101  Q_PROPERTY(double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
102  Q_PROPERTY(QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
103  Q_PROPERTY(bool rangeReversed READ rangeReversed WRITE setRangeReversed)
104  Q_PROPERTY(bool autoTicks READ autoTicks WRITE setAutoTicks)
105  Q_PROPERTY(int autoTickCount READ autoTickCount WRITE setAutoTickCount)
106  Q_PROPERTY(bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
107  Q_PROPERTY(bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
108  Q_PROPERTY(bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
109  Q_PROPERTY(bool ticks READ ticks WRITE setTicks)
110  Q_PROPERTY(bool tickLabels READ tickLabels WRITE setTickLabels)
111  Q_PROPERTY(int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
112  Q_PROPERTY(LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
113  Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
114  Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
115  Q_PROPERTY(double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
116  Q_PROPERTY(LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
117  Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
118  Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec)
119  Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
120  Q_PROPERTY(int numberPrecision READ numberPrecision WRITE setNumberPrecision)
121  Q_PROPERTY(double tickStep READ tickStep WRITE setTickStep)
122  Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
123  Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels)
124  Q_PROPERTY(int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
125  Q_PROPERTY(int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
126  Q_PROPERTY(int subTickCount READ subTickCount WRITE setSubTickCount)
127  Q_PROPERTY(int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
128  Q_PROPERTY(int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
129  Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
130  Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
131  Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
132  Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
133  Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
134  Q_PROPERTY(QString label READ label WRITE setLabel)
135  Q_PROPERTY(int labelPadding READ labelPadding WRITE setLabelPadding)
136  Q_PROPERTY(int padding READ padding WRITE setPadding)
137  Q_PROPERTY(int offset READ offset WRITE setOffset)
138  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
139  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
140  Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
141  Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
142  Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
143  Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
144  Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
145  Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
146  Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
147  Q_PROPERTY(QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
148  Q_PROPERTY(QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
149  Q_PROPERTY(QCPGrid* grid READ grid)
151 public:
156  enum AxisType { atLeft = 0x01
157  ,atRight = 0x02
158  ,atTop = 0x04
159  ,atBottom = 0x08
160  };
161  Q_FLAGS(AxisType AxisTypes)
162  Q_DECLARE_FLAGS(AxisTypes, AxisType)
169  enum LabelType { ltNumber
170  ,ltDateTime
171  };
172  Q_ENUMS(LabelType)
178  enum LabelSide { lsInside
179  ,lsOutside
180  };
181  Q_ENUMS(LabelSide)
186  enum ScaleType { stLinear
187  ,stLogarithmic
188  };
189  Q_ENUMS(ScaleType)
194  enum SelectablePart { spNone = 0
195  ,spAxis = 0x001
196  ,spTickLabels = 0x002
197  ,spAxisLabel = 0x004
198  };
199  Q_FLAGS(SelectablePart SelectableParts)
200  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
201 
202  explicit QCPAxis(QCPAxisRect *parent, AxisType type);
203  virtual ~QCPAxis();
204 
205  // getters:
206  AxisType axisType() const { return mAxisType; }
207  QCPAxisRect *axisRect() const { return mAxisRect; }
208  ScaleType scaleType() const { return mScaleType; }
209  double scaleLogBase() const { return mScaleLogBase; }
210  const QCPRange range() const { return mRange; }
211  bool rangeReversed() const { return mRangeReversed; }
212  bool autoTicks() const { return mAutoTicks; }
213  int autoTickCount() const { return mAutoTickCount; }
214  bool autoTickLabels() const { return mAutoTickLabels; }
215  bool autoTickStep() const { return mAutoTickStep; }
216  bool autoSubTicks() const { return mAutoSubTicks; }
217  bool ticks() const { return mTicks; }
218  bool tickLabels() const { return mTickLabels; }
219  int tickLabelPadding() const;
220  LabelType tickLabelType() const { return mTickLabelType; }
221  QFont tickLabelFont() const { return mTickLabelFont; }
222  QColor tickLabelColor() const { return mTickLabelColor; }
223  double tickLabelRotation() const;
224  LabelSide tickLabelSide() const;
225  QString dateTimeFormat() const { return mDateTimeFormat; }
226  Qt::TimeSpec dateTimeSpec() const { return mDateTimeSpec; }
227  QString numberFormat() const;
228  int numberPrecision() const { return mNumberPrecision; }
229  double tickStep() const { return mTickStep; }
230  QVector<double> tickVector() const { return mTickVector; }
231  QVector<QString> tickVectorLabels() const { return mTickVectorLabels; }
232  int tickLengthIn() const;
233  int tickLengthOut() const;
234  int subTickCount() const { return mSubTickCount; }
235  int subTickLengthIn() const;
236  int subTickLengthOut() const;
237  QPen basePen() const { return mBasePen; }
238  QPen tickPen() const { return mTickPen; }
239  QPen subTickPen() const { return mSubTickPen; }
240  QFont labelFont() const { return mLabelFont; }
241  QColor labelColor() const { return mLabelColor; }
242  QString label() const { return mLabel; }
243  int labelPadding() const;
244  int padding() const { return mPadding; }
245  int offset() const;
246  SelectableParts selectedParts() const { return mSelectedParts; }
247  SelectableParts selectableParts() const { return mSelectableParts; }
248  QFont selectedTickLabelFont() const { return mSelectedTickLabelFont; }
249  QFont selectedLabelFont() const { return mSelectedLabelFont; }
250  QColor selectedTickLabelColor() const { return mSelectedTickLabelColor; }
251  QColor selectedLabelColor() const { return mSelectedLabelColor; }
252  QPen selectedBasePen() const { return mSelectedBasePen; }
253  QPen selectedTickPen() const { return mSelectedTickPen; }
254  QPen selectedSubTickPen() const { return mSelectedSubTickPen; }
255  QCPLineEnding lowerEnding() const;
256  QCPLineEnding upperEnding() const;
257  QCPGrid *grid() const { return mGrid; }
258 
259  // setters:
260  Q_SLOT void setScaleType(QCPAxis::ScaleType type);
261  void setScaleLogBase(double base);
262  Q_SLOT void setRange(const QCPRange &range);
263  void setRange(double lower, double upper);
264  void setRange(double position, double size, Qt::AlignmentFlag alignment);
265  void setRangeLower(double lower);
266  void setRangeUpper(double upper);
267  void setRangeReversed(bool reversed);
268  void setAutoTicks(bool on);
269  void setAutoTickCount(int approximateCount);
270  void setAutoTickLabels(bool on);
271  void setAutoTickStep(bool on);
272  void setAutoSubTicks(bool on);
273  void setTicks(bool show);
274  void setTickLabels(bool show);
275  void setTickLabelPadding(int padding);
276  void setTickLabelType(LabelType type);
277  void setTickLabelFont(const QFont &font);
278  void setTickLabelColor(const QColor &color);
279  void setTickLabelRotation(double degrees);
280  void setTickLabelSide(LabelSide side);
281  void setDateTimeFormat(const QString &format);
282  void setDateTimeSpec(const Qt::TimeSpec &timeSpec);
283  void setNumberFormat(const QString &formatCode);
284  void setNumberPrecision(int precision);
285  void setTickStep(double step);
286  void setTickVector(const QVector<double> &vec);
287  void setTickVectorLabels(const QVector<QString> &vec);
288  void setTickLength(int inside, int outside=0);
289  void setTickLengthIn(int inside);
290  void setTickLengthOut(int outside);
291  void setSubTickCount(int count);
292  void setSubTickLength(int inside, int outside=0);
293  void setSubTickLengthIn(int inside);
294  void setSubTickLengthOut(int outside);
295  void setBasePen(const QPen &pen);
296  void setTickPen(const QPen &pen);
297  void setSubTickPen(const QPen &pen);
298  void setLabelFont(const QFont &font);
299  void setLabelColor(const QColor &color);
300  void setLabel(const QString &str);
301  void setLabelPadding(int padding);
302  void setPadding(int padding);
303  void setOffset(int offset);
304  void setSelectedTickLabelFont(const QFont &font);
305  void setSelectedLabelFont(const QFont &font);
306  void setSelectedTickLabelColor(const QColor &color);
307  void setSelectedLabelColor(const QColor &color);
308  void setSelectedBasePen(const QPen &pen);
309  void setSelectedTickPen(const QPen &pen);
310  void setSelectedSubTickPen(const QPen &pen);
311  Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts);
312  Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts);
313  void setLowerEnding(const QCPLineEnding &ending);
314  void setUpperEnding(const QCPLineEnding &ending);
315 
316  // reimplemented virtual methods:
317  virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
318 
319  // non-property methods:
320  Qt::Orientation orientation() const { return mOrientation; }
321  void moveRange(double diff);
322  void scaleRange(double factor, double center);
323  void setScaleRatio(const QCPAxis *otherAxis, double ratio=1.0);
324  void rescale(bool onlyVisiblePlottables=false);
325  double pixelToCoord(double value) const;
326  double coordToPixel(double value) const;
327  SelectablePart getPartAt(const QPointF &pos) const;
328  QList<QCPAbstractPlottable*> plottables() const;
329  QList<QCPGraph*> graphs() const;
330  QList<QCPAbstractItem*> items() const;
331 
332  static AxisType marginSideToAxisType(QCP::MarginSide side);
333  static Qt::Orientation orientation(AxisType type) { return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
334  static AxisType opposite(AxisType type);
335 
336 signals:
337  void ticksRequest();
338  void rangeChanged(const QCPRange &newRange);
339  void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange);
340  void scaleTypeChanged(QCPAxis::ScaleType scaleType);
341  void selectionChanged(const QCPAxis::SelectableParts &parts);
342  void selectableChanged(const QCPAxis::SelectableParts &parts);
343 
344 protected:
345  // property members:
346  // axis base:
347  AxisType mAxisType;
348  QCPAxisRect *mAxisRect;
349  //int mOffset; // in QCPAxisPainter
350  int mPadding;
351  Qt::Orientation mOrientation;
352  SelectableParts mSelectableParts, mSelectedParts;
353  QPen mBasePen, mSelectedBasePen;
354  //QCPLineEnding mLowerEnding, mUpperEnding; // in QCPAxisPainter
355  // axis label:
356  //int mLabelPadding; // in QCPAxisPainter
357  QString mLabel;
358  QFont mLabelFont, mSelectedLabelFont;
359  QColor mLabelColor, mSelectedLabelColor;
360  // tick labels:
361  //int mTickLabelPadding; // in QCPAxisPainter
362  bool mTickLabels, mAutoTickLabels;
363  //double mTickLabelRotation; // in QCPAxisPainter
364  LabelType mTickLabelType;
365  QFont mTickLabelFont, mSelectedTickLabelFont;
366  QColor mTickLabelColor, mSelectedTickLabelColor;
367  QString mDateTimeFormat;
368  Qt::TimeSpec mDateTimeSpec;
369  int mNumberPrecision;
370  QLatin1Char mNumberFormatChar;
371  bool mNumberBeautifulPowers;
372  //bool mNumberMultiplyCross; // QCPAxisPainter
373  // ticks and subticks:
374  bool mTicks;
375  double mTickStep;
376  int mSubTickCount, mAutoTickCount;
377  bool mAutoTicks, mAutoTickStep, mAutoSubTicks;
378  //int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut; // QCPAxisPainter
379  QPen mTickPen, mSelectedTickPen;
380  QPen mSubTickPen, mSelectedSubTickPen;
381  // scale and range:
382  QCPRange mRange;
383  bool mRangeReversed;
384  ScaleType mScaleType;
385  double mScaleLogBase, mScaleLogBaseLogInv;
386 
387  // non-property members:
388  QCPGrid *mGrid;
389  QCPAxisPainterPrivate *mAxisPainter;
390  int mLowestVisibleTick, mHighestVisibleTick;
391  QVector<double> mTickVector;
392  QVector<QString> mTickVectorLabels;
393  QVector<double> mSubTickVector;
394  bool mCachedMarginValid;
395  int mCachedMargin;
396 
397  // introduced virtual methods:
398  virtual void setupTickVectors();
399  virtual void generateAutoTicks();
400  virtual int calculateAutoSubTickCount(double tickStep) const;
401  virtual int calculateMargin();
402 
403  // reimplemented virtual methods:
404  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
405  virtual void draw(QCPPainter *painter);
406  virtual QCP::Interaction selectionCategory() const;
407  // events:
408  virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged);
409  virtual void deselectEvent(bool *selectionStateChanged);
410 
411  // non-virtual methods:
412  void visibleTickBounds(int &lowIndex, int &highIndex) const;
413  double baseLog(double value) const;
414  double basePow(double value) const;
415  QPen getBasePen() const;
416  QPen getTickPen() const;
417  QPen getSubTickPen() const;
418  QFont getTickLabelFont() const;
419  QFont getLabelFont() const;
420  QColor getTickLabelColor() const;
421  QColor getLabelColor() const;
422 
423 private:
424  Q_DISABLE_COPY(QCPAxis)
425 
426  friend class QCustomPlot;
427  friend class QCPGrid;
428  friend class QCPAxisRect;
429 };
430 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
431 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
432 Q_DECLARE_METATYPE(QCPAxis::SelectablePart)
433 
434 
435 class QCPAxisPainterPrivate
436 {
437 public:
438  explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
439  virtual ~QCPAxisPainterPrivate();
440 
441  virtual void draw(QCPPainter *painter);
442  virtual int size() const;
443  void clearCache();
444 
445  QRect axisSelectionBox() const { return mAxisSelectionBox; }
446  QRect tickLabelsSelectionBox() const { return mTickLabelsSelectionBox; }
447  QRect labelSelectionBox() const { return mLabelSelectionBox; }
448 
449  // public property members:
450  QCPAxis::AxisType type;
451  QPen basePen;
452  QCPLineEnding lowerEnding, upperEnding; // directly accessed by QCPAxis setters/getters
453  int labelPadding; // directly accessed by QCPAxis setters/getters
454  QFont labelFont;
455  QColor labelColor;
456  QString label;
457  int tickLabelPadding; // directly accessed by QCPAxis setters/getters
458  double tickLabelRotation; // directly accessed by QCPAxis setters/getters
459  QCPAxis::LabelSide tickLabelSide; // directly accessed by QCPAxis setters/getters
460  bool substituteExponent;
461  bool numberMultiplyCross; // directly accessed by QCPAxis setters/getters
462  int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut; // directly accessed by QCPAxis setters/getters
463  QPen tickPen, subTickPen;
464  QFont tickLabelFont;
465  QColor tickLabelColor;
466  QRect axisRect, viewportRect;
467  double offset; // directly accessed by QCPAxis setters/getters
468  bool abbreviateDecimalPowers;
469  bool reversedEndings;
470 
471  QVector<double> subTickPositions;
472  QVector<double> tickPositions;
473  QVector<QString> tickLabels;
474 
475 protected:
476  struct CachedLabel
477  {
478  QPointF offset;
479  QPixmap pixmap;
480  };
481  struct TickLabelData
482  {
483  QString basePart, expPart;
484  QRect baseBounds, expBounds, totalBounds, rotatedTotalBounds;
485  QFont baseFont, expFont;
486  };
487  QCustomPlot *mParentPlot;
488  QByteArray mLabelParameterHash; // to determine whether mLabelCache needs to be cleared due to changed parameters
489  QCache<QString, CachedLabel> mLabelCache;
490  QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
491 
492  virtual QByteArray generateLabelParameterHash() const;
493 
494  virtual void placeTickLabel(QCPPainter *painter, double position, int distanceToAxis, const QString &text, QSize *tickLabelsSize);
495  virtual void drawTickLabel(QCPPainter *painter, double x, double y, const TickLabelData &labelData) const;
496  virtual TickLabelData getTickLabelData(const QFont &font, const QString &text) const;
497  virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const;
498  virtual void getMaxTickLabelSize(const QFont &font, const QString &text, QSize *tickLabelsSize) const;
499 };
500 
501 #endif // QCP_AXIS_H
Represents the range an axis is encompassing.
Definition: range.h:31
virtual void deselectEvent(bool *selectionStateChanged)
Definition: layer.cpp:623
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: layer.cpp:416
Handles the different ending decorations for line-like items.
Definition: lineending.h:33
Responsible for drawing the grid of a QCPAxis.
Definition: axis.h:44
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
LabelSide
Definition: axis.h:178
SelectablePart
Definition: axis.h:194
QPainter subclass used internally.
Definition: painter.h:111
Holds multiple axes and arranges them in a rectangular shape.
Definition: layoutelement-axisrect.h:40
Manages a single axis inside a QCustomPlot.
Definition: axis.h:94
LabelType
Definition: axis.h:169
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
Definition: layer.cpp:603
virtual void draw(QCPPainter *painter)=0
The abstract base class for all items in a plot.
Definition: item.h:143
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
AxisType
Definition: axis.h:156
QCPGrid * grid() const
Definition: axis.h:257
Base class for all drawable objects.
Definition: layer.h:80
Qt::Orientation orientation() const
Definition: axis.h:320
ScaleType
Definition: axis.h:186
A plottable representing a graph in a plot.
Definition: plottable-graph.h:60
The abstract base class for all data representing objects in a plot.
Definition: plottable.h:36
static Qt::Orientation orientation(AxisType type)
Definition: axis.h:333
MarginSide
Definition: global.h:78
virtual QCP::Interaction selectionCategory() const
Definition: layer.cpp:553
Interaction
Definition: global.h:133