gepetto-viewer  6.0.0
An user-friendly Graphical Interface
qcustomplot.h
Go to the documentation of this file.
1 /***************************************************************************
2 ** **
3 ** QCustomPlot, an easy to use, modern plotting widget for Qt **
4 ** Copyright (C) 2011-2015 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: 22.12.15 **
23 ** Version: 1.3.2 **
24 ****************************************************************************/
25 
26 #ifndef QCUSTOMPLOT_H
27 #define QCUSTOMPLOT_H
28 
29 #include <qmath.h>
30 
31 #include <QCache>
32 #include <QDateTime>
33 #include <QDebug>
34 #include <QFlags>
35 #include <QMargins>
36 #include <QMouseEvent>
37 #include <QMultiMap>
38 #include <QObject>
39 #include <QPaintEvent>
40 #include <QPainter>
41 #include <QPixmap>
42 #include <QPointer>
43 #include <QStack>
44 #include <QString>
45 #include <QVector2D>
46 #include <QVector>
47 #include <QWidget>
48 #include <limits>
49 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
50 #include <qnumeric.h>
51 
52 #include <QPrintEngine>
53 #include <QPrinter>
54 #else
55 #include <QtNumeric>
56 #include <QtPrintSupport/QtPrintSupport>
57 #endif
58 
59 class QCPPainter;
60 class QCustomPlot;
61 class QCPLayerable;
62 class QCPLayoutElement;
63 class QCPLayout;
64 class QCPAxis;
65 class QCPAxisRect;
68 class QCPGraph;
69 class QCPAbstractItem;
70 class QCPItemPosition;
71 class QCPLayer;
72 class QCPPlotTitle;
73 class QCPLegend;
75 class QCPColorMap;
76 class QCPColorScale;
77 class QCPBars;
78 
81 // decl definitions for shared library compilation/usage:
82 #if defined(QCUSTOMPLOT_COMPILE_LIBRARY)
83 #define QCP_LIB_DECL Q_DECL_EXPORT
84 #elif defined(QCUSTOMPLOT_USE_LIBRARY)
85 #define QCP_LIB_DECL Q_DECL_IMPORT
86 #else
87 #define QCP_LIB_DECL
88 #endif
89 
94 namespace QCP {
101  msLeft = 0x01
102  ,
103  msRight = 0x02
104  ,
105  msTop = 0x04
106  ,
107  msBottom = 0x08
108  ,
109  msAll = 0xFF
110  ,
111  msNone = 0x00
112 };
113 Q_DECLARE_FLAGS(MarginSides, MarginSide)
114 
115 
127  aeAxes = 0x0001
128  ,
129  aeGrid = 0x0002
130  ,
131  aeSubGrid = 0x0004
132  ,
133  aeLegend = 0x0008
134  ,
135  aeLegendItems = 0x0010
136  ,
137  aePlottables =
138  0x0020
140  ,
141  aeItems = 0x0040
142  ,
143  aeScatters = 0x0080
145  ,
146  aeErrorBars = 0x0100
147  ,
148  aeFills = 0x0200
150  ,
151  aeZeroLine =
152  0x0400
153  ,
154  aeAll = 0xFFFF
155  ,
156  aeNone = 0x0000
157 };
158 Q_DECLARE_FLAGS(AntialiasedElements, AntialiasedElement)
159 
160 
167  phNone = 0x000
168  ,
170  0x001
174  ,
176  0x002
182  ,
183  phCacheLabels = 0x004
185 };
186 Q_DECLARE_FLAGS(PlottingHints, PlottingHint)
187 
188 
196  iRangeDrag =
197  0x001
199  ,
200  iRangeZoom = 0x002
203  ,
204  iMultiSelect = 0x004
207  ,
209  0x008
211  ,
212  iSelectAxes = 0x010
214  ,
215  iSelectLegend = 0x020
217  ,
218  iSelectItems = 0x040
220  ,
221  iSelectOther =
222  0x080
224 };
225 Q_DECLARE_FLAGS(Interactions, Interaction)
226 
227 
234 inline bool isInvalidData(double value) {
235  return qIsNaN(value) || qIsInf(value);
236 }
237 
243 inline bool isInvalidData(double value1, double value2) {
244  return isInvalidData(value1) || isInvalidData(value2);
245 }
246 
253 inline void setMarginValue(QMargins &margins, QCP::MarginSide side, int value) {
254  switch (side) {
255  case QCP::msLeft:
256  margins.setLeft(value);
257  break;
258  case QCP::msRight:
259  margins.setRight(value);
260  break;
261  case QCP::msTop:
262  margins.setTop(value);
263  break;
264  case QCP::msBottom:
265  margins.setBottom(value);
266  break;
267  case QCP::msAll:
268  margins = QMargins(value, value, value, value);
269  break;
270  default:
271  break;
272  }
273 }
274 
282 inline int getMarginValue(const QMargins &margins, QCP::MarginSide side) {
283  switch (side) {
284  case QCP::msLeft:
285  return margins.left();
286  case QCP::msRight:
287  return margins.right();
288  case QCP::msTop:
289  return margins.top();
290  case QCP::msBottom:
291  return margins.bottom();
292  default:
293  break;
294  }
295  return 0;
296 }
297 
298 } // end of namespace QCP
299 
300 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
301 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
302 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
303 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
304 
306  Q_GADGET
307  public:
316  Q_ENUMS(ScatterShape)
318  ssNone
320  ,
321  ssDot
323  ,
324  ssCross
325  ,
326  ssPlus
327  ,
328  ssCircle
329  ,
330  ssDisc
332  ,
333  ssSquare
334  ,
335  ssDiamond
336  ,
337  ssStar
339  ,
340  ssTriangle
342  ,
343  ssTriangleInverted
345  ,
346  ssCrossSquare
348  ,
349  ssPlusSquare
350  ,
351  ssCrossCircle
353  ,
354  ssPlusCircle
355  ,
356  ssPeace
358  ,
359  ssPixmap
361  ,
362  ssCustom
364  };
365 
367  QCPScatterStyle(ScatterShape shape, double size = 6);
368  QCPScatterStyle(ScatterShape shape, const QColor &color, double size);
369  QCPScatterStyle(ScatterShape shape, const QColor &color, const QColor &fill,
370  double size);
371  QCPScatterStyle(ScatterShape shape, const QPen &pen, const QBrush &brush,
372  double size);
373  QCPScatterStyle(const QPixmap &pixmap);
374  QCPScatterStyle(const QPainterPath &customPath, const QPen &pen,
375  const QBrush &brush = Qt::NoBrush, double size = 6);
376 
377  // getters:
378  double size() const { return mSize; }
379  ScatterShape shape() const { return mShape; }
380  QPen pen() const { return mPen; }
381  QBrush brush() const { return mBrush; }
382  QPixmap pixmap() const { return mPixmap; }
383  QPainterPath customPath() const { return mCustomPath; }
384 
385  // setters:
386  void setSize(double size);
387  void setShape(ScatterShape shape);
388  void setPen(const QPen &pen);
389  void setBrush(const QBrush &brush);
390  void setPixmap(const QPixmap &pixmap);
391  void setCustomPath(const QPainterPath &customPath);
392 
393  // non-property methods:
394  bool isNone() const { return mShape == ssNone; }
395  bool isPenDefined() const { return mPenDefined; }
396  void applyTo(QCPPainter *painter, const QPen &defaultPen) const;
397  void drawShape(QCPPainter *painter, QPointF pos) const;
398  void drawShape(QCPPainter *painter, double x, double y) const;
399 
400  protected:
401  // property members:
402  double mSize;
404  QPen mPen;
405  QBrush mBrush;
406  QPixmap mPixmap;
407  QPainterPath mCustomPath;
408 
409  // non-property members:
411 };
413 
414 class QCP_LIB_DECL QCPPainter : public QPainter {
415  Q_GADGET
416  public:
422  enum PainterMode {
423  pmDefault =
424  0x00
425  ,
426  pmVectorized =
427  0x01
429  ,
430  pmNoCaching = 0x02
433  ,
434  pmNonCosmetic =
435  0x04
438  };
439  Q_FLAGS(PainterMode PainterModes)
440  Q_DECLARE_FLAGS(PainterModes, PainterMode)
441 
443  QCPPainter(QPaintDevice *device);
445 
446  // getters:
447  bool antialiasing() const { return testRenderHint(QPainter::Antialiasing); }
448  PainterModes modes() const { return mModes; }
449 
450  // setters:
451  void setAntialiasing(bool enabled);
452  void setMode(PainterMode mode, bool enabled = true);
453  void setModes(PainterModes modes);
454 
455  // methods hiding non-virtual base class functions (QPainter bug workarounds):
456  bool begin(QPaintDevice *device);
457  void setPen(const QPen &pen);
458  void setPen(const QColor &color);
459  void setPen(Qt::PenStyle penStyle);
460  void drawLine(const QLineF &line);
461  void drawLine(const QPointF &p1, const QPointF &p2) {
462  drawLine(QLineF(p1, p2));
463  }
464  void save();
465  void restore();
466 
467  // non-virtual methods:
469 
470  protected:
471  // property members:
472  PainterModes mModes;
474 
475  // non-property members:
476  QStack<bool> mAntialiasingStack;
477 };
478 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
479 
480 class QCP_LIB_DECL QCPLayer : public QObject {
481  Q_OBJECT
483  Q_PROPERTY(QCustomPlot *parentPlot READ parentPlot)
484  Q_PROPERTY(QString name READ name)
485  Q_PROPERTY(int index READ index)
486  Q_PROPERTY(QList<QCPLayerable *> children READ children)
487  Q_PROPERTY(bool visible READ visible WRITE setVisible)
489  public:
490  QCPLayer(QCustomPlot *parentPlot, const QString &layerName);
492 
493  // getters:
494  QCustomPlot *parentPlot() const { return mParentPlot; }
495  QString name() const { return mName; }
496  int index() const { return mIndex; }
497  QList<QCPLayerable *> children() const { return mChildren; }
498  bool visible() const { return mVisible; }
499 
500  // setters:
501  void setVisible(bool visible);
502 
503  protected:
504  // property members:
506  QString mName;
507  int mIndex;
508  QList<QCPLayerable *> mChildren;
509  bool mVisible;
510 
511  // non-virtual methods:
512  void addChild(QCPLayerable *layerable, bool prepend);
513  void removeChild(QCPLayerable *layerable);
514 
515  private:
516  Q_DISABLE_COPY(QCPLayer)
517 
518  friend class QCustomPlot;
519  friend class QCPLayerable;
520 };
521 
522 class QCP_LIB_DECL QCPLayerable : public QObject {
523  Q_OBJECT
525  Q_PROPERTY(bool visible READ visible WRITE setVisible)
526  Q_PROPERTY(QCustomPlot *parentPlot READ parentPlot)
527  Q_PROPERTY(QCPLayerable *parentLayerable READ parentLayerable)
528  Q_PROPERTY(QCPLayer *layer READ layer WRITE setLayer NOTIFY layerChanged)
529  Q_PROPERTY(bool antialiased READ antialiased WRITE setAntialiased)
531  public:
532  QCPLayerable(QCustomPlot *plot, QString targetLayer = QString(),
533  QCPLayerable *parentLayerable = 0);
535 
536  // getters:
537  bool visible() const { return mVisible; }
538  QCustomPlot *parentPlot() const { return mParentPlot; }
539  QCPLayerable *parentLayerable() const { return mParentLayerable.data(); }
540  QCPLayer *layer() const { return mLayer; }
541  bool antialiased() const { return mAntialiased; }
542 
543  // setters:
544  void setVisible(bool on);
545  Q_SLOT bool setLayer(QCPLayer *layer);
546  bool setLayer(const QString &layerName);
547  void setAntialiased(bool enabled);
548 
549  // introduced virtual methods:
550  virtual double selectTest(const QPointF &pos, bool onlySelectable,
551  QVariant *details = 0) const;
552 
553  // non-property methods:
554  bool realVisibility() const;
555 
556  signals:
557  void layerChanged(QCPLayer *newLayer);
558 
559  protected:
560  // property members:
561  bool mVisible;
563  QPointer<QCPLayerable> mParentLayerable;
566 
567  // introduced virtual methods:
568  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
570  virtual QRect clipRect() const;
571  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const = 0;
572  virtual void draw(QCPPainter *painter) = 0;
573  // events:
574  virtual void selectEvent(QMouseEvent *event, bool additive,
575  const QVariant &details,
576  bool *selectionStateChanged);
577  virtual void deselectEvent(bool *selectionStateChanged);
578 
579  // non-property methods:
581  void setParentLayerable(QCPLayerable *parentLayerable);
582  bool moveToLayer(QCPLayer *layer, bool prepend);
583  void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased,
584  QCP::AntialiasedElement overrideElement) const;
585 
586  private:
587  Q_DISABLE_COPY(QCPLayerable)
588 
589  friend class QCustomPlot;
590  friend class QCPAxisRect;
591 };
592 
594  public:
595  double lower, upper;
596 
598  QCPRange(double lower, double upper);
599 
600  bool operator==(const QCPRange &other) const {
601  return lower == other.lower && upper == other.upper;
602  }
603  bool operator!=(const QCPRange &other) const { return !(*this == other); }
604 
605  QCPRange &operator+=(const double &value) {
606  lower += value;
607  upper += value;
608  return *this;
609  }
610  QCPRange &operator-=(const double &value) {
611  lower -= value;
612  upper -= value;
613  return *this;
614  }
615  QCPRange &operator*=(const double &value) {
616  lower *= value;
617  upper *= value;
618  return *this;
619  }
620  QCPRange &operator/=(const double &value) {
621  lower /= value;
622  upper /= value;
623  return *this;
624  }
625  friend inline const QCPRange operator+(const QCPRange &, double);
626  friend inline const QCPRange operator+(double, const QCPRange &);
627  friend inline const QCPRange operator-(const QCPRange &range, double value);
628  friend inline const QCPRange operator*(const QCPRange &range, double value);
629  friend inline const QCPRange operator*(double value, const QCPRange &range);
630  friend inline const QCPRange operator/(const QCPRange &range, double value);
631 
632  double size() const;
633  double center() const;
634  void normalize();
635  void expand(const QCPRange &otherRange);
636  QCPRange expanded(const QCPRange &otherRange) const;
639  bool contains(double value) const;
640 
641  static bool validRange(double lower, double upper);
642  static bool validRange(const QCPRange &range);
643  static const double minRange; // 1e-280;
644  static const double maxRange; // 1e280;
645 };
646 Q_DECLARE_TYPEINFO(QCPRange, Q_MOVABLE_TYPE);
647 
648 /* documentation of inline functions */
649 
670 /* end documentation of inline functions */
671 
675 inline const QCPRange operator+(const QCPRange &range, double value) {
676  QCPRange result(range);
677  result += value;
678  return result;
679 }
680 
684 inline const QCPRange operator+(double value, const QCPRange &range) {
685  QCPRange result(range);
686  result += value;
687  return result;
688 }
689 
693 inline const QCPRange operator-(const QCPRange &range, double value) {
694  QCPRange result(range);
695  result -= value;
696  return result;
697 }
698 
702 inline const QCPRange operator*(const QCPRange &range, double value) {
703  QCPRange result(range);
704  result *= value;
705  return result;
706 }
707 
711 inline const QCPRange operator*(double value, const QCPRange &range) {
712  QCPRange result(range);
713  result *= value;
714  return result;
715 }
716 
720 inline const QCPRange operator/(const QCPRange &range, double value) {
721  QCPRange result(range);
722  result /= value;
723  return result;
724 }
725 
726 class QCP_LIB_DECL QCPMarginGroup : public QObject {
727  Q_OBJECT
728  public:
731 
732  // non-virtual methods:
733  QList<QCPLayoutElement *> elements(QCP::MarginSide side) const {
734  return mChildren.value(side);
735  }
736  bool isEmpty() const;
737  void clear();
738 
739  protected:
740  // non-property members:
742  QHash<QCP::MarginSide, QList<QCPLayoutElement *> > mChildren;
743 
744  // non-virtual methods:
745  int commonMargin(QCP::MarginSide side) const;
748 
749  private:
750  Q_DISABLE_COPY(QCPMarginGroup)
751 
752  friend class QCPLayoutElement;
753 };
754 
756  Q_OBJECT
758  Q_PROPERTY(QCPLayout *layout READ layout)
759  Q_PROPERTY(QRect rect READ rect)
760  Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
761  Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
762  Q_PROPERTY(
763  QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
764  Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
765  Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
767  public:
772  enum UpdatePhase {
773  upPreparation
775  ,
776  upMargins
777  ,
778  upLayout
780  };
781  Q_ENUMS(UpdatePhase)
782 
783  explicit QCPLayoutElement(QCustomPlot *parentPlot = 0);
784  virtual ~QCPLayoutElement();
785 
786  // getters:
787  QCPLayout *layout() const { return mParentLayout; }
788  QRect rect() const { return mRect; }
789  QRect outerRect() const { return mOuterRect; }
790  QMargins margins() const { return mMargins; }
791  QMargins minimumMargins() const { return mMinimumMargins; }
792  QCP::MarginSides autoMargins() const { return mAutoMargins; }
793  QSize minimumSize() const { return mMinimumSize; }
794  QSize maximumSize() const { return mMaximumSize; }
796  return mMarginGroups.value(side, (QCPMarginGroup *)0);
797  }
798  QHash<QCP::MarginSide, QCPMarginGroup *> marginGroups() const {
799  return mMarginGroups;
800  }
801 
802  // setters:
803  void setOuterRect(const QRect &rect);
804  void setMargins(const QMargins &margins);
805  void setMinimumMargins(const QMargins &margins);
806  void setAutoMargins(QCP::MarginSides sides);
807  void setMinimumSize(const QSize &size);
808  void setMinimumSize(int width, int height);
809  void setMaximumSize(const QSize &size);
810  void setMaximumSize(int width, int height);
811  void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group);
812 
813  // introduced virtual methods:
814  virtual void update(UpdatePhase phase);
815  virtual QSize minimumSizeHint() const;
816  virtual QSize maximumSizeHint() const;
817  virtual QList<QCPLayoutElement *> elements(bool recursive) const;
818 
819  // reimplemented virtual methods:
820  virtual double selectTest(const QPointF &pos, bool onlySelectable,
821  QVariant *details = 0) const;
822 
823  protected:
824  // property members:
826  QSize mMinimumSize, mMaximumSize;
827  QRect mRect, mOuterRect;
828  QMargins mMargins, mMinimumMargins;
829  QCP::MarginSides mAutoMargins;
830  QHash<QCP::MarginSide, QCPMarginGroup *> mMarginGroups;
831 
832  // introduced virtual methods:
834  // events:
835  virtual void mousePressEvent(QMouseEvent *event) { Q_UNUSED(event) }
836  virtual void mouseMoveEvent(QMouseEvent *event) { Q_UNUSED(event) }
837  virtual void mouseReleaseEvent(QMouseEvent *event) { Q_UNUSED(event) }
838  virtual void mouseDoubleClickEvent(QMouseEvent *event) { Q_UNUSED(event) }
839  virtual void wheelEvent(QWheelEvent *event) { Q_UNUSED(event) }
840 
841  // reimplemented virtual methods:
842  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const {
843  Q_UNUSED(painter)
844  }
845  virtual void draw(QCPPainter *painter) { Q_UNUSED(painter) }
846  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
847 
848  private:
849  Q_DISABLE_COPY(QCPLayoutElement)
850 
851  friend class QCustomPlot;
852  friend class QCPLayout;
853  friend class QCPMarginGroup;
854 };
855 
857  Q_OBJECT
858  public:
859  explicit QCPLayout();
860 
861  // reimplemented virtual methods:
862  virtual void update(UpdatePhase phase);
863  virtual QList<QCPLayoutElement *> elements(bool recursive) const;
864 
865  // introduced virtual methods:
866  virtual int elementCount() const = 0;
867  virtual QCPLayoutElement *elementAt(int index) const = 0;
868  virtual QCPLayoutElement *takeAt(int index) = 0;
869  virtual bool take(QCPLayoutElement *element) = 0;
870  virtual void simplify();
871 
872  // non-virtual methods:
873  bool removeAt(int index);
874  bool remove(QCPLayoutElement *element);
875  void clear();
876 
877  protected:
878  // introduced virtual methods:
879  virtual void updateLayout();
880 
881  // non-virtual methods:
885  QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes,
886  QVector<double> stretchFactors,
887  int totalSize) const;
888 
889  private:
890  Q_DISABLE_COPY(QCPLayout)
891  friend class QCPLayoutElement;
892 };
893 
895  Q_OBJECT
897  Q_PROPERTY(int rowCount READ rowCount)
898  Q_PROPERTY(int columnCount READ columnCount)
899  Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE
900  setColumnStretchFactors)
901  Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE
902  setRowStretchFactors)
903  Q_PROPERTY(int columnSpacing READ columnSpacing WRITE setColumnSpacing)
904  Q_PROPERTY(int rowSpacing READ rowSpacing WRITE setRowSpacing)
906  public:
907  explicit QCPLayoutGrid();
908  virtual ~QCPLayoutGrid();
909 
910  // getters:
911  int rowCount() const;
912  int columnCount() const;
913  QList<double> columnStretchFactors() const { return mColumnStretchFactors; }
914  QList<double> rowStretchFactors() const { return mRowStretchFactors; }
915  int columnSpacing() const { return mColumnSpacing; }
916  int rowSpacing() const { return mRowSpacing; }
917 
918  // setters:
919  void setColumnStretchFactor(int column, double factor);
920  void setColumnStretchFactors(const QList<double> &factors);
921  void setRowStretchFactor(int row, double factor);
922  void setRowStretchFactors(const QList<double> &factors);
923  void setColumnSpacing(int pixels);
924  void setRowSpacing(int pixels);
925 
926  // reimplemented virtual methods:
927  virtual void updateLayout();
928  virtual int elementCount() const;
929  virtual QCPLayoutElement *elementAt(int index) const;
930  virtual QCPLayoutElement *takeAt(int index);
931  virtual bool take(QCPLayoutElement *element);
932  virtual QList<QCPLayoutElement *> elements(bool recursive) const;
933  virtual void simplify();
934  virtual QSize minimumSizeHint() const;
935  virtual QSize maximumSizeHint() const;
936 
937  // non-virtual methods:
938  QCPLayoutElement *element(int row, int column) const;
939  bool addElement(int row, int column, QCPLayoutElement *element);
940  bool hasElement(int row, int column);
941  void expandTo(int newRowCount, int newColumnCount);
942  void insertRow(int newIndex);
943  void insertColumn(int newIndex);
944 
945  protected:
946  // property members:
947  QList<QList<QCPLayoutElement *> > mElements;
948  QList<double> mColumnStretchFactors;
949  QList<double> mRowStretchFactors;
950  int mColumnSpacing, mRowSpacing;
951 
952  // non-virtual methods:
953  void getMinimumRowColSizes(QVector<int> *minColWidths,
954  QVector<int> *minRowHeights) const;
955  void getMaximumRowColSizes(QVector<int> *maxColWidths,
956  QVector<int> *maxRowHeights) const;
957 
958  private:
959  Q_DISABLE_COPY(QCPLayoutGrid)
960 };
961 
963  Q_OBJECT
964  public:
970  ipFree
972  ,
973  ipBorderAligned
975  };
976 
977  explicit QCPLayoutInset();
978  virtual ~QCPLayoutInset();
979 
980  // getters:
981  InsetPlacement insetPlacement(int index) const;
982  Qt::Alignment insetAlignment(int index) const;
983  QRectF insetRect(int index) const;
984 
985  // setters:
986  void setInsetPlacement(int index, InsetPlacement placement);
987  void setInsetAlignment(int index, Qt::Alignment alignment);
988  void setInsetRect(int index, const QRectF &rect);
989 
990  // reimplemented virtual methods:
991  virtual void updateLayout();
992  virtual int elementCount() const;
993  virtual QCPLayoutElement *elementAt(int index) const;
994  virtual QCPLayoutElement *takeAt(int index);
995  virtual bool take(QCPLayoutElement *element);
996  virtual void simplify() {}
997  virtual double selectTest(const QPointF &pos, bool onlySelectable,
998  QVariant *details = 0) const;
999 
1000  // non-virtual methods:
1001  void addElement(QCPLayoutElement *element, Qt::Alignment alignment);
1002  void addElement(QCPLayoutElement *element, const QRectF &rect);
1003 
1004  protected:
1005  // property members:
1006  QList<QCPLayoutElement *> mElements;
1007  QList<InsetPlacement> mInsetPlacement;
1008  QList<Qt::Alignment> mInsetAlignment;
1009  QList<QRectF> mInsetRect;
1010 
1011  private:
1012  Q_DISABLE_COPY(QCPLayoutInset)
1013 };
1014 
1016  Q_GADGET
1017  public:
1031  Q_ENUMS(EndingStyle)
1033  esNone
1034  ,
1035  esFlatArrow
1036  ,
1037  esSpikeArrow
1038  ,
1039  esLineArrow
1040  ,
1041  esDisc
1042  ,
1043  esSquare
1044  ,
1045  esDiamond
1046  ,
1047  esBar
1048  ,
1049  esHalfBar
1051  ,
1052  esSkewedBar
1054  };
1055 
1057  QCPLineEnding(EndingStyle style, double width = 8, double length = 10,
1058  bool inverted = false);
1059 
1060  // getters:
1061  EndingStyle style() const { return mStyle; }
1062  double width() const { return mWidth; }
1063  double length() const { return mLength; }
1064  bool inverted() const { return mInverted; }
1065 
1066  // setters:
1067  void setStyle(EndingStyle style);
1068  void setWidth(double width);
1069  void setLength(double length);
1070  void setInverted(bool inverted);
1071 
1072  // non-property methods:
1073  double boundingDistance() const;
1074  double realLength() const;
1075  void draw(QCPPainter *painter, const QVector2D &pos,
1076  const QVector2D &dir) const;
1077  void draw(QCPPainter *painter, const QVector2D &pos, double angle) const;
1078 
1079  protected:
1080  // property members:
1082  double mWidth, mLength;
1084 };
1086 
1088  Q_OBJECT
1090  Q_PROPERTY(bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
1091  Q_PROPERTY(bool antialiasedSubGrid READ antialiasedSubGrid WRITE
1092  setAntialiasedSubGrid)
1093  Q_PROPERTY(bool antialiasedZeroLine READ antialiasedZeroLine WRITE
1094  setAntialiasedZeroLine)
1095  Q_PROPERTY(QPen pen READ pen WRITE setPen)
1096  Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
1097  Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
1099  public:
1100  QCPGrid(QCPAxis *parentAxis);
1101 
1102  // getters:
1103  bool subGridVisible() const { return mSubGridVisible; }
1104  bool antialiasedSubGrid() const { return mAntialiasedSubGrid; }
1105  bool antialiasedZeroLine() const { return mAntialiasedZeroLine; }
1106  QPen pen() const { return mPen; }
1107  QPen subGridPen() const { return mSubGridPen; }
1108  QPen zeroLinePen() const { return mZeroLinePen; }
1109 
1110  // setters:
1111  void setSubGridVisible(bool visible);
1112  void setAntialiasedSubGrid(bool enabled);
1113  void setAntialiasedZeroLine(bool enabled);
1114  void setPen(const QPen &pen);
1115  void setSubGridPen(const QPen &pen);
1116  void setZeroLinePen(const QPen &pen);
1117 
1118  protected:
1119  // property members:
1121  bool mAntialiasedSubGrid, mAntialiasedZeroLine;
1122  QPen mPen, mSubGridPen, mZeroLinePen;
1123  // non-property members:
1125 
1126  // reimplemented virtual methods:
1127  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
1128  virtual void draw(QCPPainter *painter);
1129 
1130  // non-virtual methods:
1131  void drawGridLines(QCPPainter *painter) const;
1132  void drawSubGridLines(QCPPainter *painter) const;
1133 
1134  friend class QCPAxis;
1135 };
1136 
1138  Q_OBJECT
1140  Q_PROPERTY(AxisType axisType READ axisType)
1141  Q_PROPERTY(QCPAxisRect *axisRect READ axisRect)
1142  Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY
1143  scaleTypeChanged)
1144  Q_PROPERTY(double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
1145  Q_PROPERTY(QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
1146  Q_PROPERTY(bool rangeReversed READ rangeReversed WRITE setRangeReversed)
1147  Q_PROPERTY(bool autoTicks READ autoTicks WRITE setAutoTicks)
1148  Q_PROPERTY(int autoTickCount READ autoTickCount WRITE setAutoTickCount)
1149  Q_PROPERTY(bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
1150  Q_PROPERTY(bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
1151  Q_PROPERTY(bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
1152  Q_PROPERTY(bool ticks READ ticks WRITE setTicks)
1153  Q_PROPERTY(bool tickLabels READ tickLabels WRITE setTickLabels)
1154  Q_PROPERTY(
1155  int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
1156  Q_PROPERTY(LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
1157  Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
1158  Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1159  Q_PROPERTY(double tickLabelRotation READ tickLabelRotation WRITE
1160  setTickLabelRotation)
1161  Q_PROPERTY(LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
1162  Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
1163  Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec)
1164  Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
1165  Q_PROPERTY(int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1166  Q_PROPERTY(double tickStep READ tickStep WRITE setTickStep)
1167  Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
1168  Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE
1169  setTickVectorLabels)
1170  Q_PROPERTY(int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1171  Q_PROPERTY(int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1172  Q_PROPERTY(int subTickCount READ subTickCount WRITE setSubTickCount)
1173  Q_PROPERTY(int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1174  Q_PROPERTY(
1175  int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1176  Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
1177  Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
1178  Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
1179  Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
1180  Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
1181  Q_PROPERTY(QString label READ label WRITE setLabel)
1182  Q_PROPERTY(int labelPadding READ labelPadding WRITE setLabelPadding)
1183  Q_PROPERTY(int padding READ padding WRITE setPadding)
1184  Q_PROPERTY(int offset READ offset WRITE setOffset)
1185  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
1186  setSelectedParts NOTIFY selectionChanged)
1187  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
1188  setSelectableParts NOTIFY selectableChanged)
1189  Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE
1190  setSelectedTickLabelFont)
1191  Q_PROPERTY(
1192  QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1193  Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE
1194  setSelectedTickLabelColor)
1195  Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE
1196  setSelectedLabelColor)
1197  Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1198  Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1199  Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE
1200  setSelectedSubTickPen)
1201  Q_PROPERTY(QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1202  Q_PROPERTY(QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1203  Q_PROPERTY(QCPGrid *grid READ grid)
1205  public:
1211  enum AxisType {
1212  atLeft = 0x01
1214  ,
1215  atRight = 0x02
1217  ,
1218  atTop = 0x04
1220  ,
1221  atBottom = 0x08
1223  };
1224  Q_FLAGS(AxisType AxisTypes)
1225  Q_DECLARE_FLAGS(AxisTypes, AxisType)
1233  enum LabelType {
1234  ltNumber
1236  ,
1237  ltDateTime
1241  };
1242  Q_ENUMS(LabelType)
1248  enum LabelSide {
1249  lsInside
1251  ,
1252  lsOutside
1253  };
1254  Q_ENUMS(LabelSide)
1259  enum ScaleType {
1260  stLinear
1261  ,
1262  stLogarithmic
1265  };
1266  Q_ENUMS(ScaleType)
1272  spNone = 0
1273  ,
1274  spAxis = 0x001
1275  ,
1276  spTickLabels = 0x002
1278  ,
1279  spAxisLabel = 0x004
1280  };
1281  Q_FLAGS(SelectablePart SelectableParts)
1282  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
1283 
1284  explicit QCPAxis(QCPAxisRect *parent, AxisType type);
1285  virtual ~QCPAxis();
1286 
1287  // getters:
1288  AxisType axisType() const { return mAxisType; }
1289  QCPAxisRect *axisRect() const { return mAxisRect; }
1290  ScaleType scaleType() const { return mScaleType; }
1291  double scaleLogBase() const { return mScaleLogBase; }
1292  const QCPRange range() const { return mRange; }
1293  bool rangeReversed() const { return mRangeReversed; }
1294  bool autoTicks() const { return mAutoTicks; }
1295  int autoTickCount() const { return mAutoTickCount; }
1296  bool autoTickLabels() const { return mAutoTickLabels; }
1297  bool autoTickStep() const { return mAutoTickStep; }
1298  bool autoSubTicks() const { return mAutoSubTicks; }
1299  bool ticks() const { return mTicks; }
1300  bool tickLabels() const { return mTickLabels; }
1301  int tickLabelPadding() const;
1302  LabelType tickLabelType() const { return mTickLabelType; }
1303  QFont tickLabelFont() const { return mTickLabelFont; }
1304  QColor tickLabelColor() const { return mTickLabelColor; }
1305  double tickLabelRotation() const;
1307  QString dateTimeFormat() const { return mDateTimeFormat; }
1308  Qt::TimeSpec dateTimeSpec() const { return mDateTimeSpec; }
1309  QString numberFormat() const;
1310  int numberPrecision() const { return mNumberPrecision; }
1311  double tickStep() const { return mTickStep; }
1312  QVector<double> tickVector() const { return mTickVector; }
1313  QVector<QString> tickVectorLabels() const { return mTickVectorLabels; }
1314  int tickLengthIn() const;
1315  int tickLengthOut() const;
1316  int subTickCount() const { return mSubTickCount; }
1317  int subTickLengthIn() const;
1318  int subTickLengthOut() const;
1319  QPen basePen() const { return mBasePen; }
1320  QPen tickPen() const { return mTickPen; }
1321  QPen subTickPen() const { return mSubTickPen; }
1322  QFont labelFont() const { return mLabelFont; }
1323  QColor labelColor() const { return mLabelColor; }
1324  QString label() const { return mLabel; }
1325  int labelPadding() const;
1326  int padding() const { return mPadding; }
1327  int offset() const;
1328  SelectableParts selectedParts() const { return mSelectedParts; }
1329  SelectableParts selectableParts() const { return mSelectableParts; }
1330  QFont selectedTickLabelFont() const { return mSelectedTickLabelFont; }
1331  QFont selectedLabelFont() const { return mSelectedLabelFont; }
1332  QColor selectedTickLabelColor() const { return mSelectedTickLabelColor; }
1333  QColor selectedLabelColor() const { return mSelectedLabelColor; }
1334  QPen selectedBasePen() const { return mSelectedBasePen; }
1335  QPen selectedTickPen() const { return mSelectedTickPen; }
1336  QPen selectedSubTickPen() const { return mSelectedSubTickPen; }
1339  QCPGrid *grid() const { return mGrid; }
1340 
1341  // setters:
1343  void setScaleLogBase(double base);
1344  Q_SLOT void setRange(const QCPRange &range);
1345  void setRange(double lower, double upper);
1346  void setRange(double position, double size, Qt::AlignmentFlag alignment);
1347  void setRangeLower(double lower);
1348  void setRangeUpper(double upper);
1349  void setRangeReversed(bool reversed);
1350  void setAutoTicks(bool on);
1351  void setAutoTickCount(int approximateCount);
1352  void setAutoTickLabels(bool on);
1353  void setAutoTickStep(bool on);
1354  void setAutoSubTicks(bool on);
1355  void setTicks(bool show);
1356  void setTickLabels(bool show);
1357  void setTickLabelPadding(int padding);
1359  void setTickLabelFont(const QFont &font);
1360  void setTickLabelColor(const QColor &color);
1361  void setTickLabelRotation(double degrees);
1363  void setDateTimeFormat(const QString &format);
1364  void setDateTimeSpec(const Qt::TimeSpec &timeSpec);
1365  void setNumberFormat(const QString &formatCode);
1366  void setNumberPrecision(int precision);
1367  void setTickStep(double step);
1368  void setTickVector(const QVector<double> &vec);
1369  void setTickVectorLabels(const QVector<QString> &vec);
1370  void setTickLength(int inside, int outside = 0);
1371  void setTickLengthIn(int inside);
1372  void setTickLengthOut(int outside);
1373  void setSubTickCount(int count);
1374  void setSubTickLength(int inside, int outside = 0);
1375  void setSubTickLengthIn(int inside);
1376  void setSubTickLengthOut(int outside);
1377  void setBasePen(const QPen &pen);
1378  void setTickPen(const QPen &pen);
1379  void setSubTickPen(const QPen &pen);
1380  void setLabelFont(const QFont &font);
1381  void setLabelColor(const QColor &color);
1382  void setLabel(const QString &str);
1383  void setLabelPadding(int padding);
1384  void setPadding(int padding);
1385  void setOffset(int offset);
1386  void setSelectedTickLabelFont(const QFont &font);
1387  void setSelectedLabelFont(const QFont &font);
1388  void setSelectedTickLabelColor(const QColor &color);
1389  void setSelectedLabelColor(const QColor &color);
1390  void setSelectedBasePen(const QPen &pen);
1391  void setSelectedTickPen(const QPen &pen);
1392  void setSelectedSubTickPen(const QPen &pen);
1393  Q_SLOT void setSelectableParts(
1394  const QCPAxis::SelectableParts &selectableParts);
1395  Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts);
1396  void setLowerEnding(const QCPLineEnding &ending);
1397  void setUpperEnding(const QCPLineEnding &ending);
1398 
1399  // reimplemented virtual methods:
1400  virtual double selectTest(const QPointF &pos, bool onlySelectable,
1401  QVariant *details = 0) const;
1402 
1403  // non-property methods:
1404  Qt::Orientation orientation() const { return mOrientation; }
1405  void moveRange(double diff);
1406  void scaleRange(double factor, double center);
1407  void setScaleRatio(const QCPAxis *otherAxis, double ratio = 1.0);
1408  void rescale(bool onlyVisiblePlottables = false);
1409  double pixelToCoord(double value) const;
1410  double coordToPixel(double value) const;
1411  SelectablePart getPartAt(const QPointF &pos) const;
1412  QList<QCPAbstractPlottable *> plottables() const;
1413  QList<QCPGraph *> graphs() const;
1414  QList<QCPAbstractItem *> items() const;
1415 
1417  static Qt::Orientation orientation(AxisType type) {
1418  return type == atBottom || type == atTop ? Qt::Horizontal : Qt::Vertical;
1419  }
1421 
1422  signals:
1424  void rangeChanged(const QCPRange &newRange);
1425  void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange);
1427  void selectionChanged(const QCPAxis::SelectableParts &parts);
1428  void selectableChanged(const QCPAxis::SelectableParts &parts);
1429 
1430  protected:
1431  // property members:
1432  // axis base:
1435  // int mOffset; // in QCPAxisPainter
1437  Qt::Orientation mOrientation;
1438  SelectableParts mSelectableParts, mSelectedParts;
1439  QPen mBasePen, mSelectedBasePen;
1440  // QCPLineEnding mLowerEnding, mUpperEnding; // in QCPAxisPainter
1441  // axis label:
1442  // int mLabelPadding; // in QCPAxisPainter
1443  QString mLabel;
1444  QFont mLabelFont, mSelectedLabelFont;
1445  QColor mLabelColor, mSelectedLabelColor;
1446  // tick labels:
1447  // int mTickLabelPadding; // in QCPAxisPainter
1448  bool mTickLabels, mAutoTickLabels;
1449  // double mTickLabelRotation; // in QCPAxisPainter
1451  QFont mTickLabelFont, mSelectedTickLabelFont;
1452  QColor mTickLabelColor, mSelectedTickLabelColor;
1454  Qt::TimeSpec mDateTimeSpec;
1456  QLatin1Char mNumberFormatChar;
1458  // bool mNumberMultiplyCross; // QCPAxisPainter
1459  // ticks and subticks:
1460  bool mTicks;
1461  double mTickStep;
1462  int mSubTickCount, mAutoTickCount;
1463  bool mAutoTicks, mAutoTickStep, mAutoSubTicks;
1464  // int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut; //
1465  // QCPAxisPainter
1466  QPen mTickPen, mSelectedTickPen;
1467  QPen mSubTickPen, mSelectedSubTickPen;
1468  // scale and range:
1472  double mScaleLogBase, mScaleLogBaseLogInv;
1473 
1474  // non-property members:
1477  int mLowestVisibleTick, mHighestVisibleTick;
1478  QVector<double> mTickVector;
1479  QVector<QString> mTickVectorLabels;
1480  QVector<double> mSubTickVector;
1483 
1484  // introduced virtual methods:
1485  virtual void setupTickVectors();
1486  virtual void generateAutoTicks();
1487  virtual int calculateAutoSubTickCount(double tickStep) const;
1488  virtual int calculateMargin();
1489 
1490  // reimplemented virtual methods:
1491  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
1492  virtual void draw(QCPPainter *painter);
1494  // events:
1495  virtual void selectEvent(QMouseEvent *event, bool additive,
1496  const QVariant &details,
1497  bool *selectionStateChanged);
1498  virtual void deselectEvent(bool *selectionStateChanged);
1499 
1500  // non-virtual methods:
1501  void visibleTickBounds(int &lowIndex, int &highIndex) const;
1502  double baseLog(double value) const;
1503  double basePow(double value) const;
1504  QPen getBasePen() const;
1505  QPen getTickPen() const;
1506  QPen getSubTickPen() const;
1507  QFont getTickLabelFont() const;
1508  QFont getLabelFont() const;
1509  QColor getTickLabelColor() const;
1510  QColor getLabelColor() const;
1511 
1512  private:
1513  Q_DISABLE_COPY(QCPAxis)
1514 
1515  friend class QCustomPlot;
1516  friend class QCPGrid;
1517  friend class QCPAxisRect;
1518 };
1519 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
1520 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
1521 Q_DECLARE_METATYPE(QCPAxis::SelectablePart)
1522 
1524  public:
1525  explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
1527 
1528  virtual void draw(QCPPainter *painter);
1529  virtual int size() const;
1530  void clearCache();
1531 
1532  QRect axisSelectionBox() const { return mAxisSelectionBox; }
1533  QRect tickLabelsSelectionBox() const { return mTickLabelsSelectionBox; }
1534  QRect labelSelectionBox() const { return mLabelSelectionBox; }
1535 
1536  // public property members:
1538  QPen basePen;
1540  upperEnding; // directly accessed by QCPAxis setters/getters
1541  int labelPadding; // directly accessed by QCPAxis setters/getters
1542  QFont labelFont;
1543  QColor labelColor;
1544  QString label;
1545  int tickLabelPadding; // directly accessed by QCPAxis setters/getters
1546  double tickLabelRotation; // directly accessed by QCPAxis setters/getters
1548  tickLabelSide; // directly accessed by QCPAxis setters/getters
1550  bool numberMultiplyCross; // directly accessed by QCPAxis setters/getters
1551  int tickLengthIn, tickLengthOut, subTickLengthIn,
1552  subTickLengthOut; // directly accessed by QCPAxis setters/getters
1553  QPen tickPen, subTickPen;
1556  QRect axisRect, viewportRect;
1557  double offset; // directly accessed by QCPAxis setters/getters
1560 
1561  QVector<double> subTickPositions;
1562  QVector<double> tickPositions;
1563  QVector<QString> tickLabels;
1564 
1565  protected:
1566  struct CachedLabel {
1567  QPointF offset;
1568  QPixmap pixmap;
1569  };
1570  struct TickLabelData {
1571  QString basePart, expPart;
1572  QRect baseBounds, expBounds, totalBounds, rotatedTotalBounds;
1573  QFont baseFont, expFont;
1574  };
1576  QByteArray mLabelParameterHash; // to determine whether mLabelCache needs to
1577  // be cleared due to changed parameters
1578  QCache<QString, CachedLabel> mLabelCache;
1579  QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
1580 
1581  virtual QByteArray generateLabelParameterHash() const;
1582 
1583  virtual void placeTickLabel(QCPPainter *painter, double position,
1584  int distanceToAxis, const QString &text,
1585  QSize *tickLabelsSize);
1586  virtual void drawTickLabel(QCPPainter *painter, double x, double y,
1587  const TickLabelData &labelData) const;
1588  virtual TickLabelData getTickLabelData(const QFont &font,
1589  const QString &text) const;
1590  virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const;
1591  virtual void getMaxTickLabelSize(const QFont &font, const QString &text,
1592  QSize *tickLabelsSize) const;
1593 };
1594 
1596  Q_OBJECT
1598  Q_PROPERTY(QString name READ name WRITE setName)
1599  Q_PROPERTY(bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
1600  Q_PROPERTY(bool antialiasedScatters READ antialiasedScatters WRITE
1601  setAntialiasedScatters)
1602  Q_PROPERTY(bool antialiasedErrorBars READ antialiasedErrorBars WRITE
1603  setAntialiasedErrorBars)
1604  Q_PROPERTY(QPen pen READ pen WRITE setPen)
1605  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
1606  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
1607  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
1608  Q_PROPERTY(QCPAxis *keyAxis READ keyAxis WRITE setKeyAxis)
1609  Q_PROPERTY(QCPAxis *valueAxis READ valueAxis WRITE setValueAxis)
1610  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
1611  selectableChanged)
1612  Q_PROPERTY(
1613  bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1615  public:
1616  QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis);
1617 
1618  // getters:
1619  QString name() const { return mName; }
1620  bool antialiasedFill() const { return mAntialiasedFill; }
1621  bool antialiasedScatters() const { return mAntialiasedScatters; }
1622  bool antialiasedErrorBars() const { return mAntialiasedErrorBars; }
1623  QPen pen() const { return mPen; }
1624  QPen selectedPen() const { return mSelectedPen; }
1625  QBrush brush() const { return mBrush; }
1626  QBrush selectedBrush() const { return mSelectedBrush; }
1627  QCPAxis *keyAxis() const { return mKeyAxis.data(); }
1628  QCPAxis *valueAxis() const { return mValueAxis.data(); }
1629  bool selectable() const { return mSelectable; }
1630  bool selected() const { return mSelected; }
1631 
1632  // setters:
1633  void setName(const QString &name);
1634  void setAntialiasedFill(bool enabled);
1635  void setAntialiasedScatters(bool enabled);
1636  void setAntialiasedErrorBars(bool enabled);
1637  void setPen(const QPen &pen);
1638  void setSelectedPen(const QPen &pen);
1639  void setBrush(const QBrush &brush);
1640  void setSelectedBrush(const QBrush &brush);
1641  void setKeyAxis(QCPAxis *axis);
1642  void setValueAxis(QCPAxis *axis);
1643  Q_SLOT void setSelectable(bool selectable);
1644  Q_SLOT void setSelected(bool selected);
1645 
1646  // introduced virtual methods:
1647  virtual void clearData() = 0;
1648  virtual double selectTest(const QPointF &pos, bool onlySelectable,
1649  QVariant *details = 0) const = 0;
1650  virtual bool addToLegend();
1651  virtual bool removeFromLegend() const;
1652 
1653  // non-property methods:
1654  void rescaleAxes(bool onlyEnlarge = false) const;
1655  void rescaleKeyAxis(bool onlyEnlarge = false) const;
1656  void rescaleValueAxis(bool onlyEnlarge = false) const;
1657 
1658  signals:
1659  void selectionChanged(bool selected);
1660  void selectableChanged(bool selectable);
1661 
1662  protected:
1667  enum SignDomain {
1668  sdNegative
1669  ,
1670  sdBoth
1671  ,
1672  sdPositive
1673  };
1674 
1675  // property members:
1676  QString mName;
1677  bool mAntialiasedFill, mAntialiasedScatters, mAntialiasedErrorBars;
1678  QPen mPen, mSelectedPen;
1679  QBrush mBrush, mSelectedBrush;
1680  QPointer<QCPAxis> mKeyAxis, mValueAxis;
1681  bool mSelectable, mSelected;
1682 
1683  // reimplemented virtual methods:
1684  virtual QRect clipRect() const;
1685  virtual void draw(QCPPainter *painter) = 0;
1688  // events:
1689  virtual void selectEvent(QMouseEvent *event, bool additive,
1690  const QVariant &details,
1691  bool *selectionStateChanged);
1692  virtual void deselectEvent(bool *selectionStateChanged);
1693 
1694  // introduced virtual methods:
1695  virtual void drawLegendIcon(QCPPainter *painter,
1696  const QRectF &rect) const = 0;
1697  virtual QCPRange getKeyRange(bool &foundRange,
1698  SignDomain inSignDomain = sdBoth) const = 0;
1699  virtual QCPRange getValueRange(bool &foundRange,
1700  SignDomain inSignDomain = sdBoth) const = 0;
1701 
1702  // non-virtual methods:
1703  void coordsToPixels(double key, double value, double &x, double &y) const;
1704  const QPointF coordsToPixels(double key, double value) const;
1705  void pixelsToCoords(double x, double y, double &key, double &value) const;
1706  void pixelsToCoords(const QPointF &pixelPos, double &key,
1707  double &value) const;
1708  QPen mainPen() const;
1709  QBrush mainBrush() const;
1713  double distSqrToLine(const QPointF &start, const QPointF &end,
1714  const QPointF &point) const;
1715 
1716  private:
1717  Q_DISABLE_COPY(QCPAbstractPlottable)
1718 
1719  friend class QCustomPlot;
1720  friend class QCPAxis;
1722 };
1723 
1725  public:
1726  QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem,
1727  const QString name, int anchorId = -1);
1728  virtual ~QCPItemAnchor();
1729 
1730  // getters:
1731  QString name() const { return mName; }
1732  virtual QPointF pixelPoint() const;
1733 
1734  protected:
1735  // property members:
1736  QString mName;
1737 
1738  // non-property members:
1742  QSet<QCPItemPosition *> mChildrenX, mChildrenY;
1743 
1744  // introduced virtual methods:
1745  virtual QCPItemPosition *toQCPItemPosition() { return 0; }
1746 
1747  // non-virtual methods:
1749  pos); // called from pos when this anchor is set as parent
1750  void removeChildX(QCPItemPosition *pos); // called from pos when its parent
1751  // anchor is reset or pos deleted
1753  pos); // called from pos when this anchor is set as parent
1754  void removeChildY(QCPItemPosition *pos); // called from pos when its parent
1755  // anchor is reset or pos deleted
1756 
1757  private:
1758  Q_DISABLE_COPY(QCPItemAnchor)
1759 
1760  friend class QCPItemPosition;
1761 };
1762 
1764  public:
1772  ptAbsolute
1774  ,
1775  ptViewportRatio
1782  ,
1783  ptAxisRectRatio
1792  ,
1793  ptPlotCoords
1795  };
1796 
1797  QCPItemPosition(QCustomPlot *parentPlot, QCPAbstractItem *parentItem,
1798  const QString name);
1799  virtual ~QCPItemPosition();
1800 
1801  // getters:
1802  PositionType type() const { return typeX(); }
1803  PositionType typeX() const { return mPositionTypeX; }
1804  PositionType typeY() const { return mPositionTypeY; }
1805  QCPItemAnchor *parentAnchor() const { return parentAnchorX(); }
1806  QCPItemAnchor *parentAnchorX() const { return mParentAnchorX; }
1807  QCPItemAnchor *parentAnchorY() const { return mParentAnchorY; }
1808  double key() const { return mKey; }
1809  double value() const { return mValue; }
1810  QPointF coords() const { return QPointF(mKey, mValue); }
1811  QCPAxis *keyAxis() const { return mKeyAxis.data(); }
1812  QCPAxis *valueAxis() const { return mValueAxis.data(); }
1814  virtual QPointF pixelPoint() const;
1815 
1816  // setters:
1817  void setType(PositionType type);
1820  bool setParentAnchor(QCPItemAnchor *parentAnchor,
1821  bool keepPixelPosition = false);
1822  bool setParentAnchorX(QCPItemAnchor *parentAnchor,
1823  bool keepPixelPosition = false);
1824  bool setParentAnchorY(QCPItemAnchor *parentAnchor,
1825  bool keepPixelPosition = false);
1826  void setCoords(double key, double value);
1827  void setCoords(const QPointF &coords);
1828  void setAxes(QCPAxis *keyAxis, QCPAxis *valueAxis);
1829  void setAxisRect(QCPAxisRect *axisRect);
1830  void setPixelPoint(const QPointF &pixelPoint);
1831 
1832  protected:
1833  // property members:
1834  PositionType mPositionTypeX, mPositionTypeY;
1835  QPointer<QCPAxis> mKeyAxis, mValueAxis;
1836  QPointer<QCPAxisRect> mAxisRect;
1837  double mKey, mValue;
1838  QCPItemAnchor *mParentAnchorX, *mParentAnchorY;
1839 
1840  // reimplemented virtual methods:
1841  virtual QCPItemPosition *toQCPItemPosition() { return this; }
1842 
1843  private:
1844  Q_DISABLE_COPY(QCPItemPosition)
1845 };
1846 
1848  Q_OBJECT
1850  Q_PROPERTY(bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
1851  Q_PROPERTY(QCPAxisRect *clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
1852  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
1853  selectableChanged)
1854  Q_PROPERTY(
1855  bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1857  public:
1859  virtual ~QCPAbstractItem();
1860 
1861  // getters:
1862  bool clipToAxisRect() const { return mClipToAxisRect; }
1864  bool selectable() const { return mSelectable; }
1865  bool selected() const { return mSelected; }
1866 
1867  // setters:
1868  void setClipToAxisRect(bool clip);
1870  Q_SLOT void setSelectable(bool selectable);
1871  Q_SLOT void setSelected(bool selected);
1872 
1873  // reimplemented virtual methods:
1874  virtual double selectTest(const QPointF &pos, bool onlySelectable,
1875  QVariant *details = 0) const = 0;
1876 
1877  // non-virtual methods:
1878  QList<QCPItemPosition *> positions() const { return mPositions; }
1879  QList<QCPItemAnchor *> anchors() const { return mAnchors; }
1880  QCPItemPosition *position(const QString &name) const;
1881  QCPItemAnchor *anchor(const QString &name) const;
1882  bool hasAnchor(const QString &name) const;
1883 
1884  signals:
1885  void selectionChanged(bool selected);
1886  void selectableChanged(bool selectable);
1887 
1888  protected:
1889  // property members:
1891  QPointer<QCPAxisRect> mClipAxisRect;
1892  QList<QCPItemPosition *> mPositions;
1893  QList<QCPItemAnchor *> mAnchors;
1894  bool mSelectable, mSelected;
1895 
1896  // reimplemented virtual methods:
1898  virtual QRect clipRect() const;
1899  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
1900  virtual void draw(QCPPainter *painter) = 0;
1901  // events:
1902  virtual void selectEvent(QMouseEvent *event, bool additive,
1903  const QVariant &details,
1904  bool *selectionStateChanged);
1905  virtual void deselectEvent(bool *selectionStateChanged);
1906 
1907  // introduced virtual methods:
1908  virtual QPointF anchorPixelPoint(int anchorId) const;
1909 
1910  // non-virtual methods:
1911  double distSqrToLine(const QPointF &start, const QPointF &end,
1912  const QPointF &point) const;
1913  double rectSelectTest(const QRectF &rect, const QPointF &pos,
1914  bool filledRect) const;
1915  QCPItemPosition *createPosition(const QString &name);
1916  QCPItemAnchor *createAnchor(const QString &name, int anchorId);
1917 
1918  private:
1919  Q_DISABLE_COPY(QCPAbstractItem)
1920 
1921  friend class QCustomPlot;
1922  friend class QCPItemAnchor;
1923 };
1924 
1925 class QCP_LIB_DECL QCustomPlot : public QWidget {
1926  Q_OBJECT
1928  Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
1929  Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1930  Q_PROPERTY(
1931  bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1932  Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode
1933  WRITE setBackgroundScaledMode)
1934  Q_PROPERTY(QCPLayoutGrid *plotLayout READ plotLayout)
1935  Q_PROPERTY(bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE
1936  setAutoAddPlottableToLegend)
1937  Q_PROPERTY(int selectionTolerance READ selectionTolerance WRITE
1938  setSelectionTolerance)
1939  Q_PROPERTY(bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE
1940  setNoAntialiasingOnDrag)
1941  Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier
1942  WRITE setMultiSelectModifier)
1944  public:
1951  limBelow
1952  ,
1953  limAbove
1954  };
1955  Q_ENUMS(LayerInsertMode)
1956 
1957 
1964  rpImmediate
1966  ,
1967  rpQueued
1970  ,
1971  rpHint
1974  };
1975 
1976  explicit QCustomPlot(QWidget *parent = 0);
1977  virtual ~QCustomPlot();
1978 
1979  // getters:
1980  QRect viewport() const { return mViewport; }
1981  QPixmap background() const { return mBackgroundPixmap; }
1982  bool backgroundScaled() const { return mBackgroundScaled; }
1983  Qt::AspectRatioMode backgroundScaledMode() const {
1984  return mBackgroundScaledMode;
1985  }
1986  QCPLayoutGrid *plotLayout() const { return mPlotLayout; }
1987  QCP::AntialiasedElements antialiasedElements() const {
1988  return mAntialiasedElements;
1989  }
1990  QCP::AntialiasedElements notAntialiasedElements() const {
1991  return mNotAntialiasedElements;
1992  }
1993  bool autoAddPlottableToLegend() const { return mAutoAddPlottableToLegend; }
1994  const QCP::Interactions interactions() const { return mInteractions; }
1995  int selectionTolerance() const { return mSelectionTolerance; }
1996  bool noAntialiasingOnDrag() const { return mNoAntialiasingOnDrag; }
1997  QCP::PlottingHints plottingHints() const { return mPlottingHints; }
1998  Qt::KeyboardModifier multiSelectModifier() const {
1999  return mMultiSelectModifier;
2000  }
2001 
2002  // setters:
2003  void setViewport(const QRect &rect);
2004  void setBackground(const QPixmap &pm);
2005  void setBackground(const QPixmap &pm, bool scaled,
2006  Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
2007  void setBackground(const QBrush &brush);
2008  void setBackgroundScaled(bool scaled);
2009  void setBackgroundScaledMode(Qt::AspectRatioMode mode);
2011  const QCP::AntialiasedElements &antialiasedElements);
2013  bool enabled = true);
2015  const QCP::AntialiasedElements &notAntialiasedElements);
2017  bool enabled = true);
2019  void setInteractions(const QCP::Interactions &interactions);
2020  void setInteraction(const QCP::Interaction &interaction, bool enabled = true);
2021  void setSelectionTolerance(int pixels);
2022  void setNoAntialiasingOnDrag(bool enabled);
2023  void setPlottingHints(const QCP::PlottingHints &hints);
2024  void setPlottingHint(QCP::PlottingHint hint, bool enabled = true);
2025  void setMultiSelectModifier(Qt::KeyboardModifier modifier);
2026 
2027  // non-property methods:
2028  // plottable interface:
2033  bool removePlottable(int index);
2035  int plottableCount() const;
2036  QList<QCPAbstractPlottable *> selectedPlottables() const;
2037  QCPAbstractPlottable *plottableAt(const QPointF &pos,
2038  bool onlySelectable = false) const;
2039  bool hasPlottable(QCPAbstractPlottable *plottable) const;
2040 
2041  // specialized interface for QCPGraph:
2042  QCPGraph *graph(int index) const;
2043  QCPGraph *graph() const;
2044  QCPGraph *addGraph(QCPAxis *keyAxis = 0, QCPAxis *valueAxis = 0);
2045  bool removeGraph(QCPGraph *graph);
2046  bool removeGraph(int index);
2048  int graphCount() const;
2049  QList<QCPGraph *> selectedGraphs() const;
2050 
2051  // item interface:
2052  QCPAbstractItem *item(int index) const;
2056  bool removeItem(int index);
2057  int clearItems();
2058  int itemCount() const;
2059  QList<QCPAbstractItem *> selectedItems() const;
2060  QCPAbstractItem *itemAt(const QPointF &pos,
2061  bool onlySelectable = false) const;
2062  bool hasItem(QCPAbstractItem *item) const;
2063 
2064  // layer interface:
2065  QCPLayer *layer(const QString &name) const;
2066  QCPLayer *layer(int index) const;
2068  bool setCurrentLayer(const QString &name);
2070  int layerCount() const;
2071  bool addLayer(const QString &name, QCPLayer *otherLayer = 0,
2072  LayerInsertMode insertMode = limAbove);
2073  bool removeLayer(QCPLayer *layer);
2074  bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer,
2075  LayerInsertMode insertMode = limAbove);
2076 
2077  // axis rect/layout interface:
2078  int axisRectCount() const;
2079  QCPAxisRect *axisRect(int index = 0) const;
2080  QList<QCPAxisRect *> axisRects() const;
2081  QCPLayoutElement *layoutElementAt(const QPointF &pos) const;
2082  Q_SLOT void rescaleAxes(bool onlyVisiblePlottables = false);
2083 
2084  QList<QCPAxis *> selectedAxes() const;
2085  QList<QCPLegend *> selectedLegends() const;
2086  Q_SLOT void deselectAll();
2087 
2088  bool savePdf(const QString &fileName, bool noCosmeticPen = false,
2089  int width = 0, int height = 0,
2090  const QString &pdfCreator = QString(),
2091  const QString &pdfTitle = QString());
2092  bool savePng(const QString &fileName, int width = 0, int height = 0,
2093  double scale = 1.0, int quality = -1);
2094  bool saveJpg(const QString &fileName, int width = 0, int height = 0,
2095  double scale = 1.0, int quality = -1);
2096  bool saveBmp(const QString &fileName, int width = 0, int height = 0,
2097  double scale = 1.0);
2098  bool saveRastered(const QString &fileName, int width, int height,
2099  double scale, const char *format, int quality = -1);
2100  QPixmap toPixmap(int width = 0, int height = 0, double scale = 1.0);
2101  void toPainter(QCPPainter *painter, int width = 0, int height = 0);
2102  Q_SLOT void replot(
2104 
2105  QCPAxis *xAxis, *yAxis, *xAxis2, *yAxis2;
2107 
2108  signals:
2109  void mouseDoubleClick(QMouseEvent *event);
2110  void mousePress(QMouseEvent *event);
2111  void mouseMove(QMouseEvent *event);
2112  void mouseRelease(QMouseEvent *event);
2113  void mouseWheel(QWheelEvent *event);
2114 
2115  void plottableClick(QCPAbstractPlottable *plottable, QMouseEvent *event);
2117  QMouseEvent *event);
2118  void itemClick(QCPAbstractItem *item, QMouseEvent *event);
2119  void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event);
2121  QMouseEvent *event);
2123  QMouseEvent *event);
2125  QMouseEvent *event);
2127  QMouseEvent *event);
2128  void titleClick(QMouseEvent *event, QCPPlotTitle *title);
2129  void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title);
2130 
2133  void afterReplot();
2134 
2135  protected:
2136  // property members:
2137  QRect mViewport;
2140  QList<QCPAbstractPlottable *> mPlottables;
2141  QList<QCPGraph *> mGraphs; // extra list of plottables also in mPlottables
2142  // that are of type QCPGraph
2143  QList<QCPAbstractItem *> mItems;
2144  QList<QCPLayer *> mLayers;
2145  QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
2146  QCP::Interactions mInteractions;
2153  Qt::AspectRatioMode mBackgroundScaledMode;
2155  QCP::PlottingHints mPlottingHints;
2156  Qt::KeyboardModifier mMultiSelectModifier;
2157 
2158  // non-property members:
2159  QPixmap mPaintBuffer;
2161  QPointer<QCPLayoutElement> mMouseEventElement;
2163 
2164  // reimplemented virtual methods:
2165  virtual QSize minimumSizeHint() const;
2166  virtual QSize sizeHint() const;
2167  virtual void paintEvent(QPaintEvent *event);
2168  virtual void resizeEvent(QResizeEvent *event);
2169  virtual void mouseDoubleClickEvent(QMouseEvent *event);
2170  virtual void mousePressEvent(QMouseEvent *event);
2171  virtual void mouseMoveEvent(QMouseEvent *event);
2172  virtual void mouseReleaseEvent(QMouseEvent *event);
2173  virtual void wheelEvent(QWheelEvent *event);
2174 
2175  // introduced virtual methods:
2176  virtual void draw(QCPPainter *painter);
2177  virtual void axisRemoved(QCPAxis *axis);
2178  virtual void legendRemoved(QCPLegend *legend);
2179 
2180  // non-virtual methods:
2181  void updateLayerIndices() const;
2182  QCPLayerable *layerableAt(const QPointF &pos, bool onlySelectable,
2183  QVariant *selectionDetails = 0) const;
2184  void drawBackground(QCPPainter *painter);
2185 
2186  friend class QCPLegend;
2187  friend class QCPAxis;
2188  friend class QCPLayer;
2189  friend class QCPAxisRect;
2190 };
2191 
2193  Q_GADGET
2194  public:
2202  ciRGB
2203  ,
2204  ciHSV
2207  };
2208  Q_ENUMS(ColorInterpolation)
2209 
2210 
2215  gpGrayscale
2217  ,
2218  gpHot
2220  ,
2221  gpCold
2223  ,
2224  gpNight
2226  ,
2227  gpCandy
2228  ,
2229  gpGeography
2231  ,
2232  gpIon
2235  ,
2236  gpThermal
2238  ,
2239  gpPolar
2242  ,
2243  gpSpectrum
2246  ,
2247  gpJet
2250  ,
2251  gpHues
2253  };
2254  Q_ENUMS(GradientPreset)
2255 
2257  bool operator==(const QCPColorGradient &other) const;
2258  bool operator!=(const QCPColorGradient &other) const {
2259  return !(*this == other);
2260  }
2261 
2262  // getters:
2263  int levelCount() const { return mLevelCount; }
2264  QMap<double, QColor> colorStops() const { return mColorStops; }
2265  ColorInterpolation colorInterpolation() const { return mColorInterpolation; }
2266  bool periodic() const { return mPeriodic; }
2267 
2268  // setters:
2269  void setLevelCount(int n);
2270  void setColorStops(const QMap<double, QColor> &colorStops);
2271  void setColorStopAt(double position, const QColor &color);
2273  void setPeriodic(bool enabled);
2274 
2275  // non-property methods:
2276  void colorize(const double *data, const QCPRange &range, QRgb *scanLine,
2277  int n, int dataIndexFactor = 1, bool logarithmic = false);
2278  QRgb color(double position, const QCPRange &range, bool logarithmic = false);
2282 
2283  protected:
2285 
2286  // property members:
2288  QMap<double, QColor> mColorStops;
2291 
2292  // non-property members:
2293  QVector<QRgb> mColorBuffer;
2295 };
2296 
2298  Q_OBJECT
2300  Q_PROPERTY(QPixmap background READ background WRITE setBackground)
2301  Q_PROPERTY(
2302  bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
2303  Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode
2304  WRITE setBackgroundScaledMode)
2305  Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
2306  Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
2308  public:
2309  explicit QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes = true);
2310  virtual ~QCPAxisRect();
2311 
2312  // getters:
2313  QPixmap background() const { return mBackgroundPixmap; }
2314  bool backgroundScaled() const { return mBackgroundScaled; }
2315  Qt::AspectRatioMode backgroundScaledMode() const {
2316  return mBackgroundScaledMode;
2317  }
2318  Qt::Orientations rangeDrag() const { return mRangeDrag; }
2319  Qt::Orientations rangeZoom() const { return mRangeZoom; }
2320  QCPAxis *rangeDragAxis(Qt::Orientation orientation);
2321  QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
2322  double rangeZoomFactor(Qt::Orientation orientation);
2323 
2324  // setters:
2325  void setBackground(const QPixmap &pm);
2326  void setBackground(const QPixmap &pm, bool scaled,
2327  Qt::AspectRatioMode mode = Qt::KeepAspectRatioByExpanding);
2328  void setBackground(const QBrush &brush);
2329  void setBackgroundScaled(bool scaled);
2330  void setBackgroundScaledMode(Qt::AspectRatioMode mode);
2331  void setRangeDrag(Qt::Orientations orientations);
2332  void setRangeZoom(Qt::Orientations orientations);
2333  void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical);
2334  void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical);
2335  void setRangeZoomFactor(double horizontalFactor, double verticalFactor);
2336  void setRangeZoomFactor(double factor);
2337 
2338  // non-property methods:
2339  int axisCount(QCPAxis::AxisType type) const;
2340  QCPAxis *axis(QCPAxis::AxisType type, int index = 0) const;
2341  QList<QCPAxis *> axes(QCPAxis::AxisTypes types) const;
2342  QList<QCPAxis *> axes() const;
2344  QList<QCPAxis *> addAxes(QCPAxis::AxisTypes types);
2345  bool removeAxis(QCPAxis *axis);
2346  QCPLayoutInset *insetLayout() const { return mInsetLayout; }
2347 
2348  void setupFullAxesBox(bool connectRanges = false);
2349  QList<QCPAbstractPlottable *> plottables() const;
2350  QList<QCPGraph *> graphs() const;
2351  QList<QCPAbstractItem *> items() const;
2352 
2353  // read-only interface imitating a QRect:
2354  int left() const { return mRect.left(); }
2355  int right() const { return mRect.right(); }
2356  int top() const { return mRect.top(); }
2357  int bottom() const { return mRect.bottom(); }
2358  int width() const { return mRect.width(); }
2359  int height() const { return mRect.height(); }
2360  QSize size() const { return mRect.size(); }
2361  QPoint topLeft() const { return mRect.topLeft(); }
2362  QPoint topRight() const { return mRect.topRight(); }
2363  QPoint bottomLeft() const { return mRect.bottomLeft(); }
2364  QPoint bottomRight() const { return mRect.bottomRight(); }
2365  QPoint center() const { return mRect.center(); }
2366 
2367  // reimplemented virtual methods:
2368  virtual void update(UpdatePhase phase);
2369  virtual QList<QCPLayoutElement *> elements(bool recursive) const;
2370 
2371  protected:
2372  // property members:
2377  Qt::AspectRatioMode mBackgroundScaledMode;
2379  Qt::Orientations mRangeDrag, mRangeZoom;
2380  QPointer<QCPAxis> mRangeDragHorzAxis, mRangeDragVertAxis, mRangeZoomHorzAxis,
2382  double mRangeZoomFactorHorz, mRangeZoomFactorVert;
2383  // non-property members:
2384  QCPRange mDragStartHorzRange, mDragStartVertRange;
2385  QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2386  QPoint mDragStart;
2388  QHash<QCPAxis::AxisType, QList<QCPAxis *> > mAxes;
2389 
2390  // reimplemented virtual methods:
2391  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2392  virtual void draw(QCPPainter *painter);
2394  // events:
2395  virtual void mousePressEvent(QMouseEvent *event);
2396  virtual void mouseMoveEvent(QMouseEvent *event);
2397  virtual void mouseReleaseEvent(QMouseEvent *event);
2398  virtual void wheelEvent(QWheelEvent *event);
2399 
2400  // non-property methods:
2401  void drawBackground(QCPPainter *painter);
2403 
2404  private:
2405  Q_DISABLE_COPY(QCPAxisRect)
2406 
2407  friend class QCustomPlot;
2408 };
2409 
2411  Q_OBJECT
2413  Q_PROPERTY(QCPLegend *parentLegend READ parentLegend)
2414  Q_PROPERTY(QFont font READ font WRITE setFont)
2415  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2416  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2417  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
2418  setSelectedTextColor)
2419  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
2420  selectionChanged)
2421  Q_PROPERTY(
2422  bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
2424  public:
2426 
2427  // getters:
2428  QCPLegend *parentLegend() const { return mParentLegend; }
2429  QFont font() const { return mFont; }
2430  QColor textColor() const { return mTextColor; }
2431  QFont selectedFont() const { return mSelectedFont; }
2432  QColor selectedTextColor() const { return mSelectedTextColor; }
2433  bool selectable() const { return mSelectable; }
2434  bool selected() const { return mSelected; }
2435 
2436  // setters:
2437  void setFont(const QFont &font);
2438  void setTextColor(const QColor &color);
2439  void setSelectedFont(const QFont &font);
2440  void setSelectedTextColor(const QColor &color);
2441  Q_SLOT void setSelectable(bool selectable);
2442  Q_SLOT void setSelected(bool selected);
2443 
2444  // reimplemented virtual methods:
2445  virtual double selectTest(const QPointF &pos, bool onlySelectable,
2446  QVariant *details = 0) const;
2447 
2448  signals:
2449  void selectionChanged(bool selected);
2450  void selectableChanged(bool selectable);
2451 
2452  protected:
2453  // property members:
2455  QFont mFont;
2456  QColor mTextColor;
2459  bool mSelectable, mSelected;
2460 
2461  // reimplemented virtual methods:
2463  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2464  virtual QRect clipRect() const;
2465  virtual void draw(QCPPainter *painter) = 0;
2466  // events:
2467  virtual void selectEvent(QMouseEvent *event, bool additive,
2468  const QVariant &details,
2469  bool *selectionStateChanged);
2470  virtual void deselectEvent(bool *selectionStateChanged);
2471 
2472  private:
2473  Q_DISABLE_COPY(QCPAbstractLegendItem)
2474 
2475  friend class QCPLegend;
2476 };
2477 
2479  Q_OBJECT
2480  public:
2482 
2483  // getters:
2484  QCPAbstractPlottable *plottable() { return mPlottable; }
2485 
2486  protected:
2487  // property members:
2489 
2490  // reimplemented virtual methods:
2491  virtual void draw(QCPPainter *painter);
2492  virtual QSize minimumSizeHint() const;
2493 
2494  // non-virtual methods:
2495  QPen getIconBorderPen() const;
2496  QColor getTextColor() const;
2497  QFont getFont() const;
2498 };
2499 
2501  Q_OBJECT
2503  Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
2504  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2505  Q_PROPERTY(QFont font READ font WRITE setFont)
2506  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2507  Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
2508  Q_PROPERTY(int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
2509  Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
2510  Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE
2511  setSelectableParts NOTIFY selectionChanged)
2512  Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
2513  setSelectedParts NOTIFY selectableChanged)
2514  Q_PROPERTY(
2515  QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
2516  Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE
2517  setSelectedIconBorderPen)
2518  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2519  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2520  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
2521  setSelectedTextColor)
2523  public:
2530  spNone = 0x000
2531  ,
2532  spLegendBox = 0x001
2533  ,
2534  spItems = 0x002
2536  };
2537  Q_FLAGS(SelectablePart SelectableParts)
2538  Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2539 
2540  explicit QCPLegend();
2541  virtual ~QCPLegend();
2542 
2543  // getters:
2544  QPen borderPen() const { return mBorderPen; }
2545  QBrush brush() const { return mBrush; }
2546  QFont font() const { return mFont; }
2547  QColor textColor() const { return mTextColor; }
2548  QSize iconSize() const { return mIconSize; }
2549  int iconTextPadding() const { return mIconTextPadding; }
2550  QPen iconBorderPen() const { return mIconBorderPen; }
2551  SelectableParts selectableParts() const { return mSelectableParts; }
2552  SelectableParts selectedParts() const;
2553  QPen selectedBorderPen() const { return mSelectedBorderPen; }
2554  QPen selectedIconBorderPen() const { return mSelectedIconBorderPen; }
2555  QBrush selectedBrush() const { return mSelectedBrush; }
2556  QFont selectedFont() const { return mSelectedFont; }
2557  QColor selectedTextColor() const { return mSelectedTextColor; }
2558 
2559  // setters:
2560  void setBorderPen(const QPen &pen);
2561  void setBrush(const QBrush &brush);
2562  void setFont(const QFont &font);
2563  void setTextColor(const QColor &color);
2564  void setIconSize(const QSize &size);
2565  void setIconSize(int width, int height);
2566  void setIconTextPadding(int padding);
2567  void setIconBorderPen(const QPen &pen);
2568  Q_SLOT void setSelectableParts(const SelectableParts &selectableParts);
2569  Q_SLOT void setSelectedParts(const SelectableParts &selectedParts);
2570  void setSelectedBorderPen(const QPen &pen);
2571  void setSelectedIconBorderPen(const QPen &pen);
2572  void setSelectedBrush(const QBrush &brush);
2573  void setSelectedFont(const QFont &font);
2574  void setSelectedTextColor(const QColor &color);
2575 
2576  // reimplemented virtual methods:
2577  virtual double selectTest(const QPointF &pos, bool onlySelectable,
2578  QVariant *details = 0) const;
2579 
2580  // non-virtual methods:
2581  QCPAbstractLegendItem *item(int index) const;
2583  const QCPAbstractPlottable *plottable) const;
2584  int itemCount() const;
2585  bool hasItem(QCPAbstractLegendItem *item) const;
2586  bool hasItemWithPlottable(const QCPAbstractPlottable *plottable) const;
2588  bool removeItem(int index);
2590  void clearItems();
2591  QList<QCPAbstractLegendItem *> selectedItems() const;
2592 
2593  signals:
2594  void selectionChanged(QCPLegend::SelectableParts parts);
2595  void selectableChanged(QCPLegend::SelectableParts parts);
2596 
2597  protected:
2598  // property members:
2599  QPen mBorderPen, mIconBorderPen;
2600  QBrush mBrush;
2601  QFont mFont;
2602  QColor mTextColor;
2603  QSize mIconSize;
2605  SelectableParts mSelectedParts, mSelectableParts;
2606  QPen mSelectedBorderPen, mSelectedIconBorderPen;
2610 
2611  // reimplemented virtual methods:
2612  virtual void parentPlotInitialized(QCustomPlot *parentPlot);
2614  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2615  virtual void draw(QCPPainter *painter);
2616  // events:
2617  virtual void selectEvent(QMouseEvent *event, bool additive,
2618  const QVariant &details,
2619  bool *selectionStateChanged);
2620  virtual void deselectEvent(bool *selectionStateChanged);
2621 
2622  // non-virtual methods:
2623  QPen getBorderPen() const;
2624  QBrush getBrush() const;
2625 
2626  private:
2627  Q_DISABLE_COPY(QCPLegend)
2628 
2629  friend class QCustomPlot;
2631 };
2632 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
2633 Q_DECLARE_METATYPE(QCPLegend::SelectablePart)
2634 
2636  Q_OBJECT
2638  Q_PROPERTY(QString text READ text WRITE setText)
2639  Q_PROPERTY(QFont font READ font WRITE setFont)
2640  Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2641  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2642  Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE
2643  setSelectedTextColor)
2644  Q_PROPERTY(bool selectable READ selectable WRITE setSelectable NOTIFY
2645  selectableChanged)
2646  Q_PROPERTY(
2647  bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
2649  public:
2650  explicit QCPPlotTitle(QCustomPlot *parentPlot);
2651  explicit QCPPlotTitle(QCustomPlot *parentPlot, const QString &text);
2652 
2653  // getters:
2654  QString text() const { return mText; }
2655  QFont font() const { return mFont; }
2656  QColor textColor() const { return mTextColor; }
2657  QFont selectedFont() const { return mSelectedFont; }
2658  QColor selectedTextColor() const { return mSelectedTextColor; }
2659  bool selectable() const { return mSelectable; }
2660  bool selected() const { return mSelected; }
2661 
2662  // setters:
2663  void setText(const QString &text);
2664  void setFont(const QFont &font);
2665  void setTextColor(const QColor &color);
2666  void setSelectedFont(const QFont &font);
2667  void setSelectedTextColor(const QColor &color);
2668  Q_SLOT void setSelectable(bool selectable);
2669  Q_SLOT void setSelected(bool selected);
2670 
2671  // reimplemented virtual methods:
2672  virtual double selectTest(const QPointF &pos, bool onlySelectable,
2673  QVariant *details = 0) const;
2674 
2675  signals:
2676  void selectionChanged(bool selected);
2677  void selectableChanged(bool selectable);
2678 
2679  protected:
2680  // property members:
2681  QString mText;
2682  QFont mFont;
2683  QColor mTextColor;
2687  bool mSelectable, mSelected;
2688 
2689  // reimplemented virtual methods:
2690  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2691  virtual void draw(QCPPainter *painter);
2692  virtual QSize minimumSizeHint() const;
2693  virtual QSize maximumSizeHint() const;
2694  // events:
2695  virtual void selectEvent(QMouseEvent *event, bool additive,
2696  const QVariant &details,
2697  bool *selectionStateChanged);
2698  virtual void deselectEvent(bool *selectionStateChanged);
2699 
2700  // non-virtual methods:
2701  QFont mainFont() const;
2702  QColor mainTextColor() const;
2703 
2704  private:
2705  Q_DISABLE_COPY(QCPPlotTitle)
2706 };
2707 
2709  Q_OBJECT
2710  public:
2711  explicit QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale);
2712 
2713  protected:
2717  // re-using some methods of QCPAxisRect to make them available to friend class
2718  // QCPColorScale
2723  using QCPAxisRect::update;
2725  virtual void draw(QCPPainter *painter);
2727  Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
2728  Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
2729  friend class QCPColorScale;
2730 };
2731 
2733  Q_OBJECT
2735  Q_PROPERTY(QCPAxis::AxisType type READ type WRITE setType)
2736  Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
2737  dataRangeChanged)
2738  Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE
2739  setDataScaleType NOTIFY dataScaleTypeChanged)
2740  Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
2741  gradientChanged)
2742  Q_PROPERTY(QString label READ label WRITE setLabel)
2743  Q_PROPERTY(int barWidth READ barWidth WRITE setBarWidth)
2744  Q_PROPERTY(bool rangeDrag READ rangeDrag WRITE setRangeDrag)
2745  Q_PROPERTY(bool rangeZoom READ rangeZoom WRITE setRangeZoom)
2747  public:
2748  explicit QCPColorScale(QCustomPlot *parentPlot);
2749  virtual ~QCPColorScale();
2750 
2751  // getters:
2752  QCPAxis *axis() const { return mColorAxis.data(); }
2753  QCPAxis::AxisType type() const { return mType; }
2754  QCPRange dataRange() const { return mDataRange; }
2755  QCPAxis::ScaleType dataScaleType() const { return mDataScaleType; }
2756  QCPColorGradient gradient() const { return mGradient; }
2757  QString label() const;
2758  int barWidth() const { return mBarWidth; }
2759  bool rangeDrag() const;
2760  bool rangeZoom() const;
2761 
2762  // setters:
2764  Q_SLOT void setDataRange(const QCPRange &dataRange);
2765  Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType);
2766  Q_SLOT void setGradient(const QCPColorGradient &gradient);
2767  void setLabel(const QString &str);
2768  void setBarWidth(int width);
2769  void setRangeDrag(bool enabled);
2770  void setRangeZoom(bool enabled);
2771 
2772  // non-property methods:
2773  QList<QCPColorMap *> colorMaps() const;
2774  void rescaleDataRange(bool onlyVisibleMaps);
2775 
2776  // reimplemented virtual methods:
2777  virtual void update(UpdatePhase phase);
2778 
2779  signals:
2780  void dataRangeChanged(QCPRange newRange);
2783 
2784  protected:
2785  // property members:
2791 
2792  // non-property members:
2793  QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
2794  QPointer<QCPAxis> mColorAxis;
2795 
2796  // reimplemented virtual methods:
2797  virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const;
2798  // events:
2799  virtual void mousePressEvent(QMouseEvent *event);
2800  virtual void mouseMoveEvent(QMouseEvent *event);
2801  virtual void mouseReleaseEvent(QMouseEvent *event);
2802  virtual void wheelEvent(QWheelEvent *event);
2803 
2804  private:
2805  Q_DISABLE_COPY(QCPColorScale)
2806 
2808 };
2809 
2813  public:
2815  QCPData(double key, double value);
2816  double key, value;
2817  double keyErrorPlus, keyErrorMinus;
2818  double valueErrorPlus, valueErrorMinus;
2819 };
2820 Q_DECLARE_TYPEINFO(QCPData, Q_MOVABLE_TYPE);
2821 
2829 typedef QMap<double, QCPData> QCPDataMap;
2830 typedef QMapIterator<double, QCPData> QCPDataMapIterator;
2831 typedef QMutableMapIterator<double, QCPData> QCPDataMutableMapIterator;
2832 
2834  Q_OBJECT
2836  Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2837  Q_PROPERTY(
2838  QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2839  Q_PROPERTY(ErrorType errorType READ errorType WRITE setErrorType)
2840  Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen)
2841  Q_PROPERTY(double errorBarSize READ errorBarSize WRITE setErrorBarSize)
2842  Q_PROPERTY(bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE
2843  setErrorBarSkipSymbol)
2844  Q_PROPERTY(QCPGraph *channelFillGraph READ channelFillGraph WRITE
2845  setChannelFillGraph)
2846  Q_PROPERTY(
2847  bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
2849  public:
2854  enum LineStyle {
2855  lsNone
2858  ,
2859  lsLine
2860  ,
2861  lsStepLeft
2863  ,
2864  lsStepRight
2866  ,
2867  lsStepCenter
2869  ,
2870  lsImpulse
2873  };
2874  Q_ENUMS(LineStyle)
2878  enum ErrorType {
2879  etNone
2880  ,
2881  etKey
2882  ,
2883  etValue
2884  ,
2885  etBoth
2887  };
2888  Q_ENUMS(ErrorType)
2889 
2890  explicit QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis);
2891  virtual ~QCPGraph();
2892 
2893  // getters:
2894  QCPDataMap *data() const { return mData; }
2895  LineStyle lineStyle() const { return mLineStyle; }
2896  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
2897  ErrorType errorType() const { return mErrorType; }
2898  QPen errorPen() const { return mErrorPen; }
2899  double errorBarSize() const { return mErrorBarSize; }
2900  bool errorBarSkipSymbol() const { return mErrorBarSkipSymbol; }
2901  QCPGraph *channelFillGraph() const { return mChannelFillGraph.data(); }
2902  bool adaptiveSampling() const { return mAdaptiveSampling; }
2903 
2904  // setters:
2905  void setData(QCPDataMap *data, bool copy = false);
2906  void setData(const QVector<double> &key, const QVector<double> &value);
2907  void setDataKeyError(const QVector<double> &key, const QVector<double> &value,
2908  const QVector<double> &keyError);
2909  void setDataKeyError(const QVector<double> &key, const QVector<double> &value,
2910  const QVector<double> &keyErrorMinus,
2911  const QVector<double> &keyErrorPlus);
2912  void setDataValueError(const QVector<double> &key,
2913  const QVector<double> &value,
2914  const QVector<double> &valueError);
2915  void setDataValueError(const QVector<double> &key,
2916  const QVector<double> &value,
2917  const QVector<double> &valueErrorMinus,
2918  const QVector<double> &valueErrorPlus);
2919  void setDataBothError(const QVector<double> &key,
2920  const QVector<double> &value,
2921  const QVector<double> &keyError,
2922  const QVector<double> &valueError);
2923  void setDataBothError(const QVector<double> &key,
2924  const QVector<double> &value,
2925  const QVector<double> &keyErrorMinus,
2926  const QVector<double> &keyErrorPlus,
2927  const QVector<double> &valueErrorMinus,
2928  const QVector<double> &valueErrorPlus);
2930  void setScatterStyle(const QCPScatterStyle &style);
2931  void setErrorType(ErrorType errorType);
2932  void setErrorPen(const QPen &pen);
2933  void setErrorBarSize(double size);
2934  void setErrorBarSkipSymbol(bool enabled);
2935  void setChannelFillGraph(QCPGraph *targetGraph);
2936  void setAdaptiveSampling(bool enabled);
2937 
2938  // non-property methods:
2939  void addData(const QCPDataMap &dataMap);
2940  void addData(const QCPData &data);
2941  void addData(double key, double value);
2942  void addData(const QVector<double> &keys, const QVector<double> &values);
2943  void removeDataBefore(double key);
2944  void removeDataAfter(double key);
2945  void removeData(double fromKey, double toKey);
2946  void removeData(double key);
2947 
2948  // reimplemented virtual methods:
2949  virtual void clearData();
2950  virtual double selectTest(const QPointF &pos, bool onlySelectable,
2951  QVariant *details = 0) const;
2955  void rescaleAxes(bool onlyEnlarge, bool includeErrorBars)
2956  const; // overloads base class interface
2957  void rescaleKeyAxis(bool onlyEnlarge, bool includeErrorBars)
2958  const; // overloads base class interface
2959  void rescaleValueAxis(bool onlyEnlarge, bool includeErrorBars)
2960  const; // overloads base class interface
2961 
2962  protected:
2963  // property members:
2971  QPointer<QCPGraph> mChannelFillGraph;
2973 
2974  // reimplemented virtual methods:
2975  virtual void draw(QCPPainter *painter);
2976  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
2977  virtual QCPRange getKeyRange(bool &foundRange,
2978  SignDomain inSignDomain = sdBoth) const;
2979  virtual QCPRange getValueRange(bool &foundRange,
2980  SignDomain inSignDomain = sdBoth) const;
2982  bool &foundRange, SignDomain inSignDomain,
2983  bool includeErrors) const; // overloads base class interface
2985  bool &foundRange, SignDomain inSignDomain,
2986  bool includeErrors) const; // overloads base class interface
2987 
2988  // introduced virtual methods:
2989  virtual void drawFill(QCPPainter *painter, QVector<QPointF> *lineData) const;
2990  virtual void drawScatterPlot(QCPPainter *painter,
2991  QVector<QCPData> *scatterData) const;
2992  virtual void drawLinePlot(QCPPainter *painter,
2993  QVector<QPointF> *lineData) const;
2994  virtual void drawImpulsePlot(QCPPainter *painter,
2995  QVector<QPointF> *lineData) const;
2996 
2997  // non-virtual methods:
2998  void getPreparedData(QVector<QCPData> *lineData,
2999  QVector<QCPData> *scatterData) const;
3000  void getPlotData(QVector<QPointF> *lineData,
3001  QVector<QCPData> *scatterData) const;
3002  void getScatterPlotData(QVector<QCPData> *scatterData) const;
3003  void getLinePlotData(QVector<QPointF> *linePixelData,
3004  QVector<QCPData> *scatterData) const;
3005  void getStepLeftPlotData(QVector<QPointF> *linePixelData,
3006  QVector<QCPData> *scatterData) const;
3007  void getStepRightPlotData(QVector<QPointF> *linePixelData,
3008  QVector<QCPData> *scatterData) const;
3009  void getStepCenterPlotData(QVector<QPointF> *linePixelData,
3010  QVector<QCPData> *scatterData) const;
3011  void getImpulsePlotData(QVector<QPointF> *linePixelData,
3012  QVector<QCPData> *scatterData) const;
3013  void drawError(QCPPainter *painter, double x, double y,
3014  const QCPData &data) const;
3015  void getVisibleDataBounds(QCPDataMap::const_iterator &lower,
3016  QCPDataMap::const_iterator &upper) const;
3017  int countDataInBounds(const QCPDataMap::const_iterator &lower,
3018  const QCPDataMap::const_iterator &upper,
3019  int maxCount) const;
3020  void addFillBasePoints(QVector<QPointF> *lineData) const;
3021  void removeFillBasePoints(QVector<QPointF> *lineData) const;
3022  QPointF lowerFillBasePoint(double lowerKey) const;
3023  QPointF upperFillBasePoint(double upperKey) const;
3024  const QPolygonF getChannelFillPolygon(const QVector<QPointF> *lineData) const;
3025  int findIndexBelowX(const QVector<QPointF> *data, double x) const;
3026  int findIndexAboveX(const QVector<QPointF> *data, double x) const;
3027  int findIndexBelowY(const QVector<QPointF> *data, double y) const;
3028  int findIndexAboveY(const QVector<QPointF> *data, double y) const;
3029  double pointDistance(const QPointF &pixelPoint) const;
3030 
3031  friend class QCustomPlot;
3032  friend class QCPLegend;
3033 };
3034 
3038  public:
3040  QCPCurveData(double t, double key, double value);
3041  double t, key, value;
3042 };
3044 
3053 typedef QMap<double, QCPCurveData> QCPCurveDataMap;
3054 typedef QMapIterator<double, QCPCurveData> QCPCurveDataMapIterator;
3055 typedef QMutableMapIterator<double, QCPCurveData>
3057 
3059  Q_OBJECT
3061  Q_PROPERTY(
3062  QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
3063  Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
3065  public:
3070  enum LineStyle {
3071  lsNone
3072  ,
3073  lsLine
3074  };
3075  explicit QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis);
3076  virtual ~QCPCurve();
3077 
3078  // getters:
3079  QCPCurveDataMap *data() const { return mData; }
3080  QCPScatterStyle scatterStyle() const { return mScatterStyle; }
3081  LineStyle lineStyle() const { return mLineStyle; }
3082 
3083  // setters:
3084  void setData(QCPCurveDataMap *data, bool copy = false);
3085  void setData(const QVector<double> &t, const QVector<double> &key,
3086  const QVector<double> &value);
3087  void setData(const QVector<double> &key, const QVector<double> &value);
3088  void setScatterStyle(const QCPScatterStyle &style);
3090 
3091  // non-property methods:
3092  void addData(const QCPCurveDataMap &dataMap);
3093  void addData(const QCPCurveData &data);
3094  void addData(double t, double key, double value);
3095  void addData(double key, double value);
3096  void addData(const QVector<double> &ts, const QVector<double> &keys,
3097  const QVector<double> &values);
3098  void removeDataBefore(double t);
3099  void removeDataAfter(double t);
3100  void removeData(double fromt, double tot);
3101  void removeData(double t);
3102 
3103  // reimplemented virtual methods:
3104  virtual void clearData();
3105  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3106  QVariant *details = 0) const;
3107 
3108  protected:
3109  // property members:
3113 
3114  // reimplemented virtual methods:
3115  virtual void draw(QCPPainter *painter);
3116  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
3117  virtual QCPRange getKeyRange(bool &foundRange,
3118  SignDomain inSignDomain = sdBoth) const;
3119  virtual QCPRange getValueRange(bool &foundRange,
3120  SignDomain inSignDomain = sdBoth) const;
3121 
3122  // introduced virtual methods:
3123  virtual void drawScatterPlot(QCPPainter *painter,
3124  const QVector<QPointF> *pointData) const;
3125 
3126  // non-virtual methods:
3127  void getCurveData(QVector<QPointF> *lineData) const;
3128  int getRegion(double x, double y, double rectLeft, double rectTop,
3129  double rectRight, double rectBottom) const;
3130  QPointF getOptimizedPoint(int prevRegion, double prevKey, double prevValue,
3131  double key, double value, double rectLeft,
3132  double rectTop, double rectRight,
3133  double rectBottom) const;
3134  QVector<QPointF> getOptimizedCornerPoints(int prevRegion, int currentRegion,
3135  double prevKey, double prevValue,
3136  double key, double value,
3137  double rectLeft, double rectTop,
3138  double rectRight,
3139  double rectBottom) const;
3140  bool mayTraverse(int prevRegion, int currentRegion) const;
3141  bool getTraverse(double prevKey, double prevValue, double key, double value,
3142  double rectLeft, double rectTop, double rectRight,
3143  double rectBottom, QPointF &crossA, QPointF &crossB) const;
3144  void getTraverseCornerPoints(int prevRegion, int currentRegion,
3145  double rectLeft, double rectTop,
3146  double rectRight, double rectBottom,
3147  QVector<QPointF> &beforeTraverse,
3148  QVector<QPointF> &afterTraverse) const;
3149  double pointDistance(const QPointF &pixelPoint) const;
3150 
3151  friend class QCustomPlot;
3152  friend class QCPLegend;
3153 };
3154 
3157 class QCP_LIB_DECL QCPBarsGroup : public QObject {
3158  Q_OBJECT
3160  Q_PROPERTY(SpacingType spacingType READ spacingType WRITE setSpacingType)
3161  Q_PROPERTY(double spacing READ spacing WRITE setSpacing)
3163  public:
3171  stAbsolute
3172  ,
3173  stAxisRectRatio
3175  ,
3176  stPlotCoords
3178  };
3181 
3182  // getters:
3183  SpacingType spacingType() const { return mSpacingType; }
3184  double spacing() const { return mSpacing; }
3185 
3186  // setters:
3187  void setSpacingType(SpacingType spacingType);
3188  void setSpacing(double spacing);
3189 
3190  // non-virtual methods:
3191  QList<QCPBars *> bars() const { return mBars; }
3192  QCPBars *bars(int index) const;
3193  int size() const { return mBars.size(); }
3194  bool isEmpty() const { return mBars.isEmpty(); }
3195  void clear();
3196  bool contains(QCPBars *bars) const { return mBars.contains(bars); }
3197  void append(QCPBars *bars);
3198  void insert(int i, QCPBars *bars);
3199  void remove(QCPBars *bars);
3200 
3201  protected:
3202  // non-property members:
3205  double mSpacing;
3206  QList<QCPBars *> mBars;
3207 
3208  // non-virtual methods:
3209  void registerBars(QCPBars *bars);
3211 
3212  // virtual methods:
3213  double keyPixelOffset(const QCPBars *bars, double keyCoord);
3214  double getPixelSpacing(const QCPBars *bars, double keyCoord);
3215 
3216  private:
3217  Q_DISABLE_COPY(QCPBarsGroup)
3218 
3219  friend class QCPBars;
3220 };
3221 
3223  public:
3225  QCPBarData(double key, double value);
3226  double key, value;
3227 };
3229 
3237 typedef QMap<double, QCPBarData> QCPBarDataMap;
3238 typedef QMapIterator<double, QCPBarData> QCPBarDataMapIterator;
3239 typedef QMutableMapIterator<double, QCPBarData> QCPBarDataMutableMapIterator;
3240 
3242  Q_OBJECT
3244  Q_PROPERTY(double width READ width WRITE setWidth)
3245  Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType)
3246  Q_PROPERTY(QCPBarsGroup *barsGroup READ barsGroup WRITE setBarsGroup)
3247  Q_PROPERTY(double baseValue READ baseValue WRITE setBaseValue)
3248  Q_PROPERTY(QCPBars *barBelow READ barBelow)
3249  Q_PROPERTY(QCPBars *barAbove READ barAbove)
3251  public:
3258  enum WidthType {
3259  wtAbsolute
3260  ,
3261  wtAxisRectRatio
3262  ,
3263  wtPlotCoords
3265  };
3266  Q_ENUMS(WidthType)
3267 
3268  explicit QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis);
3269  virtual ~QCPBars();
3270 
3271  // getters:
3272  double width() const { return mWidth; }
3273  WidthType widthType() const { return mWidthType; }
3274  QCPBarsGroup *barsGroup() const { return mBarsGroup; }
3275  double baseValue() const { return mBaseValue; }
3276  QCPBars *barBelow() const { return mBarBelow.data(); }
3277  QCPBars *barAbove() const { return mBarAbove.data(); }
3278  QCPBarDataMap *data() const { return mData; }
3279 
3280  // setters:
3281  void setWidth(double width);
3282  void setWidthType(WidthType widthType);
3283  void setBarsGroup(QCPBarsGroup *barsGroup);
3284  void setBaseValue(double baseValue);
3285  void setData(QCPBarDataMap *data, bool copy = false);
3286  void setData(const QVector<double> &key, const QVector<double> &value);
3287 
3288  // non-property methods:
3289  void moveBelow(QCPBars *bars);
3290  void moveAbove(QCPBars *bars);
3291  void addData(const QCPBarDataMap &dataMap);
3292  void addData(const QCPBarData &data);
3293  void addData(double key, double value);
3294  void addData(const QVector<double> &keys, const QVector<double> &values);
3295  void removeDataBefore(double key);
3296  void removeDataAfter(double key);
3297  void removeData(double fromKey, double toKey);
3298  void removeData(double key);
3299 
3300  // reimplemented virtual methods:
3301  virtual void clearData();
3302  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3303  QVariant *details = 0) const;
3304 
3305  protected:
3306  // property members:
3308  double mWidth;
3311  double mBaseValue;
3312  QPointer<QCPBars> mBarBelow, mBarAbove;
3313 
3314  // reimplemented virtual methods:
3315  virtual void draw(QCPPainter *painter);
3316  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
3317  virtual QCPRange getKeyRange(bool &foundRange,
3318  SignDomain inSignDomain = sdBoth) const;
3319  virtual QCPRange getValueRange(bool &foundRange,
3320  SignDomain inSignDomain = sdBoth) const;
3321 
3322  // non-virtual methods:
3323  void getVisibleDataBounds(QCPBarDataMap::const_iterator &lower,
3324  QCPBarDataMap::const_iterator &upperEnd) const;
3325  QPolygonF getBarPolygon(double key, double value) const;
3326  void getPixelWidth(double key, double &lower, double &upper) const;
3327  double getStackedBaseValue(double key, bool positive) const;
3328  static void connectBars(QCPBars *lower, QCPBars *upper);
3329 
3330  friend class QCustomPlot;
3331  friend class QCPLegend;
3332  friend class QCPBarsGroup;
3333 };
3334 
3338  Q_OBJECT
3340  Q_PROPERTY(double key READ key WRITE setKey)
3341  Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
3342  Q_PROPERTY(double lowerQuartile READ lowerQuartile WRITE setLowerQuartile)
3343  Q_PROPERTY(double median READ median WRITE setMedian)
3344  Q_PROPERTY(double upperQuartile READ upperQuartile WRITE setUpperQuartile)
3345  Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
3346  Q_PROPERTY(QVector<double> outliers READ outliers WRITE setOutliers)
3347  Q_PROPERTY(double width READ width WRITE setWidth)
3348  Q_PROPERTY(double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
3349  Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
3350  Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
3351  Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
3352  Q_PROPERTY(
3353  QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
3355  public:
3356  explicit QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis);
3357 
3358  // getters:
3359  double key() const { return mKey; }
3360  double minimum() const { return mMinimum; }
3361  double lowerQuartile() const { return mLowerQuartile; }
3362  double median() const { return mMedian; }
3363  double upperQuartile() const { return mUpperQuartile; }
3364  double maximum() const { return mMaximum; }
3365  QVector<double> outliers() const { return mOutliers; }
3366  double width() const { return mWidth; }
3367  double whiskerWidth() const { return mWhiskerWidth; }
3368  QPen whiskerPen() const { return mWhiskerPen; }
3369  QPen whiskerBarPen() const { return mWhiskerBarPen; }
3370  QPen medianPen() const { return mMedianPen; }
3371  QCPScatterStyle outlierStyle() const { return mOutlierStyle; }
3372 
3373  // setters:
3374  void setKey(double key);
3375  void setMinimum(double value);
3376  void setLowerQuartile(double value);
3377  void setMedian(double value);
3378  void setUpperQuartile(double value);
3379  void setMaximum(double value);
3380  void setOutliers(const QVector<double> &values);
3381  void setData(double key, double minimum, double lowerQuartile, double median,
3382  double upperQuartile, double maximum);
3383  void setWidth(double width);
3384  void setWhiskerWidth(double width);
3385  void setWhiskerPen(const QPen &pen);
3386  void setWhiskerBarPen(const QPen &pen);
3387  void setMedianPen(const QPen &pen);
3388  void setOutlierStyle(const QCPScatterStyle &style);
3389 
3390  // non-property methods:
3391  virtual void clearData();
3392  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3393  QVariant *details = 0) const;
3394 
3395  protected:
3396  // property members:
3397  QVector<double> mOutliers;
3398  double mKey, mMinimum, mLowerQuartile, mMedian, mUpperQuartile, mMaximum;
3399  double mWidth;
3401  QPen mWhiskerPen, mWhiskerBarPen, mMedianPen;
3403 
3404  // reimplemented virtual methods:
3405  virtual void draw(QCPPainter *painter);
3406  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
3407  virtual QCPRange getKeyRange(bool &foundRange,
3408  SignDomain inSignDomain = sdBoth) const;
3409  virtual QCPRange getValueRange(bool &foundRange,
3410  SignDomain inSignDomain = sdBoth) const;
3411 
3412  // introduced virtual methods:
3413  virtual void drawQuartileBox(QCPPainter *painter,
3414  QRectF *quartileBox = 0) const;
3415  virtual void drawMedian(QCPPainter *painter) const;
3416  virtual void drawWhiskers(QCPPainter *painter) const;
3417  virtual void drawOutliers(QCPPainter *painter) const;
3418 
3419  friend class QCustomPlot;
3420  friend class QCPLegend;
3421 };
3422 
3424  public:
3425  QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange,
3426  const QCPRange &valueRange);
3430 
3431  // getters:
3432  int keySize() const { return mKeySize; }
3433  int valueSize() const { return mValueSize; }
3434  QCPRange keyRange() const { return mKeyRange; }
3435  QCPRange valueRange() const { return mValueRange; }
3436  QCPRange dataBounds() const { return mDataBounds; }
3437  double data(double key, double value);
3438  double cell(int keyIndex, int valueIndex);
3439 
3440  // setters:
3441  void setSize(int keySize, int valueSize);
3442  void setKeySize(int keySize);
3443  void setValueSize(int valueSize);
3444  void setRange(const QCPRange &keyRange, const QCPRange &valueRange);
3445  void setKeyRange(const QCPRange &keyRange);
3446  void setValueRange(const QCPRange &valueRange);
3447  void setData(double key, double value, double z);
3448  void setCell(int keyIndex, int valueIndex, double z);
3449 
3450  // non-property methods:
3452  void clear();
3453  void fill(double z);
3454  bool isEmpty() const { return mIsEmpty; }
3455  void coordToCell(double key, double value, int *keyIndex,
3456  int *valueIndex) const;
3457  void cellToCoord(int keyIndex, int valueIndex, double *key,
3458  double *value) const;
3459 
3460  protected:
3461  // property members:
3462  int mKeySize, mValueSize;
3463  QCPRange mKeyRange, mValueRange;
3464  bool mIsEmpty;
3465  // non-property members:
3466  double *mData;
3469 
3470  friend class QCPColorMap;
3471 };
3472 
3474  Q_OBJECT
3476  Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY
3477  dataRangeChanged)
3478  Q_PROPERTY(QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE
3479  setDataScaleType NOTIFY dataScaleTypeChanged)
3480  Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY
3481  gradientChanged)
3482  Q_PROPERTY(bool interpolate READ interpolate WRITE setInterpolate)
3483  Q_PROPERTY(bool tightBoundary READ tightBoundary WRITE setTightBoundary)
3484  Q_PROPERTY(QCPColorScale *colorScale READ colorScale WRITE setColorScale)
3486  public:
3487  explicit QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis);
3488  virtual ~QCPColorMap();
3489 
3490  // getters:
3491  QCPColorMapData *data() const { return mMapData; }
3492  QCPRange dataRange() const { return mDataRange; }
3493  QCPAxis::ScaleType dataScaleType() const { return mDataScaleType; }
3494  bool interpolate() const { return mInterpolate; }
3495  bool tightBoundary() const { return mTightBoundary; }
3496  QCPColorGradient gradient() const { return mGradient; }
3497  QCPColorScale *colorScale() const { return mColorScale.data(); }
3498 
3499  // setters:
3500  void setData(QCPColorMapData *data, bool copy = false);
3501  Q_SLOT void setDataRange(const QCPRange &dataRange);
3502  Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType);
3503  Q_SLOT void setGradient(const QCPColorGradient &gradient);
3504  void setInterpolate(bool enabled);
3505  void setTightBoundary(bool enabled);
3506  void setColorScale(QCPColorScale *colorScale);
3507 
3508  // non-property methods:
3509  void rescaleDataRange(bool recalculateDataBounds = false);
3510  Q_SLOT void updateLegendIcon(
3511  Qt::TransformationMode transformMode = Qt::SmoothTransformation,
3512  const QSize &thumbSize = QSize(32, 18));
3513 
3514  // reimplemented virtual methods:
3515  virtual void clearData();
3516  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3517  QVariant *details = 0) const;
3518 
3519  signals:
3520  void dataRangeChanged(QCPRange newRange);
3523 
3524  protected:
3525  // property members:
3532  QPointer<QCPColorScale> mColorScale;
3533  // non-property members:
3534  QImage mMapImage, mUndersampledMapImage;
3535  QPixmap mLegendIcon;
3537 
3538  // introduced virtual methods:
3539  virtual void updateMapImage();
3540 
3541  // reimplemented virtual methods:
3542  virtual void draw(QCPPainter *painter);
3543  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
3544  virtual QCPRange getKeyRange(bool &foundRange,
3545  SignDomain inSignDomain = sdBoth) const;
3546  virtual QCPRange getValueRange(bool &foundRange,
3547  SignDomain inSignDomain = sdBoth) const;
3548 
3549  friend class QCustomPlot;
3550  friend class QCPLegend;
3551 };
3552 
3556  public:
3558  QCPFinancialData(double key, double open, double high, double low,
3559  double close);
3560  double key, open, high, low, close;
3561 };
3563 
3571 typedef QMap<double, QCPFinancialData> QCPFinancialDataMap;
3572 typedef QMapIterator<double, QCPFinancialData> QCPFinancialDataMapIterator;
3573 typedef QMutableMapIterator<double, QCPFinancialData>
3575 
3577  Q_OBJECT
3579  Q_PROPERTY(ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
3580  Q_PROPERTY(double width READ width WRITE setWidth)
3581  Q_PROPERTY(bool twoColored READ twoColored WRITE setTwoColored)
3582  Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive)
3583  Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative)
3584  Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive)
3585  Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative)
3587  public:
3593  enum ChartStyle {
3594  csOhlc
3595  ,
3596  csCandlestick
3597  };
3598  Q_ENUMS(ChartStyle)
3599 
3600  explicit QCPFinancial(QCPAxis *keyAxis, QCPAxis *valueAxis);
3601  virtual ~QCPFinancial();
3602 
3603  // getters:
3604  QCPFinancialDataMap *data() const { return mData; }
3605  ChartStyle chartStyle() const { return mChartStyle; }
3606  double width() const { return mWidth; }
3607  bool twoColored() const { return mTwoColored; }
3608  QBrush brushPositive() const { return mBrushPositive; }
3609  QBrush brushNegative() const { return mBrushNegative; }
3610  QPen penPositive() const { return mPenPositive; }
3611  QPen penNegative() const { return mPenNegative; }
3612 
3613  // setters:
3614  void setData(QCPFinancialDataMap *data, bool copy = false);
3615  void setData(const QVector<double> &key, const QVector<double> &open,
3616  const QVector<double> &high, const QVector<double> &low,
3617  const QVector<double> &close);
3619  void setWidth(double width);
3620  void setTwoColored(bool twoColored);
3621  void setBrushPositive(const QBrush &brush);
3622  void setBrushNegative(const QBrush &brush);
3623  void setPenPositive(const QPen &pen);
3624  void setPenNegative(const QPen &pen);
3625 
3626  // non-property methods:
3627  void addData(const QCPFinancialDataMap &dataMap);
3628  void addData(const QCPFinancialData &data);
3629  void addData(double key, double open, double high, double low, double close);
3630  void addData(const QVector<double> &key, const QVector<double> &open,
3631  const QVector<double> &high, const QVector<double> &low,
3632  const QVector<double> &close);
3633  void removeDataBefore(double key);
3634  void removeDataAfter(double key);
3635  void removeData(double fromKey, double toKey);
3636  void removeData(double key);
3637 
3638  // reimplemented virtual methods:
3639  virtual void clearData();
3640  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3641  QVariant *details = 0) const;
3642 
3643  // static methods:
3644  static QCPFinancialDataMap timeSeriesToOhlc(const QVector<double> &time,
3645  const QVector<double> &value,
3646  double timeBinSize,
3647  double timeBinOffset = 0);
3648 
3649  protected:
3650  // property members:
3653  double mWidth;
3655  QBrush mBrushPositive, mBrushNegative;
3656  QPen mPenPositive, mPenNegative;
3657 
3658  // reimplemented virtual methods:
3659  virtual void draw(QCPPainter *painter);
3660  virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const;
3661  virtual QCPRange getKeyRange(bool &foundRange,
3662  SignDomain inSignDomain = sdBoth) const;
3663  virtual QCPRange getValueRange(bool &foundRange,
3664  SignDomain inSignDomain = sdBoth) const;
3665 
3666  // non-virtual methods:
3667  void drawOhlcPlot(QCPPainter *painter,
3668  const QCPFinancialDataMap::const_iterator &begin,
3669  const QCPFinancialDataMap::const_iterator &end);
3671  const QCPFinancialDataMap::const_iterator &begin,
3672  const QCPFinancialDataMap::const_iterator &end);
3673  double ohlcSelectTest(const QPointF &pos,
3674  const QCPFinancialDataMap::const_iterator &begin,
3675  const QCPFinancialDataMap::const_iterator &end) const;
3677  const QPointF &pos, const QCPFinancialDataMap::const_iterator &begin,
3678  const QCPFinancialDataMap::const_iterator &end) const;
3679  void getVisibleDataBounds(QCPFinancialDataMap::const_iterator &lower,
3680  QCPFinancialDataMap::const_iterator &upper) const;
3681 
3682  friend class QCustomPlot;
3683  friend class QCPLegend;
3684 };
3685 
3687  Q_OBJECT
3689  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3690  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3692  public:
3695 
3696  // getters:
3697  QPen pen() const { return mPen; }
3698  QPen selectedPen() const { return mSelectedPen; }
3699 
3700  // setters;
3701  void setPen(const QPen &pen);
3702  void setSelectedPen(const QPen &pen);
3703 
3704  // reimplemented virtual methods:
3705  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3706  QVariant *details = 0) const;
3707 
3710 
3711  protected:
3712  // property members:
3713  QPen mPen, mSelectedPen;
3714 
3715  // reimplemented virtual methods:
3716  virtual void draw(QCPPainter *painter);
3717 
3718  // non-virtual methods:
3719  double distToStraightLine(const QVector2D &point1, const QVector2D &vec,
3720  const QVector2D &point) const;
3721  QLineF getRectClippedStraightLine(const QVector2D &point1,
3722  const QVector2D &vec,
3723  const QRect &rect) const;
3724  QPen mainPen() const;
3725 };
3726 
3728  Q_OBJECT
3730  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3731  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3732  Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
3733  Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
3735  public:
3736  QCPItemLine(QCustomPlot *parentPlot);
3737  virtual ~QCPItemLine();
3738 
3739  // getters:
3740  QPen pen() const { return mPen; }
3741  QPen selectedPen() const { return mSelectedPen; }
3742  QCPLineEnding head() const { return mHead; }
3743  QCPLineEnding tail() const { return mTail; }
3744 
3745  // setters;
3746  void setPen(const QPen &pen);
3747  void setSelectedPen(const QPen &pen);
3748  void setHead(const QCPLineEnding &head);
3749  void setTail(const QCPLineEnding &tail);
3750 
3751  // reimplemented virtual methods:
3752  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3753  QVariant *details = 0) const;
3754 
3757 
3758  protected:
3759  // property members:
3760  QPen mPen, mSelectedPen;
3762 
3763  // reimplemented virtual methods:
3764  virtual void draw(QCPPainter *painter);
3765 
3766  // non-virtual methods:
3767  QLineF getRectClippedLine(const QVector2D &start, const QVector2D &end,
3768  const QRect &rect) const;
3769  QPen mainPen() const;
3770 };
3771 
3773  Q_OBJECT
3775  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3776  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3777  Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
3778  Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
3780  public:
3782  virtual ~QCPItemCurve();
3783 
3784  // getters:
3785  QPen pen() const { return mPen; }
3786  QPen selectedPen() const { return mSelectedPen; }
3787  QCPLineEnding head() const { return mHead; }
3788  QCPLineEnding tail() const { return mTail; }
3789 
3790  // setters;
3791  void setPen(const QPen &pen);
3792  void setSelectedPen(const QPen &pen);
3793  void setHead(const QCPLineEnding &head);
3794  void setTail(const QCPLineEnding &tail);
3795 
3796  // reimplemented virtual methods:
3797  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3798  QVariant *details = 0) const;
3799 
3804 
3805  protected:
3806  // property members:
3807  QPen mPen, mSelectedPen;
3809 
3810  // reimplemented virtual methods:
3811  virtual void draw(QCPPainter *painter);
3812 
3813  // non-virtual methods:
3814  QPen mainPen() const;
3815 };
3816 
3818  Q_OBJECT
3820  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3821  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3822  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3823  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3825  public:
3826  QCPItemRect(QCustomPlot *parentPlot);
3827  virtual ~QCPItemRect();
3828 
3829  // getters:
3830  QPen pen() const { return mPen; }
3831  QPen selectedPen() const { return mSelectedPen; }
3832  QBrush brush() const { return mBrush; }
3833  QBrush selectedBrush() const { return mSelectedBrush; }
3834 
3835  // setters;
3836  void setPen(const QPen &pen);
3837  void setSelectedPen(const QPen &pen);
3838  void setBrush(const QBrush &brush);
3839  void setSelectedBrush(const QBrush &brush);
3840 
3841  // reimplemented virtual methods:
3842  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3843  QVariant *details = 0) const;
3844 
3853 
3854  protected:
3861  aiLeft
3862  };
3863 
3864  // property members:
3865  QPen mPen, mSelectedPen;
3866  QBrush mBrush, mSelectedBrush;
3867 
3868  // reimplemented virtual methods:
3869  virtual void draw(QCPPainter *painter);
3870  virtual QPointF anchorPixelPoint(int anchorId) const;
3871 
3872  // non-virtual methods:
3873  QPen mainPen() const;
3874  QBrush mainBrush() const;
3875 };
3876 
3878  Q_OBJECT
3880  Q_PROPERTY(QColor color READ color WRITE setColor)
3881  Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
3882  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3883  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3884  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3885  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3886  Q_PROPERTY(QFont font READ font WRITE setFont)
3887  Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
3888  Q_PROPERTY(QString text READ text WRITE setText)
3889  Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE
3890  setPositionAlignment)
3891  Q_PROPERTY(
3892  Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
3893  Q_PROPERTY(double rotation READ rotation WRITE setRotation)
3894  Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
3896  public:
3897  QCPItemText(QCustomPlot *parentPlot);
3898  virtual ~QCPItemText();
3899 
3900  // getters:
3901  QColor color() const { return mColor; }
3902  QColor selectedColor() const { return mSelectedColor; }
3903  QPen pen() const { return mPen; }
3904  QPen selectedPen() const { return mSelectedPen; }
3905  QBrush brush() const { return mBrush; }
3906  QBrush selectedBrush() const { return mSelectedBrush; }
3907  QFont font() const { return mFont; }
3908  QFont selectedFont() const { return mSelectedFont; }
3909  QString text() const { return mText; }
3910  Qt::Alignment positionAlignment() const { return mPositionAlignment; }
3911  Qt::Alignment textAlignment() const { return mTextAlignment; }
3912  double rotation() const { return mRotation; }
3913  QMargins padding() const { return mPadding; }
3914 
3915  // setters;
3916  void setColor(const QColor &color);
3917  void setSelectedColor(const QColor &color);
3918  void setPen(const QPen &pen);
3919  void setSelectedPen(const QPen &pen);
3920  void setBrush(const QBrush &brush);
3921  void setSelectedBrush(const QBrush &brush);
3922  void setFont(const QFont &font);
3923  void setSelectedFont(const QFont &font);
3924  void setText(const QString &text);
3925  void setPositionAlignment(Qt::Alignment alignment);
3926  void setTextAlignment(Qt::Alignment alignment);
3927  void setRotation(double degrees);
3928  void setPadding(const QMargins &padding);
3929 
3930  // reimplemented virtual methods:
3931  virtual double selectTest(const QPointF &pos, bool onlySelectable,
3932  QVariant *details = 0) const;
3933 
3943 
3944  protected:
3953  aiLeft
3954  };
3955 
3956  // property members:
3957  QColor mColor, mSelectedColor;
3958  QPen mPen, mSelectedPen;
3959  QBrush mBrush, mSelectedBrush;
3960  QFont mFont, mSelectedFont;
3961  QString mText;
3962  Qt::Alignment mPositionAlignment;
3963  Qt::Alignment mTextAlignment;
3964  double mRotation;
3965  QMargins mPadding;
3966 
3967  // reimplemented virtual methods:
3968  virtual void draw(QCPPainter *painter);
3969  virtual QPointF anchorPixelPoint(int anchorId) const;
3970 
3971  // non-virtual methods:
3972  QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect,
3973  Qt::Alignment positionAlignment) const;
3974  QFont mainFont() const;
3975  QColor mainColor() const;
3976  QPen mainPen() const;
3977  QBrush mainBrush() const;
3978 };
3979 
3981  Q_OBJECT
3983  Q_PROPERTY(QPen pen READ pen WRITE setPen)
3984  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3985  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3986  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3988  public:
3990  virtual ~QCPItemEllipse();
3991 
3992  // getters:
3993  QPen pen() const { return mPen; }
3994  QPen selectedPen() const { return mSelectedPen; }
3995  QBrush brush() const { return mBrush; }
3996  QBrush selectedBrush() const { return mSelectedBrush; }
3997 
3998  // setters;
3999  void setPen(const QPen &pen);
4000  void setSelectedPen(const QPen &pen);
4001  void setBrush(const QBrush &brush);
4002  void setSelectedBrush(const QBrush &brush);
4003 
4004  // reimplemented virtual methods:
4005  virtual double selectTest(const QPointF &pos, bool onlySelectable,
4006  QVariant *details = 0) const;
4007 
4019 
4020  protected:
4030  aiCenter
4031  };
4032 
4033  // property members:
4034  QPen mPen, mSelectedPen;
4035  QBrush mBrush, mSelectedBrush;
4036 
4037  // reimplemented virtual methods:
4038  virtual void draw(QCPPainter *painter);
4039  virtual QPointF anchorPixelPoint(int anchorId) const;
4040 
4041  // non-virtual methods:
4042  QPen mainPen() const;
4043  QBrush mainBrush() const;
4044 };
4045 
4047  Q_OBJECT
4049  Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
4050  Q_PROPERTY(bool scaled READ scaled WRITE setScaled)
4051  Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
4052  Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
4053  Q_PROPERTY(QPen pen READ pen WRITE setPen)
4054  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
4056  public:
4058  virtual ~QCPItemPixmap();
4059 
4060  // getters:
4061  QPixmap pixmap() const { return mPixmap; }
4062  bool scaled() const { return mScaled; }
4063  Qt::AspectRatioMode aspectRatioMode() const { return mAspectRatioMode; }
4064  Qt::TransformationMode transformationMode() const {
4065  return mTransformationMode;
4066  }
4067  QPen pen() const { return mPen; }
4068  QPen selectedPen() const { return mSelectedPen; }
4069 
4070  // setters;
4071  void setPixmap(const QPixmap &pixmap);
4073  bool scaled, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio,
4074  Qt::TransformationMode transformationMode = Qt::SmoothTransformation);
4075  void setPen(const QPen &pen);
4076  void setSelectedPen(const QPen &pen);
4077 
4078  // reimplemented virtual methods:
4079  virtual double selectTest(const QPointF &pos, bool onlySelectable,
4080  QVariant *details = 0) const;
4081 
4090 
4091  protected:
4098  aiLeft
4099  };
4100 
4101  // property members:
4102  QPixmap mPixmap;
4103  QPixmap mScaledPixmap;
4104  bool mScaled;
4106  Qt::AspectRatioMode mAspectRatioMode;
4107  Qt::TransformationMode mTransformationMode;
4108  QPen mPen, mSelectedPen;
4109 
4110  // reimplemented virtual methods:
4111  virtual void draw(QCPPainter *painter);
4112  virtual QPointF anchorPixelPoint(int anchorId) const;
4113 
4114  // non-virtual methods:
4115  void updateScaledPixmap(QRect finalRect = QRect(), bool flipHorz = false,
4116  bool flipVert = false);
4117  QRect getFinalRect(bool *flippedHorz = 0, bool *flippedVert = 0) const;
4118  QPen mainPen() const;
4119 };
4120 
4122  Q_OBJECT
4124  Q_PROPERTY(QPen pen READ pen WRITE setPen)
4125  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
4126  Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
4127  Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
4128  Q_PROPERTY(double size READ size WRITE setSize)
4129  Q_PROPERTY(TracerStyle style READ style WRITE setStyle)
4130  Q_PROPERTY(QCPGraph *graph READ graph WRITE setGraph)
4131  Q_PROPERTY(double graphKey READ graphKey WRITE setGraphKey)
4132  Q_PROPERTY(bool interpolating READ interpolating WRITE setInterpolating)
4134  public:
4142  tsNone
4143  ,
4144  tsPlus
4145  ,
4146  tsCrosshair
4147  ,
4148  tsCircle
4149  ,
4150  tsSquare
4151  };
4152  Q_ENUMS(TracerStyle)
4153 
4155  virtual ~QCPItemTracer();
4156 
4157  // getters:
4158  QPen pen() const { return mPen; }
4159  QPen selectedPen() const { return mSelectedPen; }
4160  QBrush brush() const { return mBrush; }
4161  QBrush selectedBrush() const { return mSelectedBrush; }
4162  double size() const { return mSize; }
4163  TracerStyle style() const { return mStyle; }
4164  QCPGraph *graph() const { return mGraph; }
4165  double graphKey() const { return mGraphKey; }
4166  bool interpolating() const { return mInterpolating; }
4167 
4168  // setters;
4169  void setPen(const QPen &pen);
4170  void setSelectedPen(const QPen &pen);
4171  void setBrush(const QBrush &brush);
4172  void setSelectedBrush(const QBrush &brush);
4173  void setSize(double size);
4174  void setStyle(TracerStyle style);
4175  void setGraph(QCPGraph *graph);
4176  void setGraphKey(double key);
4177  void setInterpolating(bool enabled);
4178 
4179  // reimplemented virtual methods:
4180  virtual double selectTest(const QPointF &pos, bool onlySelectable,
4181  QVariant *details = 0) const;
4182 
4183  // non-virtual methods:
4185 
4187 
4188  protected:
4189  // property members:
4190  QPen mPen, mSelectedPen;
4191  QBrush mBrush, mSelectedBrush;
4192  double mSize;
4195  double mGraphKey;
4197 
4198  // reimplemented virtual methods:
4199  virtual void draw(QCPPainter *painter);
4200 
4201  // non-virtual methods:
4202  QPen mainPen() const;
4203  QBrush mainBrush() const;
4204 };
4205 
4207  Q_OBJECT
4209  Q_PROPERTY(QPen pen READ pen WRITE setPen)
4210  Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
4211  Q_PROPERTY(double length READ length WRITE setLength)
4212  Q_PROPERTY(BracketStyle style READ style WRITE setStyle)
4214  public:
4216  bsSquare
4217  ,
4218  bsRound
4219  ,
4220  bsCurly
4221  ,
4222  bsCalligraphic
4224  };
4225 
4227  virtual ~QCPItemBracket();
4228 
4229  // getters:
4230  QPen pen() const { return mPen; }
4231  QPen selectedPen() const { return mSelectedPen; }
4232  double length() const { return mLength; }
4233  BracketStyle style() const { return mStyle; }
4234 
4235  // setters;
4236  void setPen(const QPen &pen);
4237  void setSelectedPen(const QPen &pen);
4238  void setLength(double length);
4239  void setStyle(BracketStyle style);
4240 
4241  // reimplemented virtual methods:
4242  virtual double selectTest(const QPointF &pos, bool onlySelectable,
4243  QVariant *details = 0) const;
4244 
4248 
4249  protected:
4250  // property members:
4251  enum AnchorIndex { aiCenter };
4252  QPen mPen, mSelectedPen;
4253  double mLength;
4255 
4256  // reimplemented virtual methods:
4257  virtual void draw(QCPPainter *painter);
4258  virtual QPointF anchorPixelPoint(int anchorId) const;
4259 
4260  // non-virtual methods:
4261  QPen mainPen() const;
4262 };
4263 
4264 #endif // QCUSTOMPLOT_H
Definition: qcustomplot.h:1847
QList< QCPItemPosition * > positions() const
Definition: qcustomplot.h:1878
virtual void deselectEvent(bool *selectionStateChanged)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
virtual QPointF anchorPixelPoint(int anchorId) const
double rectSelectTest(const QRectF &rect, const QPointF &pos, bool filledRect) const
QList< QCPItemAnchor * > mAnchors
Definition: qcustomplot.h:1893
QPointer< QCPAxisRect > mClipAxisRect
Definition: qcustomplot.h:1891
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:1879
void setClipToAxisRect(bool clip)
QList< QCPItemPosition * > mPositions
Definition: qcustomplot.h:1892
bool clipToAxisRect() const
Definition: qcustomplot.h:1862
void selectableChanged(bool selectable)
virtual QCP::Interaction selectionCategory() const
void setClipAxisRect(QCPAxisRect *rect)
QCPAxisRect * clipAxisRect() const
bool hasAnchor(const QString &name) const
QCPItemPosition * position(const QString &name) const
double distSqrToLine(const QPointF &start, const QPointF &end, const QPointF &point) const
QCPItemAnchor * createAnchor(const QString &name, int anchorId)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
QCPAbstractItem(QCustomPlot *parentPlot)
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
bool selected() const
Definition: qcustomplot.h:1865
Q_SLOT void setSelected(bool selected)
void selectionChanged(bool selected)
QCPItemPosition * createPosition(const QString &name)
Q_SLOT void setSelectable(bool selectable)
QCPItemAnchor * anchor(const QString &name) const
bool mClipToAxisRect
Definition: qcustomplot.h:1890
bool mSelectable
Definition: qcustomplot.h:1894
bool selectable() const
Definition: qcustomplot.h:1864
virtual ~QCPAbstractItem()
virtual void draw(QCPPainter *painter)=0
virtual QRect clipRect() const
Definition: qcustomplot.h:2410
virtual QCP::Interaction selectionCategory() const
QColor selectedTextColor() const
Definition: qcustomplot.h:2432
QCPLegend * parentLegend() const
Definition: qcustomplot.h:2428
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QColor textColor() const
Definition: qcustomplot.h:2430
void setFont(const QFont &font)
QColor mSelectedTextColor
Definition: qcustomplot.h:2458
void setSelectedTextColor(const QColor &color)
QFont font() const
Definition: qcustomplot.h:2429
void setTextColor(const QColor &color)
void selectionChanged(bool selected)
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
Q_SLOT void setSelectable(bool selectable)
virtual QRect clipRect() const
void setSelectedFont(const QFont &font)
QColor mTextColor
Definition: qcustomplot.h:2456
virtual void draw(QCPPainter *painter)=0
bool mSelectable
Definition: qcustomplot.h:2459
QFont mSelectedFont
Definition: qcustomplot.h:2457
void selectableChanged(bool selectable)
QFont selectedFont() const
Definition: qcustomplot.h:2431
Q_SLOT void setSelected(bool selected)
bool selected() const
Definition: qcustomplot.h:2434
QCPLegend * mParentLegend
Definition: qcustomplot.h:2454
QFont mFont
Definition: qcustomplot.h:2455
bool selectable() const
Definition: qcustomplot.h:2433
virtual void deselectEvent(bool *selectionStateChanged)
QCPAbstractLegendItem(QCPLegend *parent)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.h:1595
void selectableChanged(bool selectable)
virtual QRect clipRect() const
bool antialiasedFill() const
Definition: qcustomplot.h:1620
void applyErrorBarsAntialiasingHint(QCPPainter *painter) const
void setAntialiasedFill(bool enabled)
bool selected() const
Definition: qcustomplot.h:1630
void rescaleAxes(bool onlyEnlarge=false) const
virtual bool removeFromLegend() const
Q_SLOT void setSelected(bool selected)
void pixelsToCoords(const QPointF &pixelPos, double &key, double &value) const
QCPAxis * keyAxis() const
Definition: qcustomplot.h:1627
virtual bool addToLegend()
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
void setAntialiasedScatters(bool enabled)
Q_SLOT void setSelectable(bool selectable)
QBrush mBrush
Definition: qcustomplot.h:1679
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
void pixelsToCoords(double x, double y, double &key, double &value) const
void selectionChanged(bool selected)
QString name() const
Definition: qcustomplot.h:1619
void applyDefaultAntialiasingHint(QCPPainter *painter) const
const QPointF coordsToPixels(double key, double value) const
SignDomain
Definition: qcustomplot.h:1667
QPen mPen
Definition: qcustomplot.h:1678
void setSelectedPen(const QPen &pen)
void setValueAxis(QCPAxis *axis)
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
void setAntialiasedErrorBars(bool enabled)
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
bool antialiasedScatters() const
Definition: qcustomplot.h:1621
void setBrush(const QBrush &brush)
void coordsToPixels(double key, double value, double &x, double &y) const
virtual void clearData()=0
virtual void deselectEvent(bool *selectionStateChanged)
void setKeyAxis(QCPAxis *axis)
QBrush brush() const
Definition: qcustomplot.h:1625
void applyFillAntialiasingHint(QCPPainter *painter) const
void rescaleValueAxis(bool onlyEnlarge=false) const
QPen selectedPen() const
Definition: qcustomplot.h:1624
virtual QCP::Interaction selectionCategory() const
void setPen(const QPen &pen)
void setName(const QString &name)
QPen mainPen() const
QString mName
Definition: qcustomplot.h:1676
QPointer< QCPAxis > mKeyAxis
Definition: qcustomplot.h:1680
QBrush mainBrush() const
void applyScattersAntialiasingHint(QCPPainter *painter) const
virtual void draw(QCPPainter *painter)=0
bool mSelectable
Definition: qcustomplot.h:1681
bool mAntialiasedErrorBars
Definition: qcustomplot.h:1677
QPen pen() const
Definition: qcustomplot.h:1623
bool antialiasedErrorBars() const
Definition: qcustomplot.h:1622
bool selectable() const
Definition: qcustomplot.h:1629
void setSelectedBrush(const QBrush &brush)
void rescaleKeyAxis(bool onlyEnlarge=false) const
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
QCPAxis * valueAxis() const
Definition: qcustomplot.h:1628
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
double distSqrToLine(const QPointF &start, const QPointF &end, const QPointF &point) const
QBrush selectedBrush() const
Definition: qcustomplot.h:1626
Definition: qcustomplot.h:1523
QFont tickLabelFont
Definition: qcustomplot.h:1554
bool reversedEndings
Definition: qcustomplot.h:1559
QCPLineEnding lowerEnding
Definition: qcustomplot.h:1539
bool numberMultiplyCross
Definition: qcustomplot.h:1550
QCPAxisPainterPrivate(QCustomPlot *parentPlot)
int tickLabelPadding
Definition: qcustomplot.h:1545
QVector< QString > tickLabels
Definition: qcustomplot.h:1563
QVector< double > tickPositions
Definition: qcustomplot.h:1562
virtual void drawTickLabel(QCPPainter *painter, double x, double y, const TickLabelData &labelData) const
int labelPadding
Definition: qcustomplot.h:1541
QVector< double > subTickPositions
Definition: qcustomplot.h:1561
bool substituteExponent
Definition: qcustomplot.h:1549
QColor labelColor
Definition: qcustomplot.h:1543
virtual ~QCPAxisPainterPrivate()
int subTickLengthOut
Definition: qcustomplot.h:1552
bool abbreviateDecimalPowers
Definition: qcustomplot.h:1558
virtual void getMaxTickLabelSize(const QFont &font, const QString &text, QSize *tickLabelsSize) const
virtual void draw(QCPPainter *painter)
virtual QByteArray generateLabelParameterHash() const
virtual void placeTickLabel(QCPPainter *painter, double position, int distanceToAxis, const QString &text, QSize *tickLabelsSize)
QCustomPlot * mParentPlot
Definition: qcustomplot.h:1575
QColor tickLabelColor
Definition: qcustomplot.h:1555
QPen subTickPen
Definition: qcustomplot.h:1553
QCPAxis::LabelSide tickLabelSide
Definition: qcustomplot.h:1548
QRect mAxisSelectionBox
Definition: qcustomplot.h:1579
QByteArray mLabelParameterHash
Definition: qcustomplot.h:1576
QRect axisSelectionBox() const
Definition: qcustomplot.h:1532
QPen basePen
Definition: qcustomplot.h:1538
QCache< QString, CachedLabel > mLabelCache
Definition: qcustomplot.h:1578
QRect tickLabelsSelectionBox() const
Definition: qcustomplot.h:1533
QFont labelFont
Definition: qcustomplot.h:1542
virtual int size() const
QCPAxis::AxisType type
Definition: qcustomplot.h:1537
double tickLabelRotation
Definition: qcustomplot.h:1546
virtual TickLabelData getTickLabelData(const QFont &font, const QString &text) const
QRect labelSelectionBox() const
Definition: qcustomplot.h:1534
double offset
Definition: qcustomplot.h:1557
virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const
int subTickLengthIn
Definition: qcustomplot.h:1551
QCPLineEnding upperEnding
Definition: qcustomplot.h:1540
QRect axisRect
Definition: qcustomplot.h:1556
QString label
Definition: qcustomplot.h:1544
Definition: qcustomplot.h:2297
virtual ~QCPAxisRect()
QPoint mDragStart
Definition: qcustomplot.h:2386
bool removeAxis(QCPAxis *axis)
bool backgroundScaled() const
Definition: qcustomplot.h:2314
QPointer< QCPAxis > mRangeDragHorzAxis
Definition: qcustomplot.h:2380
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:2315
QCPAxis * rangeDragAxis(Qt::Orientation orientation)
virtual void wheelEvent(QWheelEvent *event)
QList< QCPAbstractItem * > items() const
virtual int calculateAutoMargin(QCP::MarginSide side)
virtual QList< QCPLayoutElement * > elements(bool recursive) const
int width() const
Definition: qcustomplot.h:2358
void setBackground(const QBrush &brush)
QCPAxis * rangeZoomAxis(Qt::Orientation orientation)
QPoint bottomRight() const
Definition: qcustomplot.h:2364
QPixmap mBackgroundPixmap
Definition: qcustomplot.h:2374
QList< QCPAxis * > axes(QCPAxis::AxisTypes types) const
int right() const
Definition: qcustomplot.h:2355
QCPRange mDragStartHorzRange
Definition: qcustomplot.h:2384
int top() const
Definition: qcustomplot.h:2356
QPixmap background() const
Definition: qcustomplot.h:2313
QBrush mBackgroundBrush
Definition: qcustomplot.h:2373
QPoint topLeft() const
Definition: qcustomplot.h:2361
bool mBackgroundScaled
Definition: qcustomplot.h:2376
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
void setupFullAxesBox(bool connectRanges=false)
void updateAxesOffset(QCPAxis::AxisType type)
QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes=true)
void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical)
void setRangeZoom(Qt::Orientations orientations)
QSize size() const
Definition: qcustomplot.h:2360
QPoint topRight() const
Definition: qcustomplot.h:2362
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Qt::AspectRatioMode mBackgroundScaledMode
Definition: qcustomplot.h:2377
int axisCount(QCPAxis::AxisType type) const
void setRangeZoomFactor(double horizontalFactor, double verticalFactor)
void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical)
virtual void draw(QCPPainter *painter)
QCPAxis * axis(QCPAxis::AxisType type, int index=0) const
virtual void mousePressEvent(QMouseEvent *event)
QList< QCPGraph * > graphs() const
Qt::Orientations rangeZoom() const
Definition: qcustomplot.h:2319
Qt::Orientations rangeDrag() const
Definition: qcustomplot.h:2318
QCP::AntialiasedElements mAADragBackup
Definition: qcustomplot.h:2385
QPixmap mScaledBackgroundPixmap
Definition: qcustomplot.h:2375
virtual void update(UpdatePhase phase)
Qt::Orientations mRangeDrag
Definition: qcustomplot.h:2379
QPoint bottomLeft() const
Definition: qcustomplot.h:2363
bool mDragging
Definition: qcustomplot.h:2387
void drawBackground(QCPPainter *painter)
QCPAxis * addAxis(QCPAxis::AxisType type, QCPAxis *axis=0)
void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding)
QList< QCPAxis * > axes() const
int height() const
Definition: qcustomplot.h:2359
int bottom() const
Definition: qcustomplot.h:2357
double mRangeZoomFactorHorz
Definition: qcustomplot.h:2382
QHash< QCPAxis::AxisType, QList< QCPAxis * > > mAxes
Definition: qcustomplot.h:2388
QList< QCPAxis * > addAxes(QCPAxis::AxisTypes types)
QPoint center() const
Definition: qcustomplot.h:2365
double rangeZoomFactor(Qt::Orientation orientation)
virtual void mouseReleaseEvent(QMouseEvent *event)
void setRangeDrag(Qt::Orientations orientations)
void setBackgroundScaled(bool scaled)
QList< QCPAbstractPlottable * > plottables() const
void setRangeZoomFactor(double factor)
virtual void mouseMoveEvent(QMouseEvent *event)
QCPLayoutInset * mInsetLayout
Definition: qcustomplot.h:2378
QPointer< QCPAxis > mRangeZoomVertAxis
Definition: qcustomplot.h:2381
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:2346
void setBackground(const QPixmap &pm)
int left() const
Definition: qcustomplot.h:2354
Definition: qcustomplot.h:1137
void setSelectedLabelFont(const QFont &font)
Qt::Orientation mOrientation
Definition: qcustomplot.h:1437
void setOffset(int offset)
void setTickLabels(bool show)
QColor labelColor() const
Definition: qcustomplot.h:1323
int padding() const
Definition: qcustomplot.h:1326
virtual int calculateAutoSubTickCount(double tickStep) const
void rangeChanged(const QCPRange &newRange)
void setLowerEnding(const QCPLineEnding &ending)
SelectablePart getPartAt(const QPointF &pos) const
QFont selectedTickLabelFont() const
Definition: qcustomplot.h:1330
QFont tickLabelFont() const
Definition: qcustomplot.h:1303
QString mDateTimeFormat
Definition: qcustomplot.h:1453
LabelType tickLabelType() const
Definition: qcustomplot.h:1302
QCPLineEnding lowerEnding() const
QPen selectedBasePen() const
Definition: qcustomplot.h:1334
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
QCPGrid * mGrid
Definition: qcustomplot.h:1475
QFont selectedLabelFont() const
Definition: qcustomplot.h:1331
void setTickLabelSide(LabelSide side)
bool autoTickStep() const
Definition: qcustomplot.h:1297
QVector< double > mSubTickVector
Definition: qcustomplot.h:1480
void moveRange(double diff)
Q_SLOT void setRange(const QCPRange &range)
QVector< QString > tickVectorLabels() const
Definition: qcustomplot.h:1313
void setTickLabelRotation(double degrees)
SelectableParts selectableParts() const
Definition: qcustomplot.h:1329
QCPRange mRange
Definition: qcustomplot.h:1469
QString numberFormat() const
QPen basePen() const
Definition: qcustomplot.h:1319
void setRangeReversed(bool reversed)
void setNumberPrecision(int precision)
LabelSide
Definition: qcustomplot.h:1248
int numberPrecision() const
Definition: qcustomplot.h:1310
void setDateTimeSpec(const Qt::TimeSpec &timeSpec)
virtual void draw(QCPPainter *painter)
void setSelectedSubTickPen(const QPen &pen)
void setTickLabelFont(const QFont &font)
QString dateTimeFormat() const
Definition: qcustomplot.h:1307
bool mCachedMarginValid
Definition: qcustomplot.h:1481
bool autoTicks() const
Definition: qcustomplot.h:1294
void setDateTimeFormat(const QString &format)
QList< QCPAbstractItem * > items() const
QString label() const
Definition: qcustomplot.h:1324
void setLabel(const QString &str)
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
ScaleType
Definition: qcustomplot.h:1259
QFont mLabelFont
Definition: qcustomplot.h:1444
QLatin1Char mNumberFormatChar
Definition: qcustomplot.h:1456
void setTickLabelColor(const QColor &color)
void setTickLengthOut(int outside)
QColor mSelectedTickLabelColor
Definition: qcustomplot.h:1452
int autoTickCount() const
Definition: qcustomplot.h:1295
void setLabelPadding(int padding)
QColor mLabelColor
Definition: qcustomplot.h:1445
int mCachedMargin
Definition: qcustomplot.h:1482
void rescale(bool onlyVisiblePlottables=false)
int mAutoTickCount
Definition: qcustomplot.h:1462
LabelType
Definition: qcustomplot.h:1233
void setSubTickCount(int count)
void setSubTickLengthOut(int outside)
virtual void generateAutoTicks()
QFont mSelectedTickLabelFont
Definition: qcustomplot.h:1451
double mTickStep
Definition: qcustomplot.h:1461
int mPadding
Definition: qcustomplot.h:1436
double pixelToCoord(double value) const
void setTickLabelType(LabelType type)
void setPadding(int padding)
void setRange(double lower, double upper)
QVector< double > tickVector() const
Definition: qcustomplot.h:1312
bool ticks() const
Definition: qcustomplot.h:1299
double tickLabelRotation() const
bool mRangeReversed
Definition: qcustomplot.h:1470
void setSelectedLabelColor(const QColor &color)
void selectionChanged(const QCPAxis::SelectableParts &parts)
void setTickLength(int inside, int outside=0)
virtual void deselectEvent(bool *selectionStateChanged)
void setUpperEnding(const QCPLineEnding &ending)
QFont getTickLabelFont() const
virtual int calculateMargin()
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
void setLabelColor(const QColor &color)
int labelPadding() const
LabelType mTickLabelType
Definition: qcustomplot.h:1450
QVector< double > mTickVector
Definition: qcustomplot.h:1478
QCPAxisPainterPrivate * mAxisPainter
Definition: qcustomplot.h:1476
void scaleRange(double factor, double center)
void setLabelFont(const QFont &font)
bool mAutoTickLabels
Definition: qcustomplot.h:1448
void setScaleLogBase(double base)
QPen selectedSubTickPen() const
Definition: qcustomplot.h:1336
QColor selectedTickLabelColor() const
Definition: qcustomplot.h:1332
QPen selectedTickPen() const
Definition: qcustomplot.h:1335
void setBasePen(const QPen &pen)
QCPAxisRect * mAxisRect
Definition: qcustomplot.h:1434
QPen subTickPen() const
Definition: qcustomplot.h:1321
QColor selectedLabelColor() const
Definition: qcustomplot.h:1333
QCPGrid * grid() const
Definition: qcustomplot.h:1339
void setAutoTickCount(int approximateCount)
Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts)
void setSelectedTickPen(const QPen &pen)
void setSelectedTickLabelFont(const QFont &font)
void setTickVector(const QVector< double > &vec)
SelectableParts selectedParts() const
Definition: qcustomplot.h:1328
QPen getBasePen() const
QColor getTickLabelColor() const
double scaleLogBase() const
Definition: qcustomplot.h:1291
void setTickVectorLabels(const QVector< QString > &vec)
double tickStep() const
Definition: qcustomplot.h:1311
QPen mSelectedTickPen
Definition: qcustomplot.h:1466
virtual QCP::Interaction selectionCategory() const
bool autoTickLabels() const
Definition: qcustomplot.h:1296
void setAutoTickStep(bool on)
static Qt::Orientation orientation(AxisType type)
Definition: qcustomplot.h:1417
void setSelectedTickLabelColor(const QColor &color)
QColor tickLabelColor() const
Definition: qcustomplot.h:1304
QCPLineEnding upperEnding() const
static AxisType opposite(AxisType type)
QPen mSelectedSubTickPen
Definition: qcustomplot.h:1467
void selectableChanged(const QCPAxis::SelectableParts &parts)
virtual void setupTickVectors()
QFont labelFont() const
Definition: qcustomplot.h:1322
void setAutoTickLabels(bool on)
double basePow(double value) const
bool mAutoSubTicks
Definition: qcustomplot.h:1463
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
static AxisType marginSideToAxisType(QCP::MarginSide side)
QPen getSubTickPen() const
bool mTicks
Definition: qcustomplot.h:1460
Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
void setSubTickLength(int inside, int outside=0)
SelectableParts mSelectableParts
Definition: qcustomplot.h:1438
bool rangeReversed() const
Definition: qcustomplot.h:1293
Qt::Orientation orientation() const
Definition: qcustomplot.h:1404
int subTickCount() const
Definition: qcustomplot.h:1316
int mHighestVisibleTick
Definition: qcustomplot.h:1477
double mScaleLogBase
Definition: qcustomplot.h:1472
SelectablePart
Definition: qcustomplot.h:1271
const QCPRange range() const
Definition: qcustomplot.h:1292
void setSubTickLengthIn(int inside)
QList< QCPAbstractPlottable * > plottables() const
Q_SLOT void setScaleType(QCPAxis::ScaleType type)
void setTicks(bool show)
int subTickLengthOut() const
QVector< QString > mTickVectorLabels
Definition: qcustomplot.h:1479
LabelSide tickLabelSide() const
void setRangeUpper(double upper)
int mNumberPrecision
Definition: qcustomplot.h:1455
int tickLengthIn() const
void setRange(double position, double size, Qt::AlignmentFlag alignment)
ScaleType scaleType() const
Definition: qcustomplot.h:1290
int tickLengthOut() const
QPen mBasePen
Definition: qcustomplot.h:1439
ScaleType mScaleType
Definition: qcustomplot.h:1471
void setTickPen(const QPen &pen)
void setAutoSubTicks(bool on)
AxisType
Definition: qcustomplot.h:1211
bool autoSubTicks() const
Definition: qcustomplot.h:1298
bool tickLabels() const
Definition: qcustomplot.h:1300
void setNumberFormat(const QString &formatCode)
AxisType mAxisType
Definition: qcustomplot.h:1433
double baseLog(double value) const
QString mLabel
Definition: qcustomplot.h:1443
void setAutoTicks(bool on)
QColor getLabelColor() const
Qt::TimeSpec dateTimeSpec() const
Definition: qcustomplot.h:1308
QFont getLabelFont() const
void setSelectedBasePen(const QPen &pen)
void visibleTickBounds(int &lowIndex, int &highIndex) const
void setSubTickPen(const QPen &pen)
int offset() const
bool mNumberBeautifulPowers
Definition: qcustomplot.h:1457
double coordToPixel(double value) const
void setTickLabelPadding(int padding)
void ticksRequest()
void setScaleRatio(const QCPAxis *otherAxis, double ratio=1.0)
void setTickStep(double step)
Qt::TimeSpec mDateTimeSpec
Definition: qcustomplot.h:1454
int subTickLengthIn() const
int tickLabelPadding() const
void setTickLengthIn(int inside)
QCPAxisRect * axisRect() const
Definition: qcustomplot.h:1289
void setRangeLower(double lower)
QList< QCPGraph * > graphs() const
QPen getTickPen() const
QPen tickPen() const
Definition: qcustomplot.h:1320
Definition: qcustomplot.h:3222
QCPBarData(double key, double value)
double key
Definition: qcustomplot.h:3226
Definition: qcustomplot.h:3157
double getPixelSpacing(const QCPBars *bars, double keyCoord)
void remove(QCPBars *bars)
void setSpacingType(SpacingType spacingType)
void insert(int i, QCPBars *bars)
double spacing() const
Definition: qcustomplot.h:3184
QCustomPlot * mParentPlot
Definition: qcustomplot.h:3203
int size() const
Definition: qcustomplot.h:3193
SpacingType
Definition: qcustomplot.h:3170
double mSpacing
Definition: qcustomplot.h:3205
SpacingType mSpacingType
Definition: qcustomplot.h:3204
void registerBars(QCPBars *bars)
void append(QCPBars *bars)
SpacingType spacingType() const
Definition: qcustomplot.h:3183
double keyPixelOffset(const QCPBars *bars, double keyCoord)
QCPBars * bars(int index) const
QList< QCPBars * > bars() const
Definition: qcustomplot.h:3191
QCPBarsGroup(QCustomPlot *parentPlot)
void setSpacing(double spacing)
bool isEmpty() const
Definition: qcustomplot.h:3194
void unregisterBars(QCPBars *bars)
bool contains(QCPBars *bars) const
Definition: qcustomplot.h:3196
QList< QCPBars * > mBars
Definition: qcustomplot.h:3206
Definition: qcustomplot.h:3241
QCPBars * barAbove() const
Definition: qcustomplot.h:3277
double getStackedBaseValue(double key, bool positive) const
void addData(const QCPBarData &data)
QCPBarDataMap * data() const
Definition: qcustomplot.h:3278
static void connectBars(QCPBars *lower, QCPBars *upper)
void addData(const QCPBarDataMap &dataMap)
void removeData(double fromKey, double toKey)
double baseValue() const
Definition: qcustomplot.h:3275
void addData(const QVector< double > &keys, const QVector< double > &values)
virtual void draw(QCPPainter *painter)
QCPBarDataMap * mData
Definition: qcustomplot.h:3307
QPolygonF getBarPolygon(double key, double value) const
void setData(const QVector< double > &key, const QVector< double > &value)
WidthType widthType() const
Definition: qcustomplot.h:3273
void setBaseValue(double baseValue)
QCPBarsGroup * barsGroup() const
Definition: qcustomplot.h:3274
WidthType
Definition: qcustomplot.h:3258
void addData(double key, double value)
QPointer< QCPBars > mBarAbove
Definition: qcustomplot.h:3312
void moveBelow(QCPBars *bars)
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
QCPBars * barBelow() const
Definition: qcustomplot.h:3276
double mWidth
Definition: qcustomplot.h:3308
void removeData(double key)
WidthType mWidthType
Definition: qcustomplot.h:3309
void removeDataAfter(double key)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
void removeDataBefore(double key)
double mBaseValue
Definition: qcustomplot.h:3311
QCPBarsGroup * mBarsGroup
Definition: qcustomplot.h:3310
void setData(QCPBarDataMap *data, bool copy=false)
void moveAbove(QCPBars *bars)
void getPixelWidth(double key, double &lower, double &upper) const
void setWidthType(WidthType widthType)
void getVisibleDataBounds(QCPBarDataMap::const_iterator &lower, QCPBarDataMap::const_iterator &upperEnd) const
virtual void clearData()
void setBarsGroup(QCPBarsGroup *barsGroup)
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void setWidth(double width)
Definition: qcustomplot.h:2192
ColorInterpolation mColorInterpolation
Definition: qcustomplot.h:2289
QRgb color(double position, const QCPRange &range, bool logarithmic=false)
void setLevelCount(int n)
bool periodic() const
Definition: qcustomplot.h:2266
void updateColorBuffer()
void setPeriodic(bool enabled)
void setColorStopAt(double position, const QColor &color)
bool mPeriodic
Definition: qcustomplot.h:2290
void setColorStops(const QMap< double, QColor > &colorStops)
QMap< double, QColor > mColorStops
Definition: qcustomplot.h:2288
void clearColorStops()
int mLevelCount
Definition: qcustomplot.h:2287
QCPColorGradient inverted() const
void loadPreset(GradientPreset preset)
void setColorInterpolation(ColorInterpolation interpolation)
QMap< double, QColor > colorStops() const
Definition: qcustomplot.h:2264
void colorize(const double *data, const QCPRange &range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false)
bool mColorBufferInvalidated
Definition: qcustomplot.h:2294
ColorInterpolation colorInterpolation() const
Definition: qcustomplot.h:2265
int levelCount() const
Definition: qcustomplot.h:2263
ColorInterpolation
Definition: qcustomplot.h:2201
QVector< QRgb > mColorBuffer
Definition: qcustomplot.h:2293
GradientPreset
Definition: qcustomplot.h:2214
Definition: qcustomplot.h:3423
void setKeyRange(const QCPRange &keyRange)
void setValueSize(int valueSize)
void setSize(int keySize, int valueSize)
bool mIsEmpty
Definition: qcustomplot.h:3464
QCPColorMapData & operator=(const QCPColorMapData &other)
QCPRange mDataBounds
Definition: qcustomplot.h:3467
QCPRange keyRange() const
Definition: qcustomplot.h:3434
double data(double key, double value)
void fill(double z)
int mKeySize
Definition: qcustomplot.h:3462
QCPColorMapData(const QCPColorMapData &other)
QCPRange valueRange() const
Definition: qcustomplot.h:3435
int valueSize() const
Definition: qcustomplot.h:3433
void setCell(int keyIndex, int valueIndex, double z)
QCPRange mKeyRange
Definition: qcustomplot.h:3463
QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange, const QCPRange &valueRange)
void setRange(const QCPRange &keyRange, const QCPRange &valueRange)
void recalculateDataBounds()
QCPRange dataBounds() const
Definition: qcustomplot.h:3436
int keySize() const
Definition: qcustomplot.h:3432
double * mData
Definition: qcustomplot.h:3466
void setKeySize(int keySize)
void coordToCell(double key, double value, int *keyIndex, int *valueIndex) const
bool mDataModified
Definition: qcustomplot.h:3468
void setValueRange(const QCPRange &valueRange)
bool isEmpty() const
Definition: qcustomplot.h:3454
void cellToCoord(int keyIndex, int valueIndex, double *key, double *value) const
double cell(int keyIndex, int valueIndex)
void setData(double key, double value, double z)
Definition: qcustomplot.h:3473
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
bool interpolate() const
Definition: qcustomplot.h:3494
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QCPColorMapData * mMapData
Definition: qcustomplot.h:3528
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
QPointer< QCPColorScale > mColorScale
Definition: qcustomplot.h:3532
void dataRangeChanged(QCPRange newRange)
void setInterpolate(bool enabled)
virtual void updateMapImage()
bool tightBoundary() const
Definition: qcustomplot.h:3495
Q_SLOT void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation, const QSize &thumbSize=QSize(32, 18))
void setData(QCPColorMapData *data, bool copy=false)
virtual void clearData()
QImage mMapImage
Definition: qcustomplot.h:3534
void rescaleDataRange(bool recalculateDataBounds=false)
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
QCPColorScale * colorScale() const
Definition: qcustomplot.h:3497
QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis)
void setColorScale(QCPColorScale *colorScale)
QCPColorGradient mGradient
Definition: qcustomplot.h:3529
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
QCPAxis::ScaleType mDataScaleType
Definition: qcustomplot.h:3527
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:3493
QCPRange mDataRange
Definition: qcustomplot.h:3526
QCPColorMapData * data() const
Definition: qcustomplot.h:3491
void gradientChanged(QCPColorGradient newGradient)
bool mTightBoundary
Definition: qcustomplot.h:3531
bool mMapImageInvalidated
Definition: qcustomplot.h:3536
QCPColorGradient gradient() const
Definition: qcustomplot.h:3496
Q_SLOT void setGradient(const QCPColorGradient &gradient)
void setTightBoundary(bool enabled)
QPixmap mLegendIcon
Definition: qcustomplot.h:3535
Q_SLOT void setDataRange(const QCPRange &dataRange)
QCPRange dataRange() const
Definition: qcustomplot.h:3492
virtual void draw(QCPPainter *painter)
bool mInterpolate
Definition: qcustomplot.h:3530
virtual ~QCPColorMap()
Definition: qcustomplot.h:2708
virtual void draw(QCPPainter *painter)
bool mGradientImageInvalidated
Definition: qcustomplot.h:2716
QCPColorScale * mParentColorScale
Definition: qcustomplot.h:2714
Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts)
Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts)
QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale)
QImage mGradientImage
Definition: qcustomplot.h:2715
Definition: qcustomplot.h:2732
virtual void update(UpdatePhase phase)
void setType(QCPAxis::AxisType type)
virtual void wheelEvent(QWheelEvent *event)
void setRangeDrag(bool enabled)
virtual void mouseMoveEvent(QMouseEvent *event)
QCPAxis::ScaleType mDataScaleType
Definition: qcustomplot.h:2788
void dataRangeChanged(QCPRange newRange)
bool rangeDrag() const
virtual ~QCPColorScale()
QCPColorGradient gradient() const
Definition: qcustomplot.h:2756
QString label() const
int mBarWidth
Definition: qcustomplot.h:2790
void rescaleDataRange(bool onlyVisibleMaps)
Q_SLOT void setGradient(const QCPColorGradient &gradient)
QCPRange dataRange() const
Definition: qcustomplot.h:2754
QPointer< QCPColorScaleAxisRectPrivate > mAxisRect
Definition: qcustomplot.h:2793
QCPRange mDataRange
Definition: qcustomplot.h:2787
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
void gradientChanged(QCPColorGradient newGradient)
QCPAxis::AxisType mType
Definition: qcustomplot.h:2786
QCPAxis::AxisType type() const
Definition: qcustomplot.h:2753
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
void setRangeZoom(bool enabled)
QPointer< QCPAxis > mColorAxis
Definition: qcustomplot.h:2794
QList< QCPColorMap * > colorMaps() const
QCPColorScale(QCustomPlot *parentPlot)
void setBarWidth(int width)
Q_SLOT void setDataRange(const QCPRange &dataRange)
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:2755
bool rangeZoom() const
int barWidth() const
Definition: qcustomplot.h:2758
QCPColorGradient mGradient
Definition: qcustomplot.h:2789
QCPAxis * axis() const
Definition: qcustomplot.h:2752
void setLabel(const QString &str)
virtual void mouseReleaseEvent(QMouseEvent *event)
virtual void mousePressEvent(QMouseEvent *event)
Definition: qcustomplot.h:3037
QCPCurveData(double t, double key, double value)
double key
Definition: qcustomplot.h:3041
Definition: qcustomplot.h:3058
void removeDataAfter(double t)
LineStyle lineStyle() const
Definition: qcustomplot.h:3081
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QCPScatterStyle mScatterStyle
Definition: qcustomplot.h:3111
void addData(double t, double key, double value)
virtual void draw(QCPPainter *painter)
LineStyle
Definition: qcustomplot.h:3070
void addData(const QVector< double > &ts, const QVector< double > &keys, const QVector< double > &values)
virtual void drawScatterPlot(QCPPainter *painter, const QVector< QPointF > *pointData) const
void removeData(double t)
int getRegion(double x, double y, double rectLeft, double rectTop, double rectRight, double rectBottom) const
QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis)
void getCurveData(QVector< QPointF > *lineData) const
QCPCurveDataMap * mData
Definition: qcustomplot.h:3110
void setLineStyle(LineStyle style)
void addData(const QCPCurveDataMap &dataMap)
void setScatterStyle(const QCPScatterStyle &style)
void getTraverseCornerPoints(int prevRegion, int currentRegion, double rectLeft, double rectTop, double rectRight, double rectBottom, QVector< QPointF > &beforeTraverse, QVector< QPointF > &afterTraverse) const
void setData(QCPCurveDataMap *data, bool copy=false)
QCPCurveDataMap * data() const
Definition: qcustomplot.h:3079
virtual ~QCPCurve()
bool getTraverse(double prevKey, double prevValue, double key, double value, double rectLeft, double rectTop, double rectRight, double rectBottom, QPointF &crossA, QPointF &crossB) const
QVector< QPointF > getOptimizedCornerPoints(int prevRegion, int currentRegion, double prevKey, double prevValue, double key, double value, double rectLeft, double rectTop, double rectRight, double rectBottom) const
void setData(const QVector< double > &key, const QVector< double > &value)
virtual void clearData()
void addData(const QCPCurveData &data)
void removeData(double fromt, double tot)
void addData(double key, double value)
double pointDistance(const QPointF &pixelPoint) const
LineStyle mLineStyle
Definition: qcustomplot.h:3112
QPointF getOptimizedPoint(int prevRegion, double prevKey, double prevValue, double key, double value, double rectLeft, double rectTop, double rectRight, double rectBottom) const
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
bool mayTraverse(int prevRegion, int currentRegion) const
void removeDataBefore(double t)
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:3080
void setData(const QVector< double > &t, const QVector< double > &key, const QVector< double > &value)
Definition: qcustomplot.h:2812
double key
Definition: qcustomplot.h:2816
double valueErrorMinus
Definition: qcustomplot.h:2818
QCPData(double key, double value)
double keyErrorMinus
Definition: qcustomplot.h:2817
Definition: qcustomplot.h:3555
QCPFinancialData(double key, double open, double high, double low, double close)
double close
Definition: qcustomplot.h:3560
Definition: qcustomplot.h:3576
void removeData(double fromKey, double toKey)
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void removeDataBefore(double key)
ChartStyle
Definition: qcustomplot.h:3593
double width() const
Definition: qcustomplot.h:3606
void setTwoColored(bool twoColored)
void addData(const QCPFinancialDataMap &dataMap)
QPen penNegative() const
Definition: qcustomplot.h:3611
QPen mPenNegative
Definition: qcustomplot.h:3656
virtual void clearData()
void addData(const QCPFinancialData &data)
void drawOhlcPlot(QCPPainter *painter, const QCPFinancialDataMap::const_iterator &begin, const QCPFinancialDataMap::const_iterator &end)
ChartStyle chartStyle() const
Definition: qcustomplot.h:3605
void setChartStyle(ChartStyle style)
void setBrushPositive(const QBrush &brush)
void addData(double key, double open, double high, double low, double close)
bool mTwoColored
Definition: qcustomplot.h:3654
double candlestickSelectTest(const QPointF &pos, const QCPFinancialDataMap::const_iterator &begin, const QCPFinancialDataMap::const_iterator &end) const
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
void drawCandlestickPlot(QCPPainter *painter, const QCPFinancialDataMap::const_iterator &begin, const QCPFinancialDataMap::const_iterator &end)
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void setData(const QVector< double > &key, const QVector< double > &open, const QVector< double > &high, const QVector< double > &low, const QVector< double > &close)
void setBrushNegative(const QBrush &brush)
virtual void draw(QCPPainter *painter)
void setWidth(double width)
double ohlcSelectTest(const QPointF &pos, const QCPFinancialDataMap::const_iterator &begin, const QCPFinancialDataMap::const_iterator &end) const
void removeDataAfter(double key)
void addData(const QVector< double > &key, const QVector< double > &open, const QVector< double > &high, const QVector< double > &low, const QVector< double > &close)
ChartStyle mChartStyle
Definition: qcustomplot.h:3652
void getVisibleDataBounds(QCPFinancialDataMap::const_iterator &lower, QCPFinancialDataMap::const_iterator &upper) const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
void setPenPositive(const QPen &pen)
QBrush mBrushNegative
Definition: qcustomplot.h:3655
QBrush brushNegative() const
Definition: qcustomplot.h:3609
QCPFinancialDataMap * mData
Definition: qcustomplot.h:3651
void setData(QCPFinancialDataMap *data, bool copy=false)
void removeData(double key)
QPen penPositive() const
Definition: qcustomplot.h:3610
QBrush brushPositive() const
Definition: qcustomplot.h:3608
static QCPFinancialDataMap timeSeriesToOhlc(const QVector< double > &time, const QVector< double > &value, double timeBinSize, double timeBinOffset=0)
double mWidth
Definition: qcustomplot.h:3653
bool twoColored() const
Definition: qcustomplot.h:3607
void setPenNegative(const QPen &pen)
Definition: qcustomplot.h:2833
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void rescaleKeyAxis(bool onlyEnlarge, bool includeErrorBars) const
void addData(double key, double value)
void setErrorBarSize(double size)
void setScatterStyle(const QCPScatterStyle &style)
bool adaptiveSampling() const
Definition: qcustomplot.h:2902
virtual void clearData()
void setData(QCPDataMap *data, bool copy=false)
ErrorType errorType() const
Definition: qcustomplot.h:2897
QPointer< QCPGraph > mChannelFillGraph
Definition: qcustomplot.h:2971
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
ErrorType mErrorType
Definition: qcustomplot.h:2968
void setChannelFillGraph(QCPGraph *targetGraph)
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:2896
void setDataValueError(const QVector< double > &key, const QVector< double > &value, const QVector< double > &valueErrorMinus, const QVector< double > &valueErrorPlus)
void removeData(double fromKey, double toKey)
void removeData(double key)
QCPScatterStyle mScatterStyle
Definition: qcustomplot.h:2967
void setData(const QVector< double > &key, const QVector< double > &value)
void setLineStyle(LineStyle ls)
virtual void drawScatterPlot(QCPPainter *painter, QVector< QCPData > *scatterData) const
void getStepRightPlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
int findIndexBelowY(const QVector< QPointF > *data, double y) const
double errorBarSize() const
Definition: qcustomplot.h:2899
void getPlotData(QVector< QPointF > *lineData, QVector< QCPData > *scatterData) const
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain, bool includeErrors) const
void getScatterPlotData(QVector< QCPData > *scatterData) const
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain, bool includeErrors) const
void getLinePlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QPointF upperFillBasePoint(double upperKey) const
double mErrorBarSize
Definition: qcustomplot.h:2969
QCPDataMap * data() const
Definition: qcustomplot.h:2894
void addData(const QCPData &data)
bool errorBarSkipSymbol() const
Definition: qcustomplot.h:2900
QCPGraph * channelFillGraph() const
Definition: qcustomplot.h:2901
LineStyle mLineStyle
Definition: qcustomplot.h:2966
void setDataBothError(const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyError, const QVector< double > &valueError)
int findIndexAboveY(const QVector< QPointF > *data, double y) const
int findIndexBelowX(const QVector< QPointF > *data, double x) const
virtual void drawFill(QCPPainter *painter, QVector< QPointF > *lineData) const
void addFillBasePoints(QVector< QPointF > *lineData) const
void getStepLeftPlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
double pointDistance(const QPointF &pixelPoint) const
QCPDataMap * mData
Definition: qcustomplot.h:2964
void rescaleAxes(bool onlyEnlarge, bool includeErrorBars) const
void rescaleValueAxis(bool onlyEnlarge, bool includeErrorBars) const
void removeDataBefore(double key)
QPen mErrorPen
Definition: qcustomplot.h:2965
virtual void drawLinePlot(QCPPainter *painter, QVector< QPointF > *lineData) const
void addData(const QCPDataMap &dataMap)
bool mAdaptiveSampling
Definition: qcustomplot.h:2972
int findIndexAboveX(const QVector< QPointF > *data, double x) const
void getImpulsePlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
void setErrorBarSkipSymbol(bool enabled)
void setAdaptiveSampling(bool enabled)
void drawError(QCPPainter *painter, double x, double y, const QCPData &data) const
void addData(const QVector< double > &keys, const QVector< double > &values)
void getStepCenterPlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
void setDataBothError(const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyErrorMinus, const QVector< double > &keyErrorPlus, const QVector< double > &valueErrorMinus, const QVector< double > &valueErrorPlus)
void setDataKeyError(const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyError)
QPen errorPen() const
Definition: qcustomplot.h:2898
void setErrorPen(const QPen &pen)
void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper) const
void setDataKeyError(const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyErrorMinus, const QVector< double > &keyErrorPlus)
void setErrorType(ErrorType errorType)
LineStyle lineStyle() const
Definition: qcustomplot.h:2895
void setDataValueError(const QVector< double > &key, const QVector< double > &value, const QVector< double > &valueError)
QPointF lowerFillBasePoint(double lowerKey) const
bool mErrorBarSkipSymbol
Definition: qcustomplot.h:2970
ErrorType
Definition: qcustomplot.h:2878
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
LineStyle
Definition: qcustomplot.h:2854
virtual void drawImpulsePlot(QCPPainter *painter, QVector< QPointF > *lineData) const
const QPolygonF getChannelFillPolygon(const QVector< QPointF > *lineData) const
int countDataInBounds(const QCPDataMap::const_iterator &lower, const QCPDataMap::const_iterator &upper, int maxCount) const
void removeDataAfter(double key)
void getPreparedData(QVector< QCPData > *lineData, QVector< QCPData > *scatterData) const
virtual void draw(QCPPainter *painter)
void removeFillBasePoints(QVector< QPointF > *lineData) const
Definition: qcustomplot.h:1087
QPen mPen
Definition: qcustomplot.h:1122
QPen pen() const
Definition: qcustomplot.h:1106
void setZeroLinePen(const QPen &pen)
void setAntialiasedZeroLine(bool enabled)
QCPAxis * mParentAxis
Definition: qcustomplot.h:1124
bool mSubGridVisible
Definition: qcustomplot.h:1120
void setAntialiasedSubGrid(bool enabled)
bool antialiasedZeroLine() const
Definition: qcustomplot.h:1105
bool mAntialiasedSubGrid
Definition: qcustomplot.h:1121
void drawSubGridLines(QCPPainter *painter) const
QPen zeroLinePen() const
Definition: qcustomplot.h:1108
void setSubGridPen(const QPen &pen)
void setPen(const QPen &pen)
QCPGrid(QCPAxis *parentAxis)
void setSubGridVisible(bool visible)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QPen subGridPen() const
Definition: qcustomplot.h:1107
void drawGridLines(QCPPainter *painter) const
bool antialiasedSubGrid() const
Definition: qcustomplot.h:1104
virtual void draw(QCPPainter *painter)
bool subGridVisible() const
Definition: qcustomplot.h:1103
Definition: qcustomplot.h:1724
int mAnchorId
Definition: qcustomplot.h:1741
virtual QPointF pixelPoint() const
virtual ~QCPItemAnchor()
void removeChildX(QCPItemPosition *pos)
QString mName
Definition: qcustomplot.h:1736
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:1745
QCPAbstractItem * mParentItem
Definition: qcustomplot.h:1740
QCustomPlot * mParentPlot
Definition: qcustomplot.h:1739
void removeChildY(QCPItemPosition *pos)
QString name() const
Definition: qcustomplot.h:1731
QSet< QCPItemPosition * > mChildrenX
Definition: qcustomplot.h:1742
QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString name, int anchorId=-1)
void addChildX(QCPItemPosition *pos)
void addChildY(QCPItemPosition *pos)
Definition: qcustomplot.h:4206
void setSelectedPen(const QPen &pen)
QPen mPen
Definition: qcustomplot.h:4252
QCPItemBracket(QCustomPlot *parentPlot)
BracketStyle style() const
Definition: qcustomplot.h:4233
QPen pen() const
Definition: qcustomplot.h:4230
void setStyle(BracketStyle style)
QCPItemPosition *const left
Definition: qcustomplot.h:4245
virtual QPointF anchorPixelPoint(int anchorId) const
BracketStyle
Definition: qcustomplot.h:4215
AnchorIndex
Definition: qcustomplot.h:4251
QCPItemAnchor *const center
Definition: qcustomplot.h:4247
virtual void draw(QCPPainter *painter)
virtual ~QCPItemBracket()
void setPen(const QPen &pen)
double mLength
Definition: qcustomplot.h:4253
QCPItemPosition *const right
Definition: qcustomplot.h:4246
void setLength(double length)
BracketStyle mStyle
Definition: qcustomplot.h:4254
QPen mainPen() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
double length() const
Definition: qcustomplot.h:4232
QPen selectedPen() const
Definition: qcustomplot.h:4231
Definition: qcustomplot.h:3772
QCPItemPosition *const startDir
Definition: qcustomplot.h:3801
void setPen(const QPen &pen)
QCPItemPosition *const start
Definition: qcustomplot.h:3800
void setHead(const QCPLineEnding &head)
QCPItemPosition *const end
Definition: qcustomplot.h:3803
void setSelectedPen(const QPen &pen)
QPen mainPen() const
QPen selectedPen() const
Definition: qcustomplot.h:3786
QPen mPen
Definition: qcustomplot.h:3807
QCPLineEnding head() const
Definition: qcustomplot.h:3787
virtual void draw(QCPPainter *painter)
QCPItemPosition *const endDir
Definition: qcustomplot.h:3802
QCPLineEnding tail() const
Definition: qcustomplot.h:3788
void setTail(const QCPLineEnding &tail)
QCPItemCurve(QCustomPlot *parentPlot)
QPen pen() const
Definition: qcustomplot.h:3785
QCPLineEnding mHead
Definition: qcustomplot.h:3808
virtual ~QCPItemCurve()
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.h:3980
virtual ~QCPItemEllipse()
QCPItemPosition *const bottomRight
Definition: qcustomplot.h:4009
QCPItemAnchor *const topRightRim
Definition: qcustomplot.h:4012
QPen mPen
Definition: qcustomplot.h:4034
QCPItemAnchor *const bottomLeftRim
Definition: qcustomplot.h:4016
QCPItemAnchor *const bottom
Definition: qcustomplot.h:4015
QCPItemPosition *const topLeft
Definition: qcustomplot.h:4008
AnchorIndex
Definition: qcustomplot.h:4021
@ aiBottom
Definition: qcustomplot.h:4027
@ aiBottomRightRim
Definition: qcustomplot.h:4026
@ aiTop
Definition: qcustomplot.h:4023
@ aiTopRightRim
Definition: qcustomplot.h:4024
@ aiLeft
Definition: qcustomplot.h:4029
@ aiTopLeftRim
Definition: qcustomplot.h:4022
@ aiRight
Definition: qcustomplot.h:4025
@ aiBottomLeftRim
Definition: qcustomplot.h:4028
void setBrush(const QBrush &brush)
QBrush mainBrush() const
virtual QPointF anchorPixelPoint(int anchorId) const
void setSelectedPen(const QPen &pen)
QBrush mBrush
Definition: qcustomplot.h:4035
QCPItemEllipse(QCustomPlot *parentPlot)
QCPItemAnchor *const topLeftRim
Definition: qcustomplot.h:4010
QPen pen() const
Definition: qcustomplot.h:3993
void setSelectedBrush(const QBrush &brush)
QPen selectedPen() const
Definition: qcustomplot.h:3994
QPen mainPen() const
QBrush brush() const
Definition: qcustomplot.h:3995
QCPItemAnchor *const left
Definition: qcustomplot.h:4017
QCPItemAnchor *const center
Definition: qcustomplot.h:4018
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
virtual void draw(QCPPainter *painter)
void setPen(const QPen &pen)
QCPItemAnchor *const bottomRightRim
Definition: qcustomplot.h:4014
QCPItemAnchor *const right
Definition: qcustomplot.h:4013
QCPItemAnchor *const top
Definition: qcustomplot.h:4011
QBrush selectedBrush() const
Definition: qcustomplot.h:3996
Definition: qcustomplot.h:3727
virtual ~QCPItemLine()
QCPItemLine(QCustomPlot *parentPlot)
QCPItemPosition *const start
Definition: qcustomplot.h:3755
void setSelectedPen(const QPen &pen)
QCPItemPosition *const end
Definition: qcustomplot.h:3756
QCPLineEnding mHead
Definition: qcustomplot.h:3761
void setPen(const QPen &pen)
QCPLineEnding head() const
Definition: qcustomplot.h:3742
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QPen pen() const
Definition: qcustomplot.h:3740
QPen mPen
Definition: qcustomplot.h:3760
QCPLineEnding tail() const
Definition: qcustomplot.h:3743
virtual void draw(QCPPainter *painter)
void setTail(const QCPLineEnding &tail)
QPen selectedPen() const
Definition: qcustomplot.h:3741
QLineF getRectClippedLine(const QVector2D &start, const QVector2D &end, const QRect &rect) const
void setHead(const QCPLineEnding &head)
QPen mainPen() const
Definition: qcustomplot.h:4046
QCPItemPosition *const bottomRight
Definition: qcustomplot.h:4083
AnchorIndex
Definition: qcustomplot.h:4092
@ aiRight
Definition: qcustomplot.h:4095
@ aiTopRight
Definition: qcustomplot.h:4094
@ aiBottomLeft
Definition: qcustomplot.h:4097
@ aiTop
Definition: qcustomplot.h:4093
@ aiBottom
Definition: qcustomplot.h:4096
QPixmap mPixmap
Definition: qcustomplot.h:4102
virtual ~QCPItemPixmap()
bool mScaledPixmapInvalidated
Definition: qcustomplot.h:4105
QPen selectedPen() const
Definition: qcustomplot.h:4068
QPixmap mScaledPixmap
Definition: qcustomplot.h:4103
QCPItemAnchor *const top
Definition: qcustomplot.h:4084
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QRect getFinalRect(bool *flippedHorz=0, bool *flippedVert=0) const
Qt::AspectRatioMode aspectRatioMode() const
Definition: qcustomplot.h:4063
QPen pen() const
Definition: qcustomplot.h:4067
QCPItemAnchor *const left
Definition: qcustomplot.h:4089
virtual QPointF anchorPixelPoint(int anchorId) const
void setPixmap(const QPixmap &pixmap)
QPixmap pixmap() const
Definition: qcustomplot.h:4061
bool scaled() const
Definition: qcustomplot.h:4062
QCPItemAnchor *const right
Definition: qcustomplot.h:4086
void updateScaledPixmap(QRect finalRect=QRect(), bool flipHorz=false, bool flipVert=false)
Qt::AspectRatioMode mAspectRatioMode
Definition: qcustomplot.h:4106
bool mScaled
Definition: qcustomplot.h:4104
QCPItemPixmap(QCustomPlot *parentPlot)
QPen mainPen() const
void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation)
Qt::TransformationMode transformationMode() const
Definition: qcustomplot.h:4064
QCPItemAnchor *const bottom
Definition: qcustomplot.h:4087
Qt::TransformationMode mTransformationMode
Definition: qcustomplot.h:4107
QCPItemAnchor *const topRight
Definition: qcustomplot.h:4085
void setPen(const QPen &pen)
QPen mPen
Definition: qcustomplot.h:4108
virtual void draw(QCPPainter *painter)
QCPItemAnchor *const bottomLeft
Definition: qcustomplot.h:4088
QCPItemPosition *const topLeft
Definition: qcustomplot.h:4082
void setSelectedPen(const QPen &pen)
Definition: qcustomplot.h:1763
QCPItemAnchor * mParentAnchorX
Definition: qcustomplot.h:1838
void setAxisRect(QCPAxisRect *axisRect)
PositionType typeX() const
Definition: qcustomplot.h:1803
void setTypeX(PositionType type)
void setAxes(QCPAxis *keyAxis, QCPAxis *valueAxis)
QPointer< QCPAxis > mKeyAxis
Definition: qcustomplot.h:1835
QCPAxis * valueAxis() const
Definition: qcustomplot.h:1812
QCPItemPosition(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString name)
virtual QPointF pixelPoint() const
double mKey
Definition: qcustomplot.h:1837
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:1841
QCPItemAnchor * parentAnchorX() const
Definition: qcustomplot.h:1806
QPointer< QCPAxisRect > mAxisRect
Definition: qcustomplot.h:1836
double key() const
Definition: qcustomplot.h:1808
QCPAxis * keyAxis() const
Definition: qcustomplot.h:1811
QCPItemAnchor * parentAnchorY() const
Definition: qcustomplot.h:1807
void setType(PositionType type)
QPointF coords() const
Definition: qcustomplot.h:1810
void setCoords(double key, double value)
PositionType
Definition: qcustomplot.h:1771
void setPixelPoint(const QPointF &pixelPoint)
PositionType type() const
Definition: qcustomplot.h:1802
bool setParentAnchor(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false)
void setTypeY(PositionType type)
void setCoords(const QPointF &coords)
double value() const
Definition: qcustomplot.h:1809
bool setParentAnchorY(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false)
bool setParentAnchorX(QCPItemAnchor *parentAnchor, bool keepPixelPosition=false)
PositionType mPositionTypeX
Definition: qcustomplot.h:1834
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:1805
PositionType typeY() const
Definition: qcustomplot.h:1804
QCPAxisRect * axisRect() const
virtual ~QCPItemPosition()
Definition: qcustomplot.h:3817
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QCPItemAnchor *const topRight
Definition: qcustomplot.h:3848
QCPItemAnchor *const left
Definition: qcustomplot.h:3852
QCPItemAnchor *const top
Definition: qcustomplot.h:3847
QBrush selectedBrush() const
Definition: qcustomplot.h:3833
QBrush mBrush
Definition: qcustomplot.h:3866
QCPItemAnchor *const right
Definition: qcustomplot.h:3849
QPen pen() const
Definition: qcustomplot.h:3830
QCPItemRect(QCustomPlot *parentPlot)
void setPen(const QPen &pen)
virtual void draw(QCPPainter *painter)
QBrush brush() const
Definition: qcustomplot.h:3832
void setSelectedPen(const QPen &pen)
QCPItemPosition *const bottomRight
Definition: qcustomplot.h:3846
QCPItemAnchor *const bottomLeft
Definition: qcustomplot.h:3851
QBrush mainBrush() const
QCPItemPosition *const topLeft
Definition: qcustomplot.h:3845
virtual QPointF anchorPixelPoint(int anchorId) const
virtual ~QCPItemRect()
QPen mPen
Definition: qcustomplot.h:3865
void setBrush(const QBrush &brush)
void setSelectedBrush(const QBrush &brush)
QPen selectedPen() const
Definition: qcustomplot.h:3831
QCPItemAnchor *const bottom
Definition: qcustomplot.h:3850
AnchorIndex
Definition: qcustomplot.h:3855
@ aiTop
Definition: qcustomplot.h:3856
@ aiTopRight
Definition: qcustomplot.h:3857
@ aiBottom
Definition: qcustomplot.h:3859
@ aiBottomLeft
Definition: qcustomplot.h:3860
@ aiRight
Definition: qcustomplot.h:3858
QPen mainPen() const
Definition: qcustomplot.h:3686
QPen mPen
Definition: qcustomplot.h:3713
double distToStraightLine(const QVector2D &point1, const QVector2D &vec, const QVector2D &point) const
QCPItemPosition *const point1
Definition: qcustomplot.h:3708
QCPItemStraightLine(QCustomPlot *parentPlot)
virtual void draw(QCPPainter *painter)
QPen mainPen() const
void setSelectedPen(const QPen &pen)
QCPItemPosition *const point2
Definition: qcustomplot.h:3709
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
void setPen(const QPen &pen)
QPen pen() const
Definition: qcustomplot.h:3697
virtual ~QCPItemStraightLine()
QPen selectedPen() const
Definition: qcustomplot.h:3698
QLineF getRectClippedStraightLine(const QVector2D &point1, const QVector2D &vec, const QRect &rect) const
Definition: qcustomplot.h:3877
double rotation() const
Definition: qcustomplot.h:3912
QColor color() const
Definition: qcustomplot.h:3901
void setSelectedFont(const QFont &font)
Qt::Alignment positionAlignment() const
Definition: qcustomplot.h:3910
QCPItemAnchor *const topRight
Definition: qcustomplot.h:3937
AnchorIndex
Definition: qcustomplot.h:3945
@ aiTopLeft
Definition: qcustomplot.h:3946
@ aiRight
Definition: qcustomplot.h:3949
@ aiBottom
Definition: qcustomplot.h:3951
@ aiBottomRight
Definition: qcustomplot.h:3950
@ aiBottomLeft
Definition: qcustomplot.h:3952
@ aiTopRight
Definition: qcustomplot.h:3948
@ aiTop
Definition: qcustomplot.h:3947
void setBrush(const QBrush &brush)
QFont mFont
Definition: qcustomplot.h:3960
QBrush mBrush
Definition: qcustomplot.h:3959
QBrush brush() const
Definition: qcustomplot.h:3905
QCPItemPosition *const position
Definition: qcustomplot.h:3934
void setSelectedPen(const QPen &pen)
QString mText
Definition: qcustomplot.h:3961
QPen mainPen() const
QBrush selectedBrush() const
Definition: qcustomplot.h:3906
QCPItemAnchor *const left
Definition: qcustomplot.h:3942
void setText(const QString &text)
QFont font() const
Definition: qcustomplot.h:3907
void setRotation(double degrees)
QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect, Qt::Alignment positionAlignment) const
QCPItemAnchor *const right
Definition: qcustomplot.h:3938
QMargins padding() const
Definition: qcustomplot.h:3913
void setSelectedBrush(const QBrush &brush)
QCPItemAnchor *const bottomRight
Definition: qcustomplot.h:3939
Qt::Alignment mPositionAlignment
Definition: qcustomplot.h:3962
virtual QPointF anchorPixelPoint(int anchorId) const
QColor selectedColor() const
Definition: qcustomplot.h:3902
QPen pen() const
Definition: qcustomplot.h:3903
QFont selectedFont() const
Definition: qcustomplot.h:3908
QCPItemText(QCustomPlot *parentPlot)
void setPositionAlignment(Qt::Alignment alignment)
QCPItemAnchor *const bottomLeft
Definition: qcustomplot.h:3941
QColor mColor
Definition: qcustomplot.h:3957
QPen selectedPen() const
Definition: qcustomplot.h:3904
void setFont(const QFont &font)
Qt::Alignment textAlignment() const
Definition: qcustomplot.h:3911
void setPen(const QPen &pen)
QPen mPen
Definition: qcustomplot.h:3958
QCPItemAnchor *const topLeft
Definition: qcustomplot.h:3935
void setColor(const QColor &color)
QCPItemAnchor *const top
Definition: qcustomplot.h:3936
void setTextAlignment(Qt::Alignment alignment)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QColor mainColor() const
double mRotation
Definition: qcustomplot.h:3964
virtual void draw(QCPPainter *painter)
Qt::Alignment mTextAlignment
Definition: qcustomplot.h:3963
QBrush mainBrush() const
QString text() const
Definition: qcustomplot.h:3909
virtual ~QCPItemText()
QMargins mPadding
Definition: qcustomplot.h:3965
void setSelectedColor(const QColor &color)
void setPadding(const QMargins &padding)
QCPItemAnchor *const bottom
Definition: qcustomplot.h:3940
QFont mainFont() const
Definition: qcustomplot.h:4121
void setSelectedBrush(const QBrush &brush)
void setBrush(const QBrush &brush)
TracerStyle
Definition: qcustomplot.h:4141
void setStyle(TracerStyle style)
double size() const
Definition: qcustomplot.h:4162
double mSize
Definition: qcustomplot.h:4192
QPen mPen
Definition: qcustomplot.h:4190
virtual void draw(QCPPainter *painter)
void updatePosition()
QBrush mBrush
Definition: qcustomplot.h:4191
void setGraphKey(double key)
void setInterpolating(bool enabled)
QBrush brush() const
Definition: qcustomplot.h:4160
double mGraphKey
Definition: qcustomplot.h:4195
QBrush mainBrush() const
QCPGraph * mGraph
Definition: qcustomplot.h:4194
QPen mainPen() const
double graphKey() const
Definition: qcustomplot.h:4165
QCPGraph * graph() const
Definition: qcustomplot.h:4164
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QPen selectedPen() const
Definition: qcustomplot.h:4159
void setSelectedPen(const QPen &pen)
QBrush selectedBrush() const
Definition: qcustomplot.h:4161
void setSize(double size)
QCPItemPosition *const position
Definition: qcustomplot.h:4186
bool interpolating() const
Definition: qcustomplot.h:4166
void setGraph(QCPGraph *graph)
void setPen(const QPen &pen)
bool mInterpolating
Definition: qcustomplot.h:4196
TracerStyle mStyle
Definition: qcustomplot.h:4193
TracerStyle style() const
Definition: qcustomplot.h:4163
Definition: qcustomplot.h:480
QList< QCPLayerable * > mChildren
Definition: qcustomplot.h:508
int mIndex
Definition: qcustomplot.h:507
bool mVisible
Definition: qcustomplot.h:509
QString name() const
Definition: qcustomplot.h:495
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:494
void addChild(QCPLayerable *layerable, bool prepend)
QCPLayer(QCustomPlot *parentPlot, const QString &layerName)
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:497
QCustomPlot * mParentPlot
Definition: qcustomplot.h:505
QString mName
Definition: qcustomplot.h:506
void setVisible(bool visible)
void removeChild(QCPLayerable *layerable)
bool visible() const
Definition: qcustomplot.h:498
int index() const
Definition: qcustomplot.h:496
Definition: qcustomplot.h:522
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QCustomPlot * mParentPlot
Definition: qcustomplot.h:562
bool mAntialiased
Definition: qcustomplot.h:565
void setVisible(bool on)
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:538
void setAntialiased(bool enabled)
QCPLayer * layer() const
Definition: qcustomplot.h:540
bool mVisible
Definition: qcustomplot.h:561
bool antialiased() const
Definition: qcustomplot.h:541
QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
virtual void deselectEvent(bool *selectionStateChanged)
void initializeParentPlot(QCustomPlot *parentPlot)
void setParentLayerable(QCPLayerable *parentLayerable)
bool realVisibility() const
bool setLayer(const QString &layerName)
QCPLayer * mLayer
Definition: qcustomplot.h:564
void layerChanged(QCPLayer *newLayer)
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:539
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
virtual void draw(QCPPainter *painter)=0
virtual QCP::Interaction selectionCategory() const
QPointer< QCPLayerable > mParentLayerable
Definition: qcustomplot.h:563
Q_SLOT bool setLayer(QCPLayer *layer)
bool visible() const
Definition: qcustomplot.h:537
bool moveToLayer(QCPLayer *layer, bool prepend)
virtual QRect clipRect() const
Definition: qcustomplot.h:755
virtual void mousePressEvent(QMouseEvent *event)
Definition: qcustomplot.h:835
void setMaximumSize(int width, int height)
QRect mOuterRect
Definition: qcustomplot.h:827
void setMinimumMargins(const QMargins &margins)
UpdatePhase
Definition: qcustomplot.h:772
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: qcustomplot.h:836
QRect rect() const
Definition: qcustomplot.h:788
QCP::MarginSides autoMargins() const
Definition: qcustomplot.h:792
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
Definition: qcustomplot.h:830
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QRect outerRect() const
Definition: qcustomplot.h:789
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: qcustomplot.h:837
void setOuterRect(const QRect &rect)
void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group)
virtual void draw(QCPPainter *painter)
Definition: qcustomplot.h:845
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
void setMinimumSize(const QSize &size)
QMargins minimumMargins() const
Definition: qcustomplot.h:791
QSize minimumSize() const
Definition: qcustomplot.h:793
QSize mMaximumSize
Definition: qcustomplot.h:826
virtual QList< QCPLayoutElement * > elements(bool recursive) const
void setMaximumSize(const QSize &size)
virtual int calculateAutoMargin(QCP::MarginSide side)
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Definition: qcustomplot.h:838
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
Definition: qcustomplot.h:798
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
Definition: qcustomplot.h:795
void setMinimumSize(int width, int height)
void setMargins(const QMargins &margins)
virtual QSize maximumSizeHint() const
virtual QSize minimumSizeHint() const
QMargins mMargins
Definition: qcustomplot.h:828
QCPLayout * mParentLayout
Definition: qcustomplot.h:825
void setAutoMargins(QCP::MarginSides sides)
virtual void wheelEvent(QWheelEvent *event)
Definition: qcustomplot.h:839
virtual void update(UpdatePhase phase)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Definition: qcustomplot.h:842
QMargins margins() const
Definition: qcustomplot.h:790
QCP::MarginSides mAutoMargins
Definition: qcustomplot.h:829
QSize maximumSize() const
Definition: qcustomplot.h:794
Definition: qcustomplot.h:894
virtual void simplify()
virtual bool take(QCPLayoutElement *element)
int rowCount() const
int columnCount() const
void insertColumn(int newIndex)
void setRowStretchFactors(const QList< double > &factors)
virtual int elementCount() const
void setColumnSpacing(int pixels)
QCPLayoutElement * element(int row, int column) const
virtual QSize minimumSizeHint() const
void insertRow(int newIndex)
void getMinimumRowColSizes(QVector< int > *minColWidths, QVector< int > *minRowHeights) const
virtual QSize maximumSizeHint() const
int rowSpacing() const
Definition: qcustomplot.h:916
virtual QCPLayoutElement * elementAt(int index) const
void setColumnStretchFactors(const QList< double > &factors)
virtual QCPLayoutElement * takeAt(int index)
void setRowStretchFactor(int row, double factor)
void expandTo(int newRowCount, int newColumnCount)
QList< QList< QCPLayoutElement * > > mElements
Definition: qcustomplot.h:947
QList< double > columnStretchFactors() const
Definition: qcustomplot.h:913
virtual void updateLayout()
void getMaximumRowColSizes(QVector< int > *maxColWidths, QVector< int > *maxRowHeights) const
QList< double > mColumnStretchFactors
Definition: qcustomplot.h:948
QList< double > rowStretchFactors() const
Definition: qcustomplot.h:914
void setRowSpacing(int pixels)
bool hasElement(int row, int column)
virtual ~QCPLayoutGrid()
int columnSpacing() const
Definition: qcustomplot.h:915
bool addElement(int row, int column, QCPLayoutElement *element)
void setColumnStretchFactor(int column, double factor)
int mColumnSpacing
Definition: qcustomplot.h:950
virtual QList< QCPLayoutElement * > elements(bool recursive) const
QList< double > mRowStretchFactors
Definition: qcustomplot.h:949
Definition: qcustomplot.h:962
virtual bool take(QCPLayoutElement *element)
virtual int elementCount() const
virtual void updateLayout()
virtual ~QCPLayoutInset()
QList< QCPLayoutElement * > mElements
Definition: qcustomplot.h:1006
QList< InsetPlacement > mInsetPlacement
Definition: qcustomplot.h:1007
QList< Qt::Alignment > mInsetAlignment
Definition: qcustomplot.h:1008
virtual QCPLayoutElement * elementAt(int index) const
virtual void simplify()
Definition: qcustomplot.h:996
Qt::Alignment insetAlignment(int index) const
void setInsetAlignment(int index, Qt::Alignment alignment)
void setInsetPlacement(int index, InsetPlacement placement)
InsetPlacement
Definition: qcustomplot.h:969
void addElement(QCPLayoutElement *element, const QRectF &rect)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
QList< QRectF > mInsetRect
Definition: qcustomplot.h:1009
void setInsetRect(int index, const QRectF &rect)
QRectF insetRect(int index) const
void addElement(QCPLayoutElement *element, Qt::Alignment alignment)
virtual QCPLayoutElement * takeAt(int index)
InsetPlacement insetPlacement(int index) const
Definition: qcustomplot.h:856
void clear()
bool removeAt(int index)
virtual QList< QCPLayoutElement * > elements(bool recursive) const
virtual QCPLayoutElement * takeAt(int index)=0
void releaseElement(QCPLayoutElement *el)
virtual void update(UpdatePhase phase)
bool remove(QCPLayoutElement *element)
QVector< int > getSectionSizes(QVector< int > maxSizes, QVector< int > minSizes, QVector< double > stretchFactors, int totalSize) const
virtual QCPLayoutElement * elementAt(int index) const =0
virtual int elementCount() const =0
virtual bool take(QCPLayoutElement *element)=0
virtual void simplify()
void sizeConstraintsChanged() const
void adoptElement(QCPLayoutElement *el)
virtual void updateLayout()
Definition: qcustomplot.h:2500
SelectableParts mSelectableParts
Definition: qcustomplot.h:2605
int iconTextPadding() const
Definition: qcustomplot.h:2549
QPen getBorderPen() const
void clearItems()
bool removeItem(QCPAbstractLegendItem *item)
SelectableParts selectedParts() const
void setSelectedBorderPen(const QPen &pen)
void setIconBorderPen(const QPen &pen)
QSize mIconSize
Definition: qcustomplot.h:2603
bool addItem(QCPAbstractLegendItem *item)
Q_SLOT void setSelectableParts(const SelectableParts &selectableParts)
QCPAbstractLegendItem * item(int index) const
QColor mTextColor
Definition: qcustomplot.h:2602
QFont selectedFont() const
Definition: qcustomplot.h:2556
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
void setBrush(const QBrush &brush)
bool hasItemWithPlottable(const QCPAbstractPlottable *plottable) const
QList< QCPAbstractLegendItem * > selectedItems() const
QPen mBorderPen
Definition: qcustomplot.h:2599
SelectablePart
Definition: qcustomplot.h:2529
virtual void draw(QCPPainter *painter)
QFont mFont
Definition: qcustomplot.h:2601
int itemCount() const
QPen iconBorderPen() const
Definition: qcustomplot.h:2550
QPen mSelectedBorderPen
Definition: qcustomplot.h:2606
void setIconTextPadding(int padding)
QColor mSelectedTextColor
Definition: qcustomplot.h:2609
void setSelectedTextColor(const QColor &color)
QBrush selectedBrush() const
Definition: qcustomplot.h:2555
virtual QCP::Interaction selectionCategory() const
void selectionChanged(QCPLegend::SelectableParts parts)
void setBorderPen(const QPen &pen)
QFont mSelectedFont
Definition: qcustomplot.h:2608
void setSelectedBrush(const QBrush &brush)
void selectableChanged(QCPLegend::SelectableParts parts)
int mIconTextPadding
Definition: qcustomplot.h:2604
void setIconSize(const QSize &size)
Q_SLOT void setSelectedParts(const SelectableParts &selectedParts)
void setIconSize(int width, int height)
QBrush mBrush
Definition: qcustomplot.h:2600
void setFont(const QFont &font)
QColor textColor() const
Definition: qcustomplot.h:2547
QBrush brush() const
Definition: qcustomplot.h:2545
QBrush getBrush() const
QBrush mSelectedBrush
Definition: qcustomplot.h:2607
void setSelectedFont(const QFont &font)
QColor selectedTextColor() const
Definition: qcustomplot.h:2557
virtual void deselectEvent(bool *selectionStateChanged)
bool removeItem(int index)
SelectableParts selectableParts() const
Definition: qcustomplot.h:2551
bool hasItem(QCPAbstractLegendItem *item) const
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
QPen selectedIconBorderPen() const
Definition: qcustomplot.h:2554
QPen selectedBorderPen() const
Definition: qcustomplot.h:2553
void setSelectedIconBorderPen(const QPen &pen)
void setTextColor(const QColor &color)
QFont font() const
Definition: qcustomplot.h:2546
QSize iconSize() const
Definition: qcustomplot.h:2548
QCPPlottableLegendItem * itemWithPlottable(const QCPAbstractPlottable *plottable) const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.h:1015
EndingStyle style() const
Definition: qcustomplot.h:1061
void draw(QCPPainter *painter, const QVector2D &pos, const QVector2D &dir) const
double boundingDistance() const
bool inverted() const
Definition: qcustomplot.h:1064
void setWidth(double width)
EndingStyle mStyle
Definition: qcustomplot.h:1081
void setStyle(EndingStyle style)
void setInverted(bool inverted)
EndingStyle
Definition: qcustomplot.h:1032
void draw(QCPPainter *painter, const QVector2D &pos, double angle) const
bool mInverted
Definition: qcustomplot.h:1083
QCPLineEnding(EndingStyle style, double width=8, double length=10, bool inverted=false)
double realLength() const
void setLength(double length)
double width() const
Definition: qcustomplot.h:1062
double mLength
Definition: qcustomplot.h:1082
double length() const
Definition: qcustomplot.h:1063
Definition: qcustomplot.h:726
void removeChild(QCP::MarginSide side, QCPLayoutElement *element)
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:733
QCustomPlot * mParentPlot
Definition: qcustomplot.h:741
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
Definition: qcustomplot.h:742
QCPMarginGroup(QCustomPlot *parentPlot)
void addChild(QCP::MarginSide side, QCPLayoutElement *element)
bool isEmpty() const
int commonMargin(QCP::MarginSide side) const
Definition: qcustomplot.h:414
bool begin(QPaintDevice *device)
void drawLine(const QLineF &line)
PainterMode
Definition: qcustomplot.h:422
QStack< bool > mAntialiasingStack
Definition: qcustomplot.h:476
void setPen(Qt::PenStyle penStyle)
void setPen(const QColor &color)
void setModes(PainterModes modes)
void restore()
bool mIsAntialiasing
Definition: qcustomplot.h:473
void makeNonCosmetic()
void save()
void setAntialiasing(bool enabled)
void drawLine(const QPointF &p1, const QPointF &p2)
Definition: qcustomplot.h:461
PainterModes modes() const
Definition: qcustomplot.h:448
PainterModes mModes
Definition: qcustomplot.h:472
void setMode(PainterMode mode, bool enabled=true)
void setPen(const QPen &pen)
Definition: qcustomplot.h:2635
void setSelectedTextColor(const QColor &color)
QString mText
Definition: qcustomplot.h:2681
void setFont(const QFont &font)
QColor textColor() const
Definition: qcustomplot.h:2656
QFont font() const
Definition: qcustomplot.h:2655
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
void selectionChanged(bool selected)
QFont selectedFont() const
Definition: qcustomplot.h:2657
virtual QSize maximumSizeHint() const
void setSelectedFont(const QFont &font)
QFont mainFont() const
QColor mTextColor
Definition: qcustomplot.h:2683
void selectableChanged(bool selectable)
Q_SLOT void setSelected(bool selected)
bool selected() const
Definition: qcustomplot.h:2660
void setTextColor(const QColor &color)
Q_SLOT void setSelectable(bool selectable)
QRect mTextBoundingRect
Definition: qcustomplot.h:2686
virtual QSize minimumSizeHint() const
QColor mSelectedTextColor
Definition: qcustomplot.h:2685
QCPPlotTitle(QCustomPlot *parentPlot, const QString &text)
QFont mSelectedFont
Definition: qcustomplot.h:2684
QCPPlotTitle(QCustomPlot *parentPlot)
bool mSelectable
Definition: qcustomplot.h:2687
void setText(const QString &text)
QColor mainTextColor() const
QString text() const
Definition: qcustomplot.h:2654
bool selectable() const
Definition: qcustomplot.h:2659
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
virtual void deselectEvent(bool *selectionStateChanged)
QColor selectedTextColor() const
Definition: qcustomplot.h:2658
QFont mFont
Definition: qcustomplot.h:2682
virtual void draw(QCPPainter *painter)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.h:2478
virtual QSize minimumSizeHint() const
virtual void draw(QCPPainter *painter)
QColor getTextColor() const
QFont getFont() const
QCPAbstractPlottable * mPlottable
Definition: qcustomplot.h:2488
QCPPlottableLegendItem(QCPLegend *parent, QCPAbstractPlottable *plottable)
QCPAbstractPlottable * plottable()
Definition: qcustomplot.h:2484
QPen getIconBorderPen() const
Definition: qcustomplot.h:593
void expand(const QCPRange &otherRange)
QCPRange(double lower, double upper)
static bool validRange(const QCPRange &range)
static const double maxRange
Definition: qcustomplot.h:644
QCPRange sanitizedForLogScale() const
bool operator!=(const QCPRange &other) const
Definition: qcustomplot.h:603
static bool validRange(double lower, double upper)
QCPRange & operator/=(const double &value)
Definition: qcustomplot.h:620
double size() const
QCPRange & operator*=(const double &value)
Definition: qcustomplot.h:615
QCPRange sanitizedForLinScale() const
QCPRange & operator-=(const double &value)
Definition: qcustomplot.h:610
static const double minRange
Definition: qcustomplot.h:643
QCPRange expanded(const QCPRange &otherRange) const
bool operator==(const QCPRange &other) const
Definition: qcustomplot.h:600
double lower
Definition: qcustomplot.h:595
double upper
Definition: qcustomplot.h:595
bool contains(double value) const
double center() const
void normalize()
QCPRange & operator+=(const double &value)
Definition: qcustomplot.h:605
Definition: qcustomplot.h:305
QCPScatterStyle(ScatterShape shape, double size=6)
double size() const
Definition: qcustomplot.h:378
QPen mPen
Definition: qcustomplot.h:404
QBrush mBrush
Definition: qcustomplot.h:405
void drawShape(QCPPainter *painter, QPointF pos) const
bool isPenDefined() const
Definition: qcustomplot.h:395
void setPixmap(const QPixmap &pixmap)
QCPScatterStyle(const QPixmap &pixmap)
QCPScatterStyle(ScatterShape shape, const QColor &color, const QColor &fill, double size)
bool isNone() const
Definition: qcustomplot.h:394
void setBrush(const QBrush &brush)
double mSize
Definition: qcustomplot.h:402
void setPen(const QPen &pen)
QPixmap mPixmap
Definition: qcustomplot.h:406
void setShape(ScatterShape shape)
QPainterPath mCustomPath
Definition: qcustomplot.h:407
bool mPenDefined
Definition: qcustomplot.h:410
QCPScatterStyle(ScatterShape shape, const QPen &pen, const QBrush &brush, double size)
QCPScatterStyle(const QPainterPath &customPath, const QPen &pen, const QBrush &brush=Qt::NoBrush, double size=6)
void drawShape(QCPPainter *painter, double x, double y) const
void setCustomPath(const QPainterPath &customPath)
QPixmap pixmap() const
Definition: qcustomplot.h:382
void setSize(double size)
QPen pen() const
Definition: qcustomplot.h:380
ScatterShape
Definition: qcustomplot.h:317
QBrush brush() const
Definition: qcustomplot.h:381
QPainterPath customPath() const
Definition: qcustomplot.h:383
ScatterShape shape() const
Definition: qcustomplot.h:379
ScatterShape mShape
Definition: qcustomplot.h:403
QCPScatterStyle(ScatterShape shape, const QColor &color, double size)
void applyTo(QCPPainter *painter, const QPen &defaultPen) const
Definition: qcustomplot.h:3337
double key() const
Definition: qcustomplot.h:3359
QVector< double > outliers() const
Definition: qcustomplot.h:3365
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void setWidth(double width)
QPen mMedianPen
Definition: qcustomplot.h:3401
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
QVector< double > mOutliers
Definition: qcustomplot.h:3397
QPen whiskerBarPen() const
Definition: qcustomplot.h:3369
void setWhiskerPen(const QPen &pen)
double mWhiskerWidth
Definition: qcustomplot.h:3400
double maximum() const
Definition: qcustomplot.h:3364
void setMedian(double value)
void setUpperQuartile(double value)
QPen whiskerPen() const
Definition: qcustomplot.h:3368
void setLowerQuartile(double value)
void setMedianPen(const QPen &pen)
QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis)
virtual void clearData()
virtual void drawOutliers(QCPPainter *painter) const
void setKey(double key)
void setMinimum(double value)
double mKey
Definition: qcustomplot.h:3398
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
virtual void drawMedian(QCPPainter *painter) const
void setWhiskerBarPen(const QPen &pen)
double whiskerWidth() const
Definition: qcustomplot.h:3367
double minimum() const
Definition: qcustomplot.h:3360
double median() const
Definition: qcustomplot.h:3362
void setMaximum(double value)
void setOutlierStyle(const QCPScatterStyle &style)
void setWhiskerWidth(double width)
void setData(double key, double minimum, double lowerQuartile, double median, double upperQuartile, double maximum)
QCPScatterStyle mOutlierStyle
Definition: qcustomplot.h:3402
double width() const
Definition: qcustomplot.h:3366
virtual void drawWhiskers(QCPPainter *painter) const
virtual void drawQuartileBox(QCPPainter *painter, QRectF *quartileBox=0) const
QCPScatterStyle outlierStyle() const
Definition: qcustomplot.h:3371
double mWidth
Definition: qcustomplot.h:3399
QPen medianPen() const
Definition: qcustomplot.h:3370
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
void setOutliers(const QVector< double > &values)
virtual void draw(QCPPainter *painter)
double lowerQuartile() const
Definition: qcustomplot.h:3361
double upperQuartile() const
Definition: qcustomplot.h:3363
Definition: qcustomplot.h:1925
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void drawBackground(QCPPainter *painter)
QPixmap mScaledBackgroundPixmap
Definition: qcustomplot.h:2151
void beforeReplot()
QCPGraph * graph() const
Qt::KeyboardModifier mMultiSelectModifier
Definition: qcustomplot.h:2156
QList< QCPGraph * > mGraphs
Definition: qcustomplot.h:2141
void setBackground(const QPixmap &pm)
int itemCount() const
QRect viewport() const
Definition: qcustomplot.h:1980
void toPainter(QCPPainter *painter, int width=0, int height=0)
void titleClick(QMouseEvent *event, QCPPlotTitle *title)
bool setCurrentLayer(QCPLayer *layer)
virtual void legendRemoved(QCPLegend *legend)
Qt::KeyboardModifier multiSelectModifier() const
Definition: qcustomplot.h:1998
const QCP::Interactions interactions() const
Definition: qcustomplot.h:1994
QCPLayerable * layerableAt(const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=0) const
void setBackgroundScaled(bool scaled)
QBrush mBackgroundBrush
Definition: qcustomplot.h:2149
Q_SLOT void deselectAll()
void setPlottingHint(QCP::PlottingHint hint, bool enabled=true)
virtual void mouseDoubleClickEvent(QMouseEvent *event)
QCPLayer * mCurrentLayer
Definition: qcustomplot.h:2154
QList< QCPGraph * > selectedGraphs() const
void setViewport(const QRect &rect)
bool removeLayer(QCPLayer *layer)
void setInteraction(const QCP::Interaction &interaction, bool enabled=true)
virtual void mousePressEvent(QMouseEvent *event)
QCustomPlot(QWidget *parent=0)
RefreshPriority
Definition: qcustomplot.h:1963
@ rpHint
Definition: qcustomplot.h:1971
bool saveJpg(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1)
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
void setSelectionTolerance(int pixels)
QCPLegend * legend
Definition: qcustomplot.h:2106
QCPAbstractItem * item() const
void selectionChangedByUser()
int selectionTolerance() const
Definition: qcustomplot.h:1995
virtual void paintEvent(QPaintEvent *event)
void plottableClick(QCPAbstractPlottable *plottable, QMouseEvent *event)
QPixmap background() const
Definition: qcustomplot.h:1981
QCPLayer * layer(const QString &name) const
int graphCount() const
void setInteractions(const QCP::Interactions &interactions)
int plottableCount() const
virtual void mouseReleaseEvent(QMouseEvent *event)
bool mBackgroundScaled
Definition: qcustomplot.h:2152
QCP::AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:1987
bool savePdf(const QString &fileName, bool noCosmeticPen=false, int width=0, int height=0, const QString &pdfCreator=QString(), const QString &pdfTitle=QString())
QCPLayer * currentLayer() const
bool saveBmp(const QString &fileName, int width=0, int height=0, double scale=1.0)
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
virtual ~QCustomPlot()
void afterReplot()
QList< QCPAbstractPlottable * > selectedPlottables() const
virtual QSize sizeHint() const
bool hasPlottable(QCPAbstractPlottable *plottable) const
bool setCurrentLayer(const QString &name)
virtual QSize minimumSizeHint() const
void mouseMove(QMouseEvent *event)
QPixmap mPaintBuffer
Definition: qcustomplot.h:2159
QCP::AntialiasedElements notAntialiasedElements() const
Definition: qcustomplot.h:1990
LayerInsertMode
Definition: qcustomplot.h:1950
bool savePng(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1)
void setNoAntialiasingOnDrag(bool enabled)
QList< QCPAbstractItem * > mItems
Definition: qcustomplot.h:2143
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
virtual void wheelEvent(QWheelEvent *event)
void updateLayerIndices() const
QCPGraph * addGraph(QCPAxis *keyAxis=0, QCPAxis *valueAxis=0)
void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding)
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:1986
Q_SLOT void rescaleAxes(bool onlyVisiblePlottables=false)
void setBackground(const QBrush &brush)
virtual void draw(QCPPainter *painter)
int axisRectCount() const
void setMultiSelectModifier(Qt::KeyboardModifier modifier)
virtual void mouseMoveEvent(QMouseEvent *event)
bool removeGraph(QCPGraph *graph)
void setPlottingHints(const QCP::PlottingHints &hints)
bool removeGraph(int index)
int clearPlottables()
QCPAxis * xAxis
Definition: qcustomplot.h:2105
void mouseDoubleClick(QMouseEvent *event)
QCP::PlottingHints mPlottingHints
Definition: qcustomplot.h:2155
QCP::AntialiasedElements mAntialiasedElements
Definition: qcustomplot.h:2145
bool addItem(QCPAbstractItem *item)
QList< QCPLegend * > selectedLegends() const
QPointer< QCPLayoutElement > mMouseEventElement
Definition: qcustomplot.h:2161
QPixmap toPixmap(int width=0, int height=0, double scale=1.0)
bool backgroundScaled() const
Definition: qcustomplot.h:1982
QList< QCPAbstractPlottable * > mPlottables
Definition: qcustomplot.h:2140
bool mAutoAddPlottableToLegend
Definition: qcustomplot.h:2139
int clearGraphs()
bool mReplotting
Definition: qcustomplot.h:2162
QCPLayoutElement * layoutElementAt(const QPointF &pos) const
bool saveRastered(const QString &fileName, int width, int height, double scale, const char *format, int quality=-1)
Q_SLOT void replot(QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpHint)
bool addPlottable(QCPAbstractPlottable *plottable)
Qt::AspectRatioMode mBackgroundScaledMode
Definition: qcustomplot.h:2153
QCPLayer * layer(int index) const
QList< QCPAxis * > selectedAxes() const
QCPLayoutGrid * mPlotLayout
Definition: qcustomplot.h:2138
int mSelectionTolerance
Definition: qcustomplot.h:2147
bool removeItem(int index)
int clearItems()
QCPAbstractItem * item(int index) const
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
QRect mViewport
Definition: qcustomplot.h:2137
virtual void resizeEvent(QResizeEvent *event)
QCPAbstractPlottable * plottableAt(const QPointF &pos, bool onlySelectable=false) const
QCPAbstractPlottable * plottable()
bool autoAddPlottableToLegend() const
Definition: qcustomplot.h:1993
QPoint mMousePressPos
Definition: qcustomplot.h:2160
QCP::PlottingHints plottingHints() const
Definition: qcustomplot.h:1997
void mouseWheel(QWheelEvent *event)
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
bool mNoAntialiasingOnDrag
Definition: qcustomplot.h:2148
void mouseRelease(QMouseEvent *event)
QCPAbstractItem * itemAt(const QPointF &pos, bool onlySelectable=false) const
bool noAntialiasingOnDrag() const
Definition: qcustomplot.h:1996
virtual void axisRemoved(QCPAxis *axis)
void mousePress(QMouseEvent *event)
QList< QCPLayer * > mLayers
Definition: qcustomplot.h:2144
QCPAbstractPlottable * plottable(int index)
void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title)
bool addLayer(const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove)
QList< QCPAbstractItem * > selectedItems() const
QCP::Interactions mInteractions
Definition: qcustomplot.h:2146
void setAutoAddPlottableToLegend(bool on)
bool removeItem(QCPAbstractItem *item)
void setNotAntialiasedElements(const QCP::AntialiasedElements &notAntialiasedElements)
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove)
QPixmap mBackgroundPixmap
Definition: qcustomplot.h:2150
QCPGraph * graph(int index) const
void setAntialiasedElement(QCP::AntialiasedElement antialiasedElement, bool enabled=true)
bool hasItem(QCPAbstractItem *item) const
QCPAxisRect * axisRect(int index=0) const
void plottableDoubleClick(QCPAbstractPlottable *plottable, QMouseEvent *event)
bool removePlottable(QCPAbstractPlottable *plottable)
void setAntialiasedElements(const QCP::AntialiasedElements &antialiasedElements)
QList< QCPAxisRect * > axisRects() const
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:1983
int layerCount() const
bool removePlottable(int index)
void setNotAntialiasedElement(QCP::AntialiasedElement notAntialiasedElement, bool enabled=true)
Definition: qcustomplot.h:94
bool isInvalidData(double value)
Definition: qcustomplot.h:234
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Definition: qcustomplot.h:282
Interaction
Definition: qcustomplot.h:195
@ iRangeDrag
Definition: qcustomplot.h:196
@ iSelectItems
Definition: qcustomplot.h:218
@ iSelectLegend
Definition: qcustomplot.h:215
@ iSelectOther
Definition: qcustomplot.h:221
@ iSelectAxes
Definition: qcustomplot.h:212
@ iSelectPlottables
Definition: qcustomplot.h:208
@ iMultiSelect
Definition: qcustomplot.h:204
@ iRangeZoom
Definition: qcustomplot.h:200
PlottingHint
Definition: qcustomplot.h:166
@ phFastPolylines
Definition: qcustomplot.h:169
@ phForceRepaint
Definition: qcustomplot.h:175
@ phCacheLabels
Definition: qcustomplot.h:183
@ phNone
0x000 No hints are set
Definition: qcustomplot.h:167
MarginSide
Definition: qcustomplot.h:100
@ msTop
0x04 top margin
Definition: qcustomplot.h:105
@ msNone
0x00 no margin
Definition: qcustomplot.h:111
@ msRight
0x02 right margin
Definition: qcustomplot.h:103
@ msAll
0xFF all margins
Definition: qcustomplot.h:109
@ msLeft
0x01 left margin
Definition: qcustomplot.h:101
@ msBottom
0x08 bottom margin
Definition: qcustomplot.h:107
AntialiasedElement
Definition: qcustomplot.h:126
@ aeAxes
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:127
@ aeItems
0x0040 Main lines of items
Definition: qcustomplot.h:141
@ aeScatters
Definition: qcustomplot.h:143
@ aeLegendItems
0x0010 Legend items
Definition: qcustomplot.h:135
@ aePlottables
0x0020 Main lines of plottables
Definition: qcustomplot.h:137
@ aeNone
0x0000 No elements
Definition: qcustomplot.h:156
@ aeSubGrid
0x0004 Sub grid lines
Definition: qcustomplot.h:131
@ aeFills
Definition: qcustomplot.h:148
@ aeErrorBars
0x0100 Error bars
Definition: qcustomplot.h:146
@ aeAll
0xFFFF All elements
Definition: qcustomplot.h:154
@ aeGrid
0x0002 Grid lines
Definition: qcustomplot.h:129
@ aeZeroLine
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:151
@ aeLegend
0x0008 Legend box
Definition: qcustomplot.h:133
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
Definition: qcustomplot.h:253
@ sdNegative
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:208
@ sdPositive
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:212
@ sdBoth
Both sign domains, including zero, i.e. all numbers.
Definition: qcustomplot.h:210
QMapIterator< double, QCPData > QCPDataMapIterator
Definition: qcustomplot.h:2830
QMap< double, QCPCurveData > QCPCurveDataMap
Definition: qcustomplot.h:3053
QMutableMapIterator< double, QCPData > QCPDataMutableMapIterator
Definition: qcustomplot.h:2831
const QCPRange operator/(const QCPRange &range, double value)
Definition: qcustomplot.h:720
const QCPRange operator*(const QCPRange &range, double value)
Definition: qcustomplot.h:702
#define QCP_LIB_DECL
Definition: qcustomplot.h:87
QMutableMapIterator< double, QCPBarData > QCPBarDataMutableMapIterator
Definition: qcustomplot.h:3239
QMap< double, QCPFinancialData > QCPFinancialDataMap
Definition: qcustomplot.h:3571
const QCPRange operator-(const QCPRange &range, double value)
Definition: qcustomplot.h:693
QMap< double, QCPData > QCPDataMap
Definition: qcustomplot.h:2829
QMap< double, QCPBarData > QCPBarDataMap
Definition: qcustomplot.h:3237
QMutableMapIterator< double, QCPFinancialData > QCPFinancialDataMutableMapIterator
Definition: qcustomplot.h:3574
QMapIterator< double, QCPFinancialData > QCPFinancialDataMapIterator
Definition: qcustomplot.h:3572
QMutableMapIterator< double, QCPCurveData > QCPCurveDataMutableMapIterator
Definition: qcustomplot.h:3056
QMapIterator< double, QCPBarData > QCPBarDataMapIterator
Definition: qcustomplot.h:3238
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
QMapIterator< double, QCPCurveData > QCPCurveDataMapIterator
Definition: qcustomplot.h:3054
const QCPRange operator+(const QCPRange &range, double value)
Definition: qcustomplot.h:675
Definition: qcustomplot.h:1566
QPixmap pixmap
Definition: qcustomplot.h:1568
QPointF offset
Definition: qcustomplot.h:1567
Definition: qcustomplot.h:1570
QFont baseFont
Definition: qcustomplot.h:1573
QRect baseBounds
Definition: qcustomplot.h:1572
QString basePart
Definition: qcustomplot.h:1571