29#include <QtCore/qglobal.h>
32#ifdef QCUSTOMPLOT_USE_OPENGL
33# if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
34# define QCP_OPENGL_PBUFFER
36# define QCP_OPENGL_FBO
38# if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
39# define QCP_OPENGL_OFFSCREENSURFACE
43#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
44# define QCP_DEVICEPIXELRATIO_SUPPORTED
45# if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
46# define QCP_DEVICEPIXELRATIO_FLOAT
50#include <QtCore/QObject>
51#include <QtCore/QPointer>
52#include <QtCore/QSharedPointer>
53#include <QtCore/QTimer>
54#include <QtGui/QPainter>
55#include <QtGui/QPainterPath>
56#include <QtGui/QPaintEvent>
57#include <QtGui/QMouseEvent>
58#include <QtGui/QWheelEvent>
59#include <QtGui/QPixmap>
60#include <QtCore/QVector>
61#include <QtCore/QString>
62#include <QtCore/QDateTime>
63#include <QtCore/QMultiMap>
64#include <QtCore/QFlags>
65#include <QtCore/QDebug>
66#include <QtCore/QStack>
67#include <QtCore/QCache>
68#include <QtCore/QMargins>
73# include <QtGui/QOpenGLContext>
74# if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
75# include <QtGui/QOpenGLFramebufferObject>
77# include <QOpenGLFramebufferObject>
78# include <QOpenGLPaintDevice>
80# ifdef QCP_OPENGL_OFFSCREENSURFACE
81# include <QtGui/QOffscreenSurface>
83# include <QtGui/QWindow>
86#ifdef QCP_OPENGL_PBUFFER
87# include <QtOpenGL/QGLPixelBuffer>
89#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
91# include <QtGui/QWidget>
92# include <QtGui/QPrinter>
93# include <QtGui/QPrintEngine>
96# include <QtWidgets/QWidget>
97# include <QtPrintSupport/QtPrintSupport>
99#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
100# include <QtCore/QElapsedTimer>
102# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
103# include <QtCore/QTimeZone>
134#define QCUSTOMPLOT_VERSION_STR "2.1.1"
135#define QCUSTOMPLOT_VERSION 0x020101
138#if defined(QT_STATIC_BUILD)
140#elif defined(QCUSTOMPLOT_COMPILE_LIBRARY)
141# define QCP_LIB_DECL Q_DECL_EXPORT
142#elif defined(QCUSTOMPLOT_USE_LIBRARY)
143# define QCP_LIB_DECL Q_DECL_IMPORT
149#ifndef Q_DECL_OVERRIDE
150# define Q_DECL_OVERRIDE
161#if QT_VERSION >= 0x060200
180 Q_FLAGS(AntialiasedElements)
181 Q_FLAGS(PlottingHints)
183 Q_FLAGS(Interactions)
336inline bool isInvalidData(
double value)
338 return qIsNaN(value) || qIsInf(value);
346inline bool isInvalidData(
double value1,
double value2)
348 return isInvalidData(value1) || isInvalidData(value2);
357inline void setMarginValue(QMargins &margins,
QCP::MarginSide side,
int value)
363 case QCP::msTop: margins.setTop(value);
break;
365 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
377inline int getMarginValue(
const QMargins &margins,
QCP::MarginSide side)
393#if QT_VERSION >= 0x060200
404Q_FLAG_NS(AntialiasedElements)
405Q_FLAG_NS(PlottingHints)
406Q_FLAG_NS(MarginSides)
407Q_FLAG_NS(Interactions)
409extern const QMetaObject staticMetaObject;
414Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
415Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
416Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
417Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
422#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
449 double x()
const {
return mX; }
450 double y()
const {
return mY; }
451 double &rx() {
return mX; }
452 double &ry() {
return mY; }
455 void setX(
double x) { mX = x; }
456 void setY(
double y) { mY = y; }
459 double length()
const {
return qSqrt(mX*mX+mY*mY); }
461 double angle()
const {
return qAtan2(mY, mX); }
462 QPoint
toPoint()
const {
return QPoint(
int(mX),
int(mY)); }
463 QPointF
toPointF()
const {
return QPointF(mX, mY); }
465 bool isNull()
const {
return qIsNull(mX) && qIsNull(mY); }
471 double distanceSquaredToLine(
const QLineF &line)
const;
490Q_DECLARE_TYPEINFO(QCPVector2D, Q_MOVABLE_TYPE);
492inline const QCPVector2D operator*(
double factor,
const QCPVector2D &vec) {
return QCPVector2D(vec.mX*factor, vec.mY*factor); }
493inline const QCPVector2D operator*(
const QCPVector2D &vec,
double factor) {
return QCPVector2D(vec.mX*factor, vec.mY*factor); }
494inline const QCPVector2D operator/(
const QCPVector2D &vec,
double divisor) {
return QCPVector2D(vec.mX/divisor, vec.mY/divisor); }
495inline const QCPVector2D operator+(
const QCPVector2D &vec1,
const QCPVector2D &vec2) {
return QCPVector2D(vec1.mX+vec2.mX, vec1.mY+vec2.mY); }
496inline const QCPVector2D operator-(
const QCPVector2D &vec1,
const QCPVector2D &vec2) {
return QCPVector2D(vec1.mX-vec2.mX, vec1.mY-vec2.mY); }
497inline const QCPVector2D operator-(
const QCPVector2D &vec) {
return QCPVector2D(-vec.mX, -vec.mY); }
505 d.nospace() <<
"QCPVector2D(" << vec.x() <<
", " << vec.y() <<
")";
529 Q_FLAGS(PainterModes)
530 Q_DECLARE_FLAGS(PainterModes, PainterMode)
536 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
537 PainterModes modes()
const {
return mModes; }
540 void setAntialiasing(
bool enabled);
541 void setMode(PainterMode mode,
bool enabled=
true);
542 void setModes(PainterModes modes);
545 bool begin(QPaintDevice *device);
546 void setPen(
const QPen &pen);
547 void setPen(
const QColor &color);
548 void setPen(Qt::PenStyle penStyle);
549 void drawLine(
const QLineF &line);
550 void drawLine(
const QPointF &p1,
const QPointF &p2) {drawLine(QLineF(p1, p2));}
555 void makeNonCosmetic();
560 bool mIsAntialiasing;
563 QStack<bool> mAntialiasingStack;
565Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
581 QSize size()
const {
return mSize; }
582 bool invalidated()
const {
return mInvalidated; }
583 double devicePixelRatio()
const {
return mDevicePixelRatio; }
586 void setSize(
const QSize &size);
594 virtual void clear(
const QColor &color) = 0;
599 double mDevicePixelRatio;
618 void clear(
const QColor &color) Q_DECL_OVERRIDE;
629#ifdef QCP_OPENGL_PBUFFER
633 explicit QCPPaintBufferGlPbuffer(
const QSize &size,
double devicePixelRatio,
int multisamples);
634 virtual ~QCPPaintBufferGlPbuffer() Q_DECL_OVERRIDE;
637 virtual
QCPPainter *startPainting() Q_DECL_OVERRIDE;
638 virtual
void draw(
QCPPainter *painter) const Q_DECL_OVERRIDE;
639 void clear(const QColor &color) Q_DECL_OVERRIDE;
643 QGLPixelBuffer *mGlPBuffer;
647 virtual
void reallocateBuffer() Q_DECL_OVERRIDE;
656 explicit QCPPaintBufferGlFbo(
const QSize &size,
double devicePixelRatio, QWeakPointer<QOpenGLContext> glContext, QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
657 virtual ~QCPPaintBufferGlFbo() Q_DECL_OVERRIDE;
660 virtual
QCPPainter *startPainting() Q_DECL_OVERRIDE;
661 virtual
void donePainting() Q_DECL_OVERRIDE;
662 virtual
void draw(
QCPPainter *painter) const Q_DECL_OVERRIDE;
663 void clear(const QColor &color) Q_DECL_OVERRIDE;
667 QWeakPointer<QOpenGLContext> mGlContext;
668 QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
669 QOpenGLFramebufferObject *mGlFrameBuffer;
672 virtual
void reallocateBuffer() Q_DECL_OVERRIDE;
686 Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
687 Q_PROPERTY(QString name READ name)
690 Q_PROPERTY(
bool visible READ visible WRITE
setVisible)
711 QCustomPlot *parentPlot()
const {
return mParentPlot; }
712 QString name()
const {
return mName; }
713 int index()
const {
return mIndex; }
714 QList<QCPLayerable*>
children()
const {
return mChildren; }
715 bool visible()
const {
return mVisible; }
716 LayerMode mode()
const {
return mMode; }
719 void setVisible(
bool visible);
720 void setMode(LayerMode mode);
727 QCustomPlot *mParentPlot;
730 QList<QCPLayerable*> mChildren;
735 QWeakPointer<QCPAbstractPaintBuffer> mPaintBuffer;
738 void draw(QCPPainter *painter);
739 void drawToPaintBuffer();
740 void addChild(QCPLayerable *layerable,
bool prepend);
741 void removeChild(QCPLayerable *layerable);
744 Q_DISABLE_COPY(QCPLayer)
746 friend class QCustomPlot;
747 friend class QCPLayerable;
755 Q_PROPERTY(
bool visible READ visible WRITE
setVisible)
756 Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
759 Q_PROPERTY(
bool antialiased READ antialiased WRITE
setAntialiased)
766 bool visible()
const {
return mVisible; }
767 QCustomPlot *parentPlot()
const {
return mParentPlot; }
769 QCPLayer *layer()
const {
return mLayer; }
770 bool antialiased()
const {
return mAntialiased; }
773 void setVisible(
bool on);
774 Q_SLOT
bool setLayer(QCPLayer *layer);
775 bool setLayer(
const QString &layerName);
776 void setAntialiased(
bool enabled);
779 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const;
782 bool realVisibility()
const;
790 QCustomPlot *mParentPlot;
791 QPointer<QCPLayerable> mParentLayerable;
796 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
798 virtual QRect clipRect()
const;
799 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
802 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
803 virtual void deselectEvent(
bool *selectionStateChanged);
805 virtual void mousePressEvent(QMouseEvent *event,
const QVariant &details);
806 virtual void mouseMoveEvent(QMouseEvent *event,
const QPointF &startPos);
812 void initializeParentPlot(QCustomPlot *parentPlot);
814 bool moveToLayer(QCPLayer *layer,
bool prepend);
820 friend class QCustomPlot;
821 friend class QCPLayer;
822 friend class QCPAxisRect;
837 QCPRange(
double lower,
double upper);
839 bool operator==(
const QCPRange& other)
const {
return lower == other.lower && upper == other.upper; }
840 bool operator!=(
const QCPRange& other)
const {
return !(*
this == other); }
848 friend inline const QCPRange operator-(
const QCPRange& range,
double value);
849 friend inline const QCPRange operator*(
const QCPRange& range,
double value);
850 friend inline const QCPRange operator*(
double value,
const QCPRange& range);
851 friend inline const QCPRange operator/(
const QCPRange& range,
double value);
853 double size()
const {
return upper-lower; }
854 double center()
const {
return (upper+lower)*0.5; }
855 void normalize() {
if (lower > upper) qSwap(lower, upper); }
856 void expand(
const QCPRange &otherRange);
857 void expand(
double includeCoord);
859 QCPRange expanded(
double includeCoord)
const;
860 QCPRange bounded(
double lowerBound,
double upperBound)
const;
861 QCPRange sanitizedForLogScale()
const;
862 QCPRange sanitizedForLinScale()
const;
863 bool contains(
double value)
const {
return value >= lower && value <= upper; }
865 static bool validRange(
double lower,
double upper);
866 static bool validRange(
const QCPRange &range);
871Q_DECLARE_TYPEINFO(
QCPRange, Q_MOVABLE_TYPE);
877inline QDebug operator<< (QDebug d,
const QCPRange &range)
879 d.nospace() <<
"QCPRange(" << range.lower <<
", " << range.upper <<
")";
955 bool operator==(
const QCPDataRange& other)
const {
return mBegin == other.mBegin && mEnd == other.mEnd; }
956 bool operator!=(
const QCPDataRange& other)
const {
return !(*
this == other); }
959 int begin()
const {
return mBegin; }
960 int end()
const {
return mEnd; }
961 int size()
const {
return mEnd-mBegin; }
969 bool isValid()
const {
return (mEnd >= mBegin) && (mBegin >= 0); }
983Q_DECLARE_TYPEINFO(QCPDataRange, Q_MOVABLE_TYPE);
993 bool operator!=(
const QCPDataSelection& other)
const {
return !(*
this == other); }
1009 int dataPointCount()
const;
1015 void addDataRange(
const QCPDataRange &dataRange,
bool simplify=
true);
1017 bool isEmpty()
const {
return mDataRanges.isEmpty(); }
1027 QList<QCPDataRange> mDataRanges;
1029 inline static bool lessThanDataRangeBegin(
const QCPDataRange &a,
const QCPDataRange &b) {
return a.begin() < b.begin(); }
1031Q_DECLARE_METATYPE(QCPDataSelection)
1124 d.nospace() <<
"QCPDataRange(" << dataRange.begin() <<
", " << dataRange.end() <<
")";
1134 d.nospace() <<
"QCPDataSelection(";
1161 QRect rect()
const {
return mRect; }
1163 QPen pen()
const {
return mPen; }
1164 QBrush brush()
const {
return mBrush; }
1168 void setPen(
const QPen &pen);
1169 void setBrush(
const QBrush &brush);
1172 Q_SLOT
void cancel();
1176 void changed(
const QRect &rect, QMouseEvent *event);
1189 virtual void startSelection(QMouseEvent *event);
1190 virtual void moveSelection(QMouseEvent *event);
1191 virtual void endSelection(QMouseEvent *event);
1192 virtual void keyPressEvent(QKeyEvent *event);
1195 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
1196 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
1198 friend class QCustomPlot;
1216 bool isEmpty()
const;
1222 QHash<QCP::MarginSide, QList<QCPLayoutElement*> > mChildren;
1245 Q_PROPERTY(QMargins margins READ margins WRITE
setMargins)
1247 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE
setMinimumSize)
1248 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE
setMaximumSize)
1260 Q_ENUMS(UpdatePhase)
1273 Q_ENUMS(SizeConstraintRect)
1279 QCPLayout *
layout()
const {
return mParentLayout; }
1280 QRect
rect()
const {
return mRect; }
1282 QMargins margins()
const {
return mMargins; }
1283 QMargins minimumMargins()
const {
return mMinimumMargins; }
1284 QCP::MarginSides autoMargins()
const {
return mAutoMargins; }
1285 QSize minimumSize()
const {
return mMinimumSize; }
1286 QSize maximumSize()
const {
return mMaximumSize; }
1287 SizeConstraintRect sizeConstraintRect()
const {
return mSizeConstraintRect; }
1288 QCPMarginGroup *marginGroup(
QCP::MarginSide side)
const {
return mMarginGroups.value(side,
nullptr); }
1289 QHash<QCP::MarginSide, QCPMarginGroup*> marginGroups()
const {
return mMarginGroups; }
1292 void setOuterRect(
const QRect &rect);
1293 void setMargins(
const QMargins &margins);
1294 void setMinimumMargins(
const QMargins &margins);
1295 void setAutoMargins(QCP::MarginSides sides);
1296 void setMinimumSize(
const QSize &size);
1297 void setMinimumSize(
int width,
int height);
1298 void setMaximumSize(
const QSize &size);
1299 void setMaximumSize(
int width,
int height);
1300 void setSizeConstraintRect(SizeConstraintRect constraintRect);
1301 void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group);
1304 virtual void update(UpdatePhase phase);
1305 virtual QSize minimumOuterSizeHint()
const;
1306 virtual QSize maximumOuterSizeHint()
const;
1307 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
1310 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
1314 QCPLayout *mParentLayout;
1315 QSize mMinimumSize, mMaximumSize;
1316 SizeConstraintRect mSizeConstraintRect;
1317 QRect mRect, mOuterRect;
1318 QMargins mMargins, mMinimumMargins;
1319 QCP::MarginSides mAutoMargins;
1320 QHash<QCP::MarginSide, QCPMarginGroup*> mMarginGroups;
1323 virtual
int calculateAutoMargin(QCP::MarginSide side);
1324 virtual
void layoutChanged();
1327 virtual
void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1328 virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1329 virtual void parentPlotInitialized(QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
1332 Q_DISABLE_COPY(QCPLayoutElement)
1334 friend class QCustomPlot;
1335 friend class QCPLayout;
1336 friend class QCPMarginGroup;
1349 virtual QList<QCPLayoutElement*>
elements(
bool recursive)
const Q_DECL_OVERRIDE;
1354 virtual QCPLayoutElement*
takeAt(
int index) = 0;
1355 virtual bool take(QCPLayoutElement* element) = 0;
1360 bool remove(QCPLayoutElement* element);
1365 virtual void updateLayout();
1369 void adoptElement(QCPLayoutElement *el);
1370 void releaseElement(QCPLayoutElement *el);
1371 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
const;
1372 static QSize getFinalMinimumOuterSize(
const QCPLayoutElement *el);
1373 static QSize getFinalMaximumOuterSize(
const QCPLayoutElement *el);
1377 friend class QCPLayoutElement;
1390 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE
setRowSpacing)
1392 Q_PROPERTY(
int wrap READ wrap WRITE
setWrap)
1413 int columnCount()
const {
return mElements.size() > 0 ? mElements.first().size() : 0; }
1414 QList<double> columnStretchFactors()
const {
return mColumnStretchFactors; }
1415 QList<double> rowStretchFactors()
const {
return mRowStretchFactors; }
1416 int columnSpacing()
const {
return mColumnSpacing; }
1417 int rowSpacing()
const {
return mRowSpacing; }
1418 int wrap()
const {
return mWrap; }
1419 FillOrder fillOrder()
const {
return mFillOrder; }
1422 void setColumnStretchFactor(
int column,
double factor);
1423 void setColumnStretchFactors(
const QList<double> &factors);
1424 void setRowStretchFactor(
int row,
double factor);
1425 void setRowStretchFactors(
const QList<double> &factors);
1426 void setColumnSpacing(
int pixels);
1427 void setRowSpacing(
int pixels);
1428 void setWrap(
int count);
1429 void setFillOrder(FillOrder order,
bool rearrange=
true);
1432 virtual void updateLayout() Q_DECL_OVERRIDE;
1437 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const Q_DECL_OVERRIDE;
1438 virtual void simplify() Q_DECL_OVERRIDE;
1439 virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE;
1440 virtual QSize maximumOuterSizeHint() const Q_DECL_OVERRIDE;
1446 bool hasElement(
int row,
int column);
1447 void expandTo(
int newRowCount,
int newColumnCount);
1448 void insertRow(
int newIndex);
1449 void insertColumn(
int newIndex);
1450 int rowColToIndex(
int row,
int column) const;
1451 void indexToRowCol(
int index,
int &row,
int &column) const;
1456 QList<
double> mColumnStretchFactors;
1457 QList<
double> mRowStretchFactors;
1458 int mColumnSpacing, mRowSpacing;
1460 FillOrder mFillOrder;
1463 void getMinimumRowColSizes(QVector<
int> *minColWidths, QVector<
int> *minRowHeights) const;
1464 void getMaximumRowColSizes(QVector<
int> *maxColWidths, QVector<
int> *maxRowHeights) const;
1482 Q_ENUMS(InsetPlacement)
1488 InsetPlacement insetPlacement(
int index) const;
1489 Qt::Alignment insetAlignment(
int index) const;
1490 QRectF insetRect(
int index) const;
1493 void setInsetPlacement(
int index, InsetPlacement placement);
1494 void setInsetAlignment(
int index, Qt::Alignment alignment);
1495 void setInsetRect(
int index, const QRectF &rect);
1498 virtual
void updateLayout() Q_DECL_OVERRIDE;
1499 virtual
int elementCount() const Q_DECL_OVERRIDE;
1504 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
1513 QList<InsetPlacement> mInsetPlacement;
1514 QList<Qt::Alignment> mInsetAlignment;
1515 QList<QRectF> mInsetRect;
1554 Q_ENUMS(EndingStyle)
1557 QCPLineEnding(EndingStyle style,
double width=8,
double length=10,
bool inverted=
false);
1560 EndingStyle style()
const {
return mStyle; }
1561 double width()
const {
return mWidth; }
1562 double length()
const {
return mLength; }
1563 bool inverted()
const {
return mInverted; }
1566 void setStyle(EndingStyle style);
1567 void setWidth(
double width);
1568 void setLength(
double length);
1569 void setInverted(
bool inverted);
1572 double boundingDistance()
const;
1573 double realLength()
const;
1574 void draw(QCPPainter *painter,
const QCPVector2D &pos,
const QCPVector2D &dir)
const;
1575 void draw(QCPPainter *painter,
const QCPVector2D &pos,
double angle)
const;
1580 double mWidth, mLength;
1583Q_DECLARE_TYPEINFO(QCPLineEnding, Q_MOVABLE_TYPE);
1611 Q_ENUMS(AnchorReferenceType)
1631 void setAnchorSide(AnchorSide side);
1632 void setAnchorMode(AnchorMode mode);
1633 void setAnchorReference(
const QPointF &pixelPoint);
1634 void setAnchorReferenceType(AnchorReferenceType type);
1635 void setFont(
const QFont &font);
1636 void setColor(
const QColor &color);
1637 void setPadding(
int padding);
1638 void setRotation(
double rotation);
1639 void setSubstituteExponent(
bool enabled);
1640 void setMultiplicationSymbol(QChar symbol);
1641 void setAbbreviateDecimalPowers(
bool enabled);
1642 void setCacheSize(
int labelCount);
1645 AnchorMode anchorMode()
const {
return mAnchorMode; }
1646 AnchorSide anchorSide()
const {
return mAnchorSide; }
1647 QPointF anchorReference()
const {
return mAnchorReference; }
1648 AnchorReferenceType anchorReferenceType()
const {
return mAnchorReferenceType; }
1649 QFont font()
const {
return mFont; }
1650 QColor color()
const {
return mColor; }
1651 int padding()
const {
return mPadding; }
1652 double rotation()
const {
return mRotation; }
1653 bool substituteExponent()
const {
return mSubstituteExponent; }
1654 QChar multiplicationSymbol()
const {
return mMultiplicationSymbol; }
1655 bool abbreviateDecimalPowers()
const {
return mAbbreviateDecimalPowers; }
1656 int cacheSize()
const;
1661 void drawTickLabel(QCPPainter *painter,
const QPointF &tickPos,
const QString &text);
1665 static const QChar SymbolDot;
1666 static const QChar SymbolCross;
1678 QTransform transform;
1679 QString basePart, expPart, suffixPart;
1680 QRect baseBounds, expBounds, suffixBounds;
1682 QRect rotatedTotalBounds;
1683 QFont baseFont, expFont;
1690 QPointF mAnchorReference;
1696 bool mSubstituteExponent;
1697 QChar mMultiplicationSymbol;
1698 bool mAbbreviateDecimalPowers;
1701 QByteArray mLabelParameterHash;
1702 QCache<QString, CachedLabel> mLabelCache;
1703 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
1704 int mLetterCapHeight, mLetterDescent;
1707 virtual void drawLabelMaybeCached(
QCPPainter *painter,
const QFont &font,
const QColor &color,
const QPointF &pos,
AnchorSide side,
double rotation,
const QString &text);
1708 virtual QByteArray generateLabelParameterHash()
const;
1711 QPointF getAnchorPos(
const QPointF &tickPos);
1713 LabelData getTickLabelData(
const QFont &font,
const QColor &color,
double rotation,
AnchorSide side,
const QString &text)
const;
1714 void applyAnchorTransform(
LabelData &labelData)
const;
1717 QByteArray cacheKey(
const QString &text,
const QColor &color,
double rotation,
AnchorSide side)
const;
1718 AnchorSide skewedAnchorSide(
const QPointF &tickPos,
double sideExpandHorz,
double sideExpandVert)
const;
1720 void analyzeFontMetrics();
1746 Q_ENUMS(TickStepStrategy)
1752 TickStepStrategy tickStepStrategy()
const {
return mTickStepStrategy; }
1753 int tickCount()
const {
return mTickCount; }
1754 double tickOrigin()
const {
return mTickOrigin; }
1757 void setTickStepStrategy(TickStepStrategy strategy);
1758 void setTickCount(
int count);
1759 void setTickOrigin(
double origin);
1762 virtual void generate(
const QCPRange &range,
const QLocale &locale, QChar formatChar,
int precision, QVector<double> &ticks, QVector<double> *subTicks, QVector<QString> *tickLabels);
1766 TickStepStrategy mTickStepStrategy;
1771 virtual double getTickStep(
const QCPRange &range);
1772 virtual int getSubTickCount(
double tickStep);
1773 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision);
1774 virtual QVector<double> createTickVector(
double tickStep,
const QCPRange &range);
1775 virtual QVector<double> createSubTickVector(
int subTickCount,
const QVector<double> &ticks);
1776 virtual QVector<QString> createLabelVector(
const QVector<double> &ticks,
const QLocale &locale, QChar formatChar,
int precision);
1779 void trimTicks(
const QCPRange &range, QVector<double> &ticks,
bool keepOneOutlier)
const;
1780 double pickClosest(
double target,
const QVector<double> &candidates)
const;
1781 double getMantissa(
double input,
double *magnitude=
nullptr)
const;
1782 double cleanMantissa(
double input)
const;
1785 Q_DISABLE_COPY(QCPAxisTicker)
1789Q_DECLARE_METATYPE(QSharedPointer<QCPAxisTicker>)
1803 QString dateTimeFormat()
const {
return mDateTimeFormat; }
1804 Qt::TimeSpec dateTimeSpec()
const {
return mDateTimeSpec; }
1805# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
1806 QTimeZone timeZone()
const {
return mTimeZone; }
1812# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
1821 static double dateTimeToKey(
const QDate &date, Qt::TimeSpec timeSpec=Qt::LocalTime);
1825 QString mDateTimeFormat;
1826 Qt::TimeSpec mDateTimeSpec;
1827# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
1828 QTimeZone mTimeZone;
1831 enum DateStrategy {dsNone, dsUniformTimeInDay, dsUniformDayInMonth} mDateStrategy;
1834 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1835 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1836 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1837 virtual QVector<double> createTickVector(
double tickStep,
const QCPRange &range) Q_DECL_OVERRIDE;
1866 QString timeFormat()
const {
return mTimeFormat; }
1867 int fieldWidth(TimeUnit unit)
const {
return mFieldWidth.value(unit); }
1870 void setTimeFormat(
const QString &format);
1871 void setFieldWidth(TimeUnit unit,
int width);
1875 QString mTimeFormat;
1876 QHash<TimeUnit, int> mFieldWidth;
1879 TimeUnit mSmallestUnit, mBiggestUnit;
1880 QHash<TimeUnit, QString> mFormatPattern;
1883 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1884 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1885 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1888 void replaceUnit(QString &text, TimeUnit unit,
int value)
const;
1912 Q_ENUMS(ScaleStrategy)
1917 double tickStep()
const {
return mTickStep; }
1918 ScaleStrategy scaleStrategy()
const {
return mScaleStrategy; }
1921 void setTickStep(
double step);
1922 void setScaleStrategy(ScaleStrategy strategy);
1927 ScaleStrategy mScaleStrategy;
1930 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1946 QMap<double, QString> &
ticks() {
return mTicks; }
1947 int subTickCount()
const {
return mSubTickCount; }
1950 void setTicks(
const QMap<double, QString> &ticks);
1951 void setTicks(
const QVector<double> &positions,
const QVector<QString> &labels);
1952 void setSubTickCount(
int subTicks);
1956 void addTick(
double position,
const QString &label);
1957 void addTicks(
const QMap<double, QString> &ticks);
1958 void addTicks(
const QVector<double> &positions,
const QVector<QString> &labels);
1962 QMap<double, QString> mTicks;
1966 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1967 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1968 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1969 virtual QVector<double> createTickVector(
double tickStep,
const QCPRange &range) Q_DECL_OVERRIDE;
1991 Q_ENUMS(FractionStyle)
1996 QString piSymbol()
const {
return mPiSymbol; }
1997 double piValue()
const {
return mPiValue; }
1998 bool periodicity()
const {
return mPeriodicity; }
1999 FractionStyle fractionStyle()
const {
return mFractionStyle; }
2002 void setPiSymbol(QString symbol);
2003 void setPiValue(
double pi);
2004 void setPeriodicity(
int multiplesOfPi);
2005 void setFractionStyle(FractionStyle style);
2012 FractionStyle mFractionStyle;
2018 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
2019 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
2020 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision) Q_DECL_OVERRIDE;
2023 void simplifyFraction(
int &numerator,
int &denominator)
const;
2024 QString fractionToString(
int numerator,
int denominator)
const;
2025 QString unicodeFraction(
int numerator,
int denominator)
const;
2026 QString unicodeSuperscript(
int number)
const;
2027 QString unicodeSubscript(
int number)
const;
2043 double logBase()
const {
return mLogBase; }
2044 int subTickCount()
const {
return mSubTickCount; }
2056 double mLogBaseLnInv;
2059 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
2060 virtual QVector<double> createTickVector(
double tickStep,
const QCPRange &range) Q_DECL_OVERRIDE;
2076 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
2077 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE
setSubGridPen)
2078 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE
setZeroLinePen)
2081 explicit QCPGrid(QCPAxis *parentAxis);
2084 bool subGridVisible()
const {
return mSubGridVisible; }
2085 bool antialiasedSubGrid()
const {
return mAntialiasedSubGrid; }
2086 bool antialiasedZeroLine()
const {
return mAntialiasedZeroLine; }
2087 QPen pen()
const {
return mPen; }
2088 QPen subGridPen()
const {
return mSubGridPen; }
2089 QPen zeroLinePen()
const {
return mZeroLinePen; }
2095 void setPen(
const QPen &pen);
2101 bool mSubGridVisible;
2102 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
2103 QPen mPen, mSubGridPen, mZeroLinePen;
2106 QCPAxis *mParentAxis;
2109 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
2110 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
2113 void drawGridLines(
QCPPainter *painter)
const;
2114 void drawSubGridLines(
QCPPainter *painter)
const;
2116 friend class QCPAxis;
2124 Q_PROPERTY(
AxisType axisType READ axisType)
2125 Q_PROPERTY(QCPAxisRect* axisRect READ axisRect)
2130 Q_PROPERTY(
bool ticks READ ticks WRITE
setTicks)
2131 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE
setTickLabels)
2137 Q_PROPERTY(QString numberFormat READ numberFormat WRITE
setNumberFormat)
2139 Q_PROPERTY(QVector<double> tickVector READ tickVector)
2140 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels)
2143 Q_PROPERTY(
bool subTicks READ subTicks WRITE
setSubTicks)
2146 Q_PROPERTY(QPen basePen READ basePen WRITE
setBasePen)
2147 Q_PROPERTY(QPen tickPen READ tickPen WRITE
setTickPen)
2148 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE
setSubTickPen)
2149 Q_PROPERTY(QFont labelFont READ labelFont WRITE
setLabelFont)
2150 Q_PROPERTY(QColor labelColor READ labelColor WRITE
setLabelColor)
2151 Q_PROPERTY(QString label READ label WRITE
setLabel)
2153 Q_PROPERTY(
int padding READ padding WRITE
setPadding)
2154 Q_PROPERTY(
int offset READ offset WRITE
setOffset)
2166 Q_PROPERTY(QCPGrid*
grid READ
grid)
2180 Q_DECLARE_FLAGS(AxisTypes, AxisType)
2207 Q_ENUMS(SelectablePart)
2208 Q_FLAGS(SelectableParts)
2209 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2212 virtual ~QCPAxis() Q_DECL_OVERRIDE;
2215 AxisType axisType()
const {
return mAxisType; }
2216 QCPAxisRect *axisRect()
const {
return mAxisRect; }
2217 ScaleType scaleType()
const {
return mScaleType; }
2218 const QCPRange range()
const {
return mRange; }
2219 bool rangeReversed()
const {
return mRangeReversed; }
2220 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
2221 bool ticks()
const {
return mTicks; }
2222 bool tickLabels()
const {
return mTickLabels; }
2223 int tickLabelPadding()
const;
2224 QFont tickLabelFont()
const {
return mTickLabelFont; }
2225 QColor tickLabelColor()
const {
return mTickLabelColor; }
2226 double tickLabelRotation()
const;
2227 LabelSide tickLabelSide()
const;
2228 QString numberFormat()
const;
2229 int numberPrecision()
const {
return mNumberPrecision; }
2230 QVector<double> tickVector()
const {
return mTickVector; }
2231 QVector<QString> tickVectorLabels()
const {
return mTickVectorLabels; }
2232 int tickLengthIn()
const;
2233 int tickLengthOut()
const;
2234 bool subTicks()
const {
return mSubTicks; }
2235 int subTickLengthIn()
const;
2236 int subTickLengthOut()
const;
2237 QPen basePen()
const {
return mBasePen; }
2238 QPen tickPen()
const {
return mTickPen; }
2239 QPen subTickPen()
const {
return mSubTickPen; }
2240 QFont labelFont()
const {
return mLabelFont; }
2241 QColor labelColor()
const {
return mLabelColor; }
2242 QString label()
const {
return mLabel; }
2243 int labelPadding()
const;
2244 int padding()
const {
return mPadding; }
2246 SelectableParts selectedParts()
const {
return mSelectedParts; }
2247 SelectableParts selectableParts()
const {
return mSelectableParts; }
2248 QFont selectedTickLabelFont()
const {
return mSelectedTickLabelFont; }
2249 QFont selectedLabelFont()
const {
return mSelectedLabelFont; }
2250 QColor selectedTickLabelColor()
const {
return mSelectedTickLabelColor; }
2251 QColor selectedLabelColor()
const {
return mSelectedLabelColor; }
2252 QPen selectedBasePen()
const {
return mSelectedBasePen; }
2253 QPen selectedTickPen()
const {
return mSelectedTickPen; }
2254 QPen selectedSubTickPen()
const {
return mSelectedSubTickPen; }
2255 QCPLineEnding lowerEnding()
const;
2256 QCPLineEnding upperEnding()
const;
2257 QCPGrid *
grid()
const {
return mGrid; }
2261 Q_SLOT
void setRange(
const QCPRange &range);
2262 void setRange(
double lower,
double upper);
2263 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
2264 void setRangeLower(
double lower);
2265 void setRangeUpper(
double upper);
2266 void setRangeReversed(
bool reversed);
2267 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
2268 void setTicks(
bool show);
2269 void setTickLabels(
bool show);
2270 void setTickLabelPadding(
int padding);
2271 void setTickLabelFont(
const QFont &font);
2272 void setTickLabelColor(
const QColor &color);
2273 void setTickLabelRotation(
double degrees);
2274 void setTickLabelSide(LabelSide side);
2275 void setNumberFormat(
const QString &formatCode);
2276 void setNumberPrecision(
int precision);
2277 void setTickLength(
int inside,
int outside=0);
2278 void setTickLengthIn(
int inside);
2279 void setTickLengthOut(
int outside);
2280 void setSubTicks(
bool show);
2281 void setSubTickLength(
int inside,
int outside=0);
2282 void setSubTickLengthIn(
int inside);
2283 void setSubTickLengthOut(
int outside);
2284 void setBasePen(
const QPen &pen);
2285 void setTickPen(
const QPen &pen);
2286 void setSubTickPen(
const QPen &pen);
2287 void setLabelFont(
const QFont &font);
2288 void setLabelColor(
const QColor &color);
2289 void setLabel(
const QString &str);
2290 void setLabelPadding(
int padding);
2291 void setPadding(
int padding);
2292 void setOffset(
int offset);
2293 void setSelectedTickLabelFont(
const QFont &font);
2294 void setSelectedLabelFont(
const QFont &font);
2295 void setSelectedTickLabelColor(
const QColor &color);
2296 void setSelectedLabelColor(
const QColor &color);
2297 void setSelectedBasePen(
const QPen &pen);
2298 void setSelectedTickPen(
const QPen &pen);
2299 void setSelectedSubTickPen(
const QPen &pen);
2300 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
2301 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
2306 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
2311 void moveRange(
double diff);
2312 void scaleRange(
double factor);
2313 void scaleRange(
double factor,
double center);
2314 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
2315 void rescale(
bool onlyVisiblePlottables=
false);
2316 double pixelToCoord(
double value)
const;
2317 double coordToPixel(
double value)
const;
2318 SelectablePart getPartAt(
const QPointF &pos)
const;
2319 QList<QCPAbstractPlottable*> plottables()
const;
2320 QList<QCPGraph*> graphs()
const;
2321 QList<QCPAbstractItem*> items()
const;
2325 static AxisType opposite(AxisType type);
2338 QCPAxisRect *mAxisRect;
2341 Qt::Orientation mOrientation;
2342 SelectableParts mSelectableParts, mSelectedParts;
2343 QPen mBasePen, mSelectedBasePen;
2348 QFont mLabelFont, mSelectedLabelFont;
2349 QColor mLabelColor, mSelectedLabelColor;
2354 QFont mTickLabelFont, mSelectedTickLabelFont;
2355 QColor mTickLabelColor, mSelectedTickLabelColor;
2356 int mNumberPrecision;
2357 QLatin1Char mNumberFormatChar;
2358 bool mNumberBeautifulPowers;
2364 QPen mTickPen, mSelectedTickPen;
2365 QPen mSubTickPen, mSelectedSubTickPen;
2368 bool mRangeReversed;
2374 QSharedPointer<QCPAxisTicker> mTicker;
2375 QVector<double> mTickVector;
2376 QVector<QString> mTickVectorLabels;
2377 QVector<double> mSubTickVector;
2378 bool mCachedMarginValid;
2382 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2385 virtual int calculateMargin();
2388 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
2389 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
2392 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2393 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2395 virtual
void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE;
2396 virtual
void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
2397 virtual
void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
2398 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
2401 void setupTickVectors();
2402 QPen getBasePen() const;
2403 QPen getTickPen() const;
2404 QPen getSubTickPen() const;
2405 QFont getTickLabelFont() const;
2406 QFont getLabelFont() const;
2407 QColor getTickLabelColor() const;
2408 QColor getLabelColor() const;
2413 friend class QCustomPlot;
2414 friend class QCPGrid;
2415 friend class QCPAxisRect;
2417Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::SelectableParts)
2418Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::AxisTypes)
2435 QRect axisSelectionBox()
const {
return mAxisSelectionBox; }
2436 QRect tickLabelsSelectionBox()
const {
return mTickLabelsSelectionBox; }
2437 QRect labelSelectionBox()
const {
return mLabelSelectionBox; }
2447 int tickLabelPadding;
2448 double tickLabelRotation;
2450 bool substituteExponent;
2451 bool numberMultiplyCross;
2452 int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut;
2453 QPen tickPen, subTickPen;
2454 QFont tickLabelFont;
2455 QColor tickLabelColor;
2456 QRect axisRect, viewportRect;
2458 bool abbreviateDecimalPowers;
2459 bool reversedEndings;
2461 QVector<double> subTickPositions;
2462 QVector<double> tickPositions;
2463 QVector<QString> tickLabels;
2473 QString basePart, expPart, suffixPart;
2474 QRect baseBounds, expBounds, suffixBounds, totalBounds, rotatedTotalBounds;
2475 QFont baseFont, expFont;
2478 QByteArray mLabelParameterHash;
2479 QCache<QString, CachedLabel> mLabelCache;
2480 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
2482 virtual QByteArray generateLabelParameterHash()
const;
2484 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
2486 virtual TickLabelData getTickLabelData(
const QFont &font,
const QString &text)
const;
2487 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
2488 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
2516 Q_ENUMS(ScatterProperty)
2517 Q_FLAGS(ScatterProperties)
2518 Q_DECLARE_FLAGS(ScatterProperties, ScatterProperty)
2546 Q_ENUMS(ScatterShape)
2550 QCPScatterStyle(ScatterShape shape,
const QColor &color,
double size);
2551 QCPScatterStyle(ScatterShape shape,
const QColor &color,
const QColor &fill,
double size);
2552 QCPScatterStyle(ScatterShape shape,
const QPen &pen,
const QBrush &brush,
double size);
2554 QCPScatterStyle(
const QPainterPath &customPath,
const QPen &pen,
const QBrush &brush=Qt::NoBrush,
double size=6);
2557 double size()
const {
return mSize; }
2558 ScatterShape shape()
const {
return mShape; }
2559 QPen pen()
const {
return mPen; }
2560 QBrush brush()
const {
return mBrush; }
2561 QPixmap pixmap()
const {
return mPixmap; }
2562 QPainterPath customPath()
const {
return mCustomPath; }
2565 void setFromOther(
const QCPScatterStyle &other, ScatterProperties properties);
2566 void setSize(
double size);
2567 void setShape(ScatterShape shape);
2568 void setPen(
const QPen &pen);
2569 void setBrush(
const QBrush &brush);
2570 void setPixmap(
const QPixmap &pixmap);
2571 void setCustomPath(
const QPainterPath &customPath);
2577 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
2578 void drawShape(
QCPPainter *painter,
const QPointF &pos)
const;
2579 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
2584 ScatterShape mShape;
2588 QPainterPath mCustomPath;
2593Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE);
2594Q_DECLARE_OPERATORS_FOR_FLAGS(QCPScatterStyle::ScatterProperties)
2609template <
class DataType>
2610inline bool qcpLessThanSortKey(
const DataType &a,
const DataType &b) {
return a.sortKey() < b.sortKey(); }
2612template <
class DataType>
2616 typedef typename QVector<DataType>::const_iterator const_iterator;
2617 typedef typename QVector<DataType>::iterator iterator;
2622 int size()
const {
return mData.size()-mPreallocSize; }
2624 bool autoSqueeze()
const {
return mAutoSqueeze; }
2631 void set(
const QVector<DataType> &data,
bool alreadySorted=
false);
2633 void add(
const QVector<DataType> &data,
bool alreadySorted=
false);
2634 void add(
const DataType &data);
2637 void remove(
double sortKeyFrom,
double sortKeyTo);
2641 void squeeze(
bool preAllocation=
true,
bool postAllocation=
true);
2643 const_iterator
constBegin()
const {
return mData.constBegin()+mPreallocSize; }
2644 const_iterator
constEnd()
const {
return mData.constEnd(); }
2645 iterator
begin() {
return mData.begin()+mPreallocSize; }
2646 iterator
end() {
return mData.end(); }
2647 const_iterator
findBegin(
double sortKey,
bool expandedRange=
true)
const;
2648 const_iterator
findEnd(
double sortKey,
bool expandedRange=
true)
const;
2660 QVector<DataType> mData;
2662 int mPreallocIteration;
2665 void preallocateGrow(
int minimumPreallocSize);
2666 void performAutoSqueeze();
2805template <
class DataType>
2809 mPreallocIteration(0)
2821template <
class DataType>
2824 if (mAutoSqueeze != enabled)
2826 mAutoSqueeze = enabled;
2828 performAutoSqueeze();
2838template <
class DataType>
2854template <
class DataType>
2859 mPreallocIteration = 0;
2870template <
class DataType>
2876 const int n = data.
size();
2877 const int oldSize =
size();
2881 if (mPreallocSize < n)
2887 mData.resize(mData.size()+n);
2902template <
class DataType>
2909 set(data, alreadySorted);
2913 const int n = data.size();
2914 const int oldSize =
size();
2918 if (mPreallocSize < n)
2921 std::copy(data.constBegin(), data.constEnd(),
begin());
2924 mData.resize(mData.size()+n);
2925 std::copy(data.constBegin(), data.constEnd(),
end()-n);
2939template <
class DataType>
2947 if (mPreallocSize < 1)
2954 mData.insert(insertionPoint, data);
2963template <
class DataType>
2966 QCPDataContainer<DataType>::iterator it =
begin();
2968 mPreallocSize += int(itEnd-it);
2970 performAutoSqueeze();
2978template <
class DataType>
2982 QCPDataContainer<DataType>::iterator itEnd =
end();
2983 mData.erase(it, itEnd);
2985 performAutoSqueeze();
2995template <
class DataType>
2998 if (sortKeyFrom >= sortKeyTo ||
isEmpty())
3003 mData.erase(it, itEnd);
3005 performAutoSqueeze();
3017template <
class DataType>
3021 if (it !=
end() && it->sortKey() == sortKey)
3029 performAutoSqueeze();
3037template <
class DataType>
3041 mPreallocIteration = 0;
3056template <
class DataType>
3072template <
class DataType>
3077 if (mPreallocSize > 0)
3079 std::copy(
begin(),
end(), mData.begin());
3080 mData.resize(
size());
3083 mPreallocIteration = 0;
3104template <
class DataType>
3131template <
class DataType>
3138 if (expandedRange && it !=
constEnd())
3158template <
class DataType>
3167 bool haveLower =
false;
3168 bool haveUpper =
false;
3171 QCPDataContainer<DataType>::const_iterator it =
constBegin();
3172 QCPDataContainer<DataType>::const_iterator itEnd =
constEnd();
3175 if (DataType::sortKeyIsMainKey())
3179 if (!qIsNaN(it->mainValue()))
3181 range.lower = it->mainKey();
3191 if (!qIsNaN(it->mainValue()))
3193 range.upper = it->mainKey();
3202 if (!qIsNaN(it->mainValue()))
3204 current = it->mainKey();
3205 if (current < range.lower || !haveLower)
3207 range.lower = current;
3210 if (current > range.upper || !haveUpper)
3212 range.upper = current;
3223 if (!qIsNaN(it->mainValue()))
3225 current = it->mainKey();
3226 if ((current < range.lower || !haveLower) && current < 0)
3228 range.lower = current;
3231 if ((current > range.upper || !haveUpper) && current < 0)
3233 range.upper = current;
3243 if (!qIsNaN(it->mainValue()))
3245 current = it->mainKey();
3246 if ((current < range.lower || !haveLower) && current > 0)
3248 range.lower = current;
3251 if ((current > range.upper || !haveUpper) && current > 0)
3253 range.upper = current;
3261 foundRange = haveLower && haveUpper;
3283template <
class DataType>
3292 const bool restrictKeyRange = inKeyRange !=
QCPRange();
3293 bool haveLower =
false;
3294 bool haveUpper =
false;
3296 QCPDataContainer<DataType>::const_iterator itBegin =
constBegin();
3297 QCPDataContainer<DataType>::const_iterator itEnd =
constEnd();
3298 if (DataType::sortKeyIsMainKey() && restrictKeyRange)
3300 itBegin =
findBegin(inKeyRange.lower,
false);
3301 itEnd =
findEnd(inKeyRange.upper,
false);
3305 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3307 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3309 current = it->valueRange();
3310 if ((current.lower < range.lower || !haveLower) && !qIsNaN(current.lower) && std::isfinite(current.lower))
3312 range.lower = current.lower;
3315 if ((current.upper > range.upper || !haveUpper) && !qIsNaN(current.upper) && std::isfinite(current.upper))
3317 range.upper = current.upper;
3323 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3325 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3327 current = it->valueRange();
3328 if ((current.lower < range.lower || !haveLower) && current.lower < 0 && !qIsNaN(current.lower) && std::isfinite(current.lower))
3330 range.lower = current.lower;
3333 if ((current.upper > range.upper || !haveUpper) && current.upper < 0 && !qIsNaN(current.upper) && std::isfinite(current.upper))
3335 range.upper = current.upper;
3341 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3343 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3345 current = it->valueRange();
3346 if ((current.lower < range.lower || !haveLower) && current.lower > 0 && !qIsNaN(current.lower) && std::isfinite(current.lower))
3348 range.lower = current.lower;
3351 if ((current.upper > range.upper || !haveUpper) && current.upper > 0 && !qIsNaN(current.upper) && std::isfinite(current.upper))
3353 range.upper = current.upper;
3359 foundRange = haveLower && haveUpper;
3371template <
class DataType>
3375 iteratorRange = iteratorRange.
bounded(
dataRange.bounded(this->dataRange()));
3389template <
class DataType>
3390void QCPDataContainer<DataType>::preallocateGrow(
int minimumPreallocSize)
3392 if (minimumPreallocSize <= mPreallocSize)
3395 int newPreallocSize = minimumPreallocSize;
3396 newPreallocSize += (1u<<qBound(4, mPreallocIteration+4, 15)) - 12;
3397 ++mPreallocIteration;
3399 int sizeDifference = newPreallocSize-mPreallocSize;
3400 mData.resize(mData.size()+sizeDifference);
3401 std::copy_backward(mData.begin()+mPreallocSize, mData.end()-sizeDifference, mData.end());
3402 mPreallocSize = newPreallocSize;
3419template <
class DataType>
3420void QCPDataContainer<DataType>::performAutoSqueeze()
3422 const int totalAlloc = mData.capacity();
3423 const int postAllocSize = totalAlloc-mData.size();
3424 const int usedSize = size();
3425 bool shrinkPostAllocation =
false;
3426 bool shrinkPreAllocation =
false;
3427 if (totalAlloc > 650000)
3429 shrinkPostAllocation = postAllocSize > usedSize*1.5;
3430 shrinkPreAllocation = mPreallocSize*10 > usedSize;
3431 }
else if (totalAlloc > 1000)
3433 shrinkPostAllocation = postAllocSize > usedSize*5;
3434 shrinkPreAllocation = mPreallocSize > usedSize*1.5;
3437 if (shrinkPreAllocation || shrinkPostAllocation)
3438 squeeze(shrinkPreAllocation, shrinkPostAllocation);
3456 QPen pen()
const {
return mPen; }
3457 QBrush brush()
const {
return mBrush; }
3459 QCPScatterStyle::ScatterProperties usedScatterProperties()
const {
return mUsedScatterProperties; }
3462 void setPen(
const QPen &pen);
3463 void setBrush(
const QBrush &brush);
3481 QCPScatterStyle::ScatterProperties mUsedScatterProperties;
3483 QCPAbstractPlottable *mPlottable;
3486 virtual bool registerWithPlottable(QCPAbstractPlottable *plottable);
3490 friend class QCPAbstractPlottable;
3499 Q_PROPERTY(QString name READ name WRITE
setName)
3502 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
3503 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
3504 Q_PROPERTY(QCPAxis* keyAxis READ keyAxis WRITE
setKeyAxis)
3505 Q_PROPERTY(QCPAxis* valueAxis READ valueAxis WRITE
setValueAxis)
3515 QString name()
const {
return mName; }
3516 bool antialiasedFill()
const {
return mAntialiasedFill; }
3517 bool antialiasedScatters()
const {
return mAntialiasedScatters; }
3518 QPen pen()
const {
return mPen; }
3519 QBrush brush()
const {
return mBrush; }
3520 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
3521 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
3523 bool selected()
const {
return !mSelection.isEmpty(); }
3528 void setName(
const QString &name);
3531 void setPen(
const QPen &pen);
3532 void setBrush(
const QBrush &brush);
3540 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE = 0;
3546 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
3548 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
3549 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
3552 void rescaleValueAxis(
bool onlyEnlarge=
false,
bool inKeyRange=
false)
const;
3566 bool mAntialiasedFill, mAntialiasedScatters;
3569 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3575 virtual QRect clipRect() const Q_DECL_OVERRIDE;
3576 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3577 virtual
QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
3578 void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
3580 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3581 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3584 virtual
void drawLegendIcon(
QCPPainter *painter, const QRectF &rect) const = 0;
3587 void applyFillAntialiasingHint(
QCPPainter *painter) const;
3588 void applyScattersAntialiasingHint(
QCPPainter *painter) const;
3593 friend class QCustomPlot;
3594 friend class QCPAxis;
3595 friend class QCPPlottableLegendItem;
3613 QString name()
const {
return mName; }
3624 QSet<QCPItemPosition*> mChildrenX, mChildrenY;
3662 Q_ENUMS(PositionType)
3669 PositionType typeX()
const {
return mPositionTypeX; }
3670 PositionType typeY()
const {
return mPositionTypeY; }
3672 QCPItemAnchor *parentAnchorX()
const {
return mParentAnchorX; }
3673 QCPItemAnchor *parentAnchorY()
const {
return mParentAnchorY; }
3674 double key()
const {
return mKey; }
3675 double value()
const {
return mValue; }
3676 QPointF coords()
const {
return QPointF(mKey, mValue); }
3677 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
3678 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
3679 QCPAxisRect *axisRect()
const;
3680 virtual QPointF pixelPosition() const Q_DECL_OVERRIDE;
3683 void setType(PositionType type);
3684 void setTypeX(PositionType type);
3685 void setTypeY(PositionType type);
3686 bool setParentAnchor(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=false);
3687 bool setParentAnchorX(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=false);
3688 bool setParentAnchorY(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=false);
3689 void setCoords(
double key,
double value);
3690 void setCoords(const QPointF &pos);
3691 void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
3692 void setAxisRect(QCPAxisRect *axisRect);
3693 void setPixelPosition(const QPointF &pixelPosition);
3697 PositionType mPositionTypeX, mPositionTypeY;
3698 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3699 QPointer<QCPAxisRect> mAxisRect;
3700 double mKey, mValue;
3701 QCPItemAnchor *mParentAnchorX, *mParentAnchorY;
3718 Q_PROPERTY(QCPAxisRect* clipAxisRect READ clipAxisRect WRITE
setClipAxisRect)
3719 Q_PROPERTY(
bool selectable READ selectable WRITE
setSelectable NOTIFY selectableChanged)
3727 bool clipToAxisRect()
const {
return mClipToAxisRect; }
3728 QCPAxisRect *clipAxisRect()
const;
3729 bool selectable()
const {
return mSelectable; }
3730 bool selected()
const {
return mSelected; }
3739 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE = 0;
3743 QList<QCPItemAnchor*>
anchors()
const {
return mAnchors; }
3746 bool hasAnchor(
const QString &name)
const;
3750 void selectableChanged(
bool selectable);
3754 bool mClipToAxisRect;
3755 QPointer<QCPAxisRect> mClipAxisRect;
3756 QList<QCPItemPosition*> mPositions;
3757 QList<QCPItemAnchor*> mAnchors;
3758 bool mSelectable, mSelected;
3762 virtual QRect clipRect() const Q_DECL_OVERRIDE;
3763 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
3764 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3766 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3767 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3770 virtual QPointF anchorPixelPosition(
int anchorId) const;
3773 double rectDistance(const QRectF &rect, const QPointF &pos,
bool filledRect) const;
3775 QCPItemAnchor *createAnchor(const QString &name,
int anchorId);
3780 friend class QCustomPlot;
3781 friend class QCPItemAnchor;
3794 Q_PROPERTY(QRect viewport READ viewport WRITE
setViewport)
3795 Q_PROPERTY(QPixmap background READ background WRITE
setBackground)
3802 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE
setMultiSelectModifier)
3803 Q_PROPERTY(
bool openGl READ openGl WRITE
setOpenGl)
3814 Q_ENUMS(LayerInsertMode)
3826 Q_ENUMS(RefreshPriority)
3832 QRect viewport()
const {
return mViewport; }
3833 double bufferDevicePixelRatio()
const {
return mBufferDevicePixelRatio; }
3834 QPixmap background()
const {
return mBackgroundPixmap; }
3835 bool backgroundScaled()
const {
return mBackgroundScaled; }
3836 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
3838 QCP::AntialiasedElements antialiasedElements()
const {
return mAntialiasedElements; }
3839 QCP::AntialiasedElements notAntialiasedElements()
const {
return mNotAntialiasedElements; }
3840 bool autoAddPlottableToLegend()
const {
return mAutoAddPlottableToLegend; }
3841 const QCP::Interactions interactions()
const {
return mInteractions; }
3842 int selectionTolerance()
const {
return mSelectionTolerance; }
3843 bool noAntialiasingOnDrag()
const {
return mNoAntialiasingOnDrag; }
3844 QCP::PlottingHints plottingHints()
const {
return mPlottingHints; }
3845 Qt::KeyboardModifier multiSelectModifier()
const {
return mMultiSelectModifier; }
3848 bool openGl()
const {
return mOpenGl; }
3851 void setViewport(
const QRect &rect);
3852 void setBufferDevicePixelRatio(
double ratio);
3853 void setBackground(
const QPixmap &pm);
3854 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
3855 void setBackground(
const QBrush &brush);
3856 void setBackgroundScaled(
bool scaled);
3857 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
3858 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
3860 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
3862 void setAutoAddPlottableToLegend(
bool on);
3863 void setInteractions(
const QCP::Interactions &interactions);
3864 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
3865 void setSelectionTolerance(
int pixels);
3866 void setNoAntialiasingOnDrag(
bool enabled);
3867 void setPlottingHints(
const QCP::PlottingHints &hints);
3869 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
3872 void setOpenGl(
bool enabled,
int multisampling=16);
3879 bool removePlottable(
int index);
3880 int clearPlottables();
3881 int plottableCount()
const;
3882 QList<QCPAbstractPlottable*> selectedPlottables()
const;
3883 template<
class PlottableType>
3884 PlottableType *plottableAt(
const QPointF &pos,
bool onlySelectable=
false,
int *dataIndex=
nullptr)
const;
3885 QCPAbstractPlottable *plottableAt(
const QPointF &pos,
bool onlySelectable=
false,
int *dataIndex=
nullptr)
const;
3893 bool removeGraph(
int index);
3895 int graphCount()
const;
3896 QList<QCPGraph*> selectedGraphs()
const;
3902 bool removeItem(
int index);
3904 int itemCount()
const;
3905 QList<QCPAbstractItem*> selectedItems()
const;
3906 template<
class ItemType>
3907 ItemType *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
3908 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
3912 QCPLayer *layer(
const QString &name)
const;
3915 bool setCurrentLayer(
const QString &name);
3916 bool setCurrentLayer(
QCPLayer *layer);
3917 int layerCount()
const;
3918 bool addLayer(
const QString &name,
QCPLayer *otherLayer=
nullptr, LayerInsertMode insertMode=limAbove);
3920 bool moveLayer(
QCPLayer *layer,
QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
3923 int axisRectCount()
const;
3925 QList<QCPAxisRect*> axisRects()
const;
3927 QCPAxisRect* axisRectAt(
const QPointF &pos)
const;
3928 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
3930 QList<QCPAxis*> selectedAxes()
const;
3931 QList<QCPLegend*> selectedLegends()
const;
3932 Q_SLOT
void deselectAll();
3934 bool savePdf(
const QString &fileName,
int width=0,
int height=0,
QCP::ExportPen exportPen=
QCP::epAllowCosmetic,
const QString &pdfCreator=QString(),
const QString &pdfTitle=QString());
3938 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1,
int resolution=96,
QCP::ResolutionUnit resolutionUnit=
QCP::ruDotsPerInch);
3939 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
3940 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
3942 double replotTime(
bool average=
false)
const;
3971 double mBufferDevicePixelRatio;
3973 bool mAutoAddPlottableToLegend;
3974 QList<QCPAbstractPlottable*> mPlottables;
3975 QList<QCPGraph*> mGraphs;
3976 QList<QCPAbstractItem*> mItems;
3977 QList<QCPLayer*> mLayers;
3978 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
3979 QCP::Interactions mInteractions;
3980 int mSelectionTolerance;
3981 bool mNoAntialiasingOnDrag;
3982 QBrush mBackgroundBrush;
3983 QPixmap mBackgroundPixmap;
3984 QPixmap mScaledBackgroundPixmap;
3985 bool mBackgroundScaled;
3986 Qt::AspectRatioMode mBackgroundScaledMode;
3987 QCPLayer *mCurrentLayer;
3988 QCP::PlottingHints mPlottingHints;
3989 Qt::KeyboardModifier mMultiSelectModifier;
3995 QList<QSharedPointer<QCPAbstractPaintBuffer> > mPaintBuffers;
3996 QPoint mMousePressPos;
3997 bool mMouseHasMoved;
3998 QPointer<QCPLayerable> mMouseEventLayerable;
3999 QPointer<QCPLayerable> mMouseSignalLayerable;
4000 QVariant mMouseEventLayerableDetails;
4001 QVariant mMouseSignalLayerableDetails;
4004 double mReplotTime, mReplotTimeAverage;
4005 int mOpenGlMultisamples;
4006 QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup;
4007 bool mOpenGlCacheLabelsBackup;
4008#ifdef QCP_OPENGL_FBO
4009 QSharedPointer<QOpenGLContext> mGlContext;
4010 QSharedPointer<QSurface> mGlSurface;
4011 QSharedPointer<QOpenGLPaintDevice> mGlPaintDevice;
4015 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
4016 virtual QSize sizeHint() const Q_DECL_OVERRIDE;
4017 virtual
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
4018 virtual
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
4019 virtual
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4020 virtual
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4021 virtual
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4022 virtual
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
4023 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
4027 virtual
void updateLayout();
4028 virtual
void axisRemoved(QCPAxis *axis);
4029 virtual
void legendRemoved(QCPLegend *
legend);
4030 Q_SLOT virtual
void processRectSelection(QRect rect, QMouseEvent *event);
4031 Q_SLOT virtual
void processRectZoom(QRect rect, QMouseEvent *event);
4032 Q_SLOT virtual
void processPointSelection(QMouseEvent *event);
4035 bool registerPlottable(QCPAbstractPlottable *
plottable);
4036 bool registerGraph(QCPGraph *
graph);
4037 bool registerItem(QCPAbstractItem*
item);
4038 void updateLayerIndices() const;
4039 QCPLayerable *layerableAt(const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=
nullptr) const;
4040 QList<
QCPLayerable*> layerableListAt(const QPointF &pos,
bool onlySelectable, QList<QVariant> *selectionDetails=
nullptr) const;
4042 void setupPaintBuffers();
4048 friend class QCPLegend;
4049 friend class QCPAxis;
4050 friend class QCPLayer;
4051 friend class QCPAxisRect;
4052 friend class QCPAbstractPlottable;
4053 friend class QCPGraph;
4054 friend class QCPAbstractItem;
4080template<class PlottableType>
4083 PlottableType *resultPlottable = 0;
4084 QVariant resultDetails;
4085 double resultDistance = mSelectionTolerance;
4087 foreach (QCPAbstractPlottable *
plottable, mPlottables)
4089 PlottableType *currentPlottable = qobject_cast<PlottableType*>(
plottable);
4090 if (!currentPlottable || (onlySelectable && !currentPlottable->selectable()))
4092 if (currentPlottable->clipRect().contains(pos.toPoint()))
4095 double currentDistance = currentPlottable->selectTest(pos,
false, dataIndex ? &details :
nullptr);
4096 if (currentDistance >= 0 && currentDistance < resultDistance)
4098 resultPlottable = currentPlottable;
4099 resultDetails = details;
4100 resultDistance = currentDistance;
4105 if (resultPlottable && dataIndex)
4111 return resultPlottable;
4127template<
class ItemType>
4130 ItemType *resultItem = 0;
4131 double resultDistance = mSelectionTolerance;
4133 foreach (QCPAbstractItem *
item, mItems)
4135 ItemType *currentItem = qobject_cast<ItemType*>(
item);
4136 if (!currentItem || (onlySelectable && !currentItem->selectable()))
4138 if (!currentItem->clipToAxisRect() || currentItem->clipRect().contains(pos.toPoint()))
4140 double currentDistance = currentItem->selectTest(pos,
false);
4141 if (currentDistance >= 0 && currentDistance < resultDistance)
4143 resultItem = currentItem;
4144 resultDistance = currentDistance;
4173 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const = 0;
4174 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const = 0;
4177template <
class DataType>
4195 virtual
int findBegin(
double sortKey,
bool expandedRange=true) const Q_DECL_OVERRIDE;
4196 virtual
int findEnd(
double sortKey,
bool expandedRange=true) const Q_DECL_OVERRIDE;
4199 virtual
double selectTest(const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
4204 QSharedPointer<QCPDataContainer<DataType> > mDataContainer;
4207 void getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments)
const;
4403template <
class DataType>
4410template <
class DataType>
4411QCPAbstractPlottable1D<DataType>::~QCPAbstractPlottable1D()
4418template <
class DataType>
4421 return mDataContainer->size();
4427template <
class DataType>
4430 if (index >= 0 && index < mDataContainer->size())
4432 return (mDataContainer->constBegin()+index)->mainKey();
4435 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4443template <
class DataType>
4446 if (index >= 0 && index < mDataContainer->size())
4448 return (mDataContainer->constBegin()+index)->sortKey();
4451 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4459template <
class DataType>
4462 if (index >= 0 && index < mDataContainer->size())
4464 return (mDataContainer->constBegin()+index)->mainValue();
4467 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4475template <
class DataType>
4478 if (index >= 0 && index < mDataContainer->size())
4480 return (mDataContainer->constBegin()+index)->valueRange();
4483 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4491template <
class DataType>
4494 if (index >= 0 && index < mDataContainer->size())
4496 const typename QCPDataContainer<DataType>::const_iterator it = mDataContainer->constBegin()+index;
4500 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4508template <
class DataType>
4511 return DataType::sortKeyIsMainKey();
4521template <
class DataType>
4525 if ((onlySelectable && mSelectable ==
QCP::stNone) || mDataContainer->isEmpty())
4527 if (!mKeyAxis || !mValueAxis)
4531 double key1, value1, key2, value2;
4535 QCPRange valueRange(value1, value2);
4536 typename QCPDataContainer<DataType>::const_iterator begin = mDataContainer->constBegin();
4537 typename QCPDataContainer<DataType>::const_iterator end = mDataContainer->constEnd();
4538 if (DataType::sortKeyIsMainKey())
4540 begin = mDataContainer->
findBegin(keyRange.lower,
false);
4541 end = mDataContainer->
findEnd(keyRange.upper,
false);
4546 int currentSegmentBegin = -1;
4547 for (
typename QCPDataContainer<DataType>::const_iterator it=begin; it!=end; ++it)
4549 if (currentSegmentBegin == -1)
4551 if (valueRange.
contains(it->mainValue()) && keyRange.
contains(it->mainKey()))
4552 currentSegmentBegin = int(it-mDataContainer->constBegin());
4553 }
else if (!valueRange.
contains(it->mainValue()) || !keyRange.
contains(it->mainKey()))
4556 currentSegmentBegin = -1;
4560 if (currentSegmentBegin != -1)
4570template <
class DataType>
4573 return int(mDataContainer->findBegin(sortKey, expandedRange)-mDataContainer->constBegin());
4579template <
class DataType>
4582 return int(mDataContainer->findEnd(sortKey, expandedRange)-mDataContainer->constBegin());
4595template <
class DataType>
4598 if ((onlySelectable && mSelectable ==
QCP::stNone) || mDataContainer->isEmpty())
4600 if (!mKeyAxis || !mValueAxis)
4604 double minDistSqr = (std::numeric_limits<double>::max)();
4605 int minDistIndex = mDataContainer->size();
4607 typename QCPDataContainer<DataType>::const_iterator begin = mDataContainer->constBegin();
4608 typename QCPDataContainer<DataType>::const_iterator end = mDataContainer->constEnd();
4609 if (DataType::sortKeyIsMainKey())
4612 double posKeyMin, posKeyMax, dummy;
4613 pixelsToCoords(pos-QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMin, dummy);
4614 pixelsToCoords(pos+QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMax, dummy);
4615 if (posKeyMin > posKeyMax)
4616 qSwap(posKeyMin, posKeyMax);
4617 begin = mDataContainer->
findBegin(posKeyMin,
true);
4618 end = mDataContainer->
findEnd(posKeyMax,
true);
4622 QCPRange keyRange(mKeyAxis->range());
4623 QCPRange valueRange(mValueAxis->range());
4624 for (
typename QCPDataContainer<DataType>::const_iterator it=begin; it!=end; ++it)
4626 const double mainKey = it->mainKey();
4627 const double mainValue = it->mainValue();
4631 if (currentDistSqr < minDistSqr)
4633 minDistSqr = currentDistSqr;
4634 minDistIndex = int(it-mDataContainer->constBegin());
4638 if (minDistIndex != mDataContainer->size())
4643 details->setValue(selectionResult);
4644 return qSqrt(minDistSqr);
4657template <
class DataType>
4660 selectedSegments.clear();
4661 unselectedSegments.clear();
4687template <
class DataType>
4695 qFuzzyCompare(painter->pen().widthF(), 1.0))
4697 QPen newPen = painter->pen();
4704 painter->pen().style() == Qt::SolidLine &&
4709 bool lastIsNan =
false;
4710 const int lineDataSize = lineData.size();
4711 while (i < lineDataSize && (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x())))
4714 while (i < lineDataSize)
4716 if (!qIsNaN(lineData.at(i).y()) && !qIsNaN(lineData.at(i).x()))
4719 painter->
drawLine(lineData.at(i-1), lineData.at(i));
4728 int segmentStart = 0;
4730 const int lineDataSize = lineData.size();
4731 while (i < lineDataSize)
4733 if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) || qIsInf(lineData.at(i).y()))
4735 painter->drawPolyline(lineData.constData()+segmentStart, i-segmentStart);
4741 painter->drawPolyline(lineData.constData()+segmentStart, lineDataSize-segmentStart);
4764 Q_ENUMS(ColorInterpolation)
4777 Q_ENUMS(NanHandling)
4796 Q_ENUMS(GradientPreset)
4801 bool operator!=(
const QCPColorGradient &other)
const {
return !(*
this == other); }
4804 int levelCount()
const {
return mLevelCount; }
4805 QMap<double, QColor> colorStops()
const {
return mColorStops; }
4806 ColorInterpolation colorInterpolation()
const {
return mColorInterpolation; }
4807 NanHandling nanHandling()
const {
return mNanHandling; }
4808 QColor nanColor()
const {
return mNanColor; }
4809 bool periodic()
const {
return mPeriodic; }
4812 void setLevelCount(
int n);
4813 void setColorStops(
const QMap<double, QColor> &colorStops);
4814 void setColorStopAt(
double position,
const QColor &color);
4815 void setColorInterpolation(ColorInterpolation interpolation);
4816 void setNanHandling(NanHandling handling);
4817 void setNanColor(
const QColor &color);
4818 void setPeriodic(
bool enabled);
4821 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
4822 void colorize(
const double *data,
const unsigned char *alpha,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
4823 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
4824 void loadPreset(GradientPreset preset);
4825 void clearColorStops();
4826 QCPColorGradient inverted()
const;
4831 QMap<double, QColor> mColorStops;
4832 ColorInterpolation mColorInterpolation;
4833 NanHandling mNanHandling;
4838 QVector<QRgb> mColorBuffer;
4839 bool mColorBufferInvalidated;
4842 bool stopsUseAlpha()
const;
4843 void updateColorBuffer();
4872 Q_ENUMS(BracketStyle)
4878 QPen bracketPen()
const {
return mBracketPen; }
4879 QBrush bracketBrush()
const {
return mBracketBrush; }
4880 int bracketWidth()
const {
return mBracketWidth; }
4881 int bracketHeight()
const {
return mBracketHeight; }
4882 BracketStyle bracketStyle()
const {
return mBracketStyle; }
4883 bool tangentToData()
const {
return mTangentToData; }
4884 int tangentAverage()
const {
return mTangentAverage; }
4887 void setBracketPen(
const QPen &pen);
4888 void setBracketBrush(
const QBrush &brush);
4889 void setBracketWidth(
int width);
4890 void setBracketHeight(
int height);
4891 void setBracketStyle(BracketStyle style);
4892 void setTangentToData(
bool enabled);
4893 void setTangentAverage(
int pointCount);
4896 virtual void drawBracket(
QCPPainter *painter,
int direction)
const;
4904 QBrush mBracketBrush;
4907 BracketStyle mBracketStyle;
4908 bool mTangentToData;
4909 int mTangentAverage;
4928 Q_PROPERTY(QPixmap background READ background WRITE
setBackground)
4931 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE
setRangeDrag)
4932 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE
setRangeZoom)
4935 explicit QCPAxisRect(QCustomPlot *parentPlot,
bool setupDefaultAxes=
true);
4939 QPixmap background()
const {
return mBackgroundPixmap; }
4940 QBrush backgroundBrush()
const {
return mBackgroundBrush; }
4941 bool backgroundScaled()
const {
return mBackgroundScaled; }
4942 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
4943 Qt::Orientations rangeDrag()
const {
return mRangeDrag; }
4944 Qt::Orientations rangeZoom()
const {
return mRangeZoom; }
4953 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
4961 void setRangeDragAxes(QList<QCPAxis*> horizontal, QList<QCPAxis*> vertical);
4964 void setRangeZoomAxes(QList<QCPAxis*> horizontal, QList<QCPAxis*> vertical);
4971 QList<QCPAxis*>
axes(QCPAxis::AxisTypes types)
const;
4972 QList<QCPAxis*>
axes()
const;
4974 QList<QCPAxis*>
addAxes(QCPAxis::AxisTypes types);
4978 void zoom(
const QRectF &pixelRect);
4979 void zoom(
const QRectF &pixelRect,
const QList<QCPAxis*> &affectedAxes);
4980 void setupFullAxesBox(
bool connectRanges=
false);
4981 QList<QCPAbstractPlottable*> plottables()
const;
4982 QList<QCPGraph*> graphs()
const;
4983 QList<QCPAbstractItem*> items()
const;
4986 int left()
const {
return mRect.left(); }
4987 int right()
const {
return mRect.right(); }
4988 int top()
const {
return mRect.top(); }
4989 int bottom()
const {
return mRect.bottom(); }
4990 int width()
const {
return mRect.width(); }
4991 int height()
const {
return mRect.height(); }
4992 QSize
size()
const {
return mRect.size(); }
4993 QPoint
topLeft()
const {
return mRect.topLeft(); }
4997 QPoint
center()
const {
return mRect.center(); }
5000 virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
5001 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const Q_DECL_OVERRIDE;
5005 QBrush mBackgroundBrush;
5006 QPixmap mBackgroundPixmap;
5007 QPixmap mScaledBackgroundPixmap;
5008 bool mBackgroundScaled;
5009 Qt::AspectRatioMode mBackgroundScaledMode;
5011 Qt::Orientations mRangeDrag, mRangeZoom;
5012 QList<QPointer<QCPAxis> > mRangeDragHorzAxis, mRangeDragVertAxis;
5013 QList<QPointer<QCPAxis> > mRangeZoomHorzAxis, mRangeZoomVertAxis;
5014 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
5017 QList<QCPRange> mDragStartHorzRange, mDragStartVertRange;
5018 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
5020 QHash<QCPAxis::AxisType, QList<QCPAxis*> > mAxes;
5023 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
5024 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5025 virtual int calculateAutoMargin(
QCP::MarginSide side) Q_DECL_OVERRIDE;
5026 virtual void layoutChanged() Q_DECL_OVERRIDE;
5028 virtual
void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE;
5029 virtual
void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
5030 virtual
void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
5031 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
5035 void updateAxesOffset(
QCPAxis::AxisType type);
5054 Q_PROPERTY(QCPLegend* parentLegend READ parentLegend)
5055 Q_PROPERTY(QFont font READ font WRITE
setFont)
5056 Q_PROPERTY(QColor textColor READ textColor WRITE
setTextColor)
5057 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE
setSelectedFont)
5060 Q_PROPERTY(
bool selected READ selected WRITE
setSelected NOTIFY selectableChanged)
5066 QCPLegend *parentLegend()
const {
return mParentLegend; }
5067 QFont font()
const {
return mFont; }
5068 QColor textColor()
const {
return mTextColor; }
5069 QFont selectedFont()
const {
return mSelectedFont; }
5070 QColor selectedTextColor()
const {
return mSelectedTextColor; }
5071 bool selectable()
const {
return mSelectable; }
5072 bool selected()
const {
return mSelected; }
5075 void setFont(
const QFont &font);
5083 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
5087 void selectableChanged(
bool selectable);
5091 QCPLegend *mParentLegend;
5094 QFont mSelectedFont;
5095 QColor mSelectedTextColor;
5096 bool mSelectable, mSelected;
5100 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
5101 virtual QRect clipRect() const Q_DECL_OVERRIDE;
5102 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
5104 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5105 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5110 friend class QCPLegend;
5128 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5132 QPen getIconBorderPen()
const;
5133 QColor getTextColor()
const;
5134 QFont getFont()
const;
5142 Q_PROPERTY(QPen borderPen READ borderPen WRITE
setBorderPen)
5143 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
5144 Q_PROPERTY(QFont font READ font WRITE
setFont)
5145 Q_PROPERTY(QColor textColor READ textColor WRITE
setTextColor)
5146 Q_PROPERTY(QSize iconSize READ iconSize WRITE
setIconSize)
5150 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE
setSelectedParts NOTIFY selectableChanged)
5154 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE
setSelectedFont)
5167 Q_ENUMS(SelectablePart)
5168 Q_FLAGS(SelectableParts)
5169 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
5175 QPen borderPen()
const {
return mBorderPen; }
5176 QBrush brush()
const {
return mBrush; }
5177 QFont font()
const {
return mFont; }
5178 QColor textColor()
const {
return mTextColor; }
5179 QSize iconSize()
const {
return mIconSize; }
5180 int iconTextPadding()
const {
return mIconTextPadding; }
5181 QPen iconBorderPen()
const {
return mIconBorderPen; }
5182 SelectableParts selectableParts()
const {
return mSelectableParts; }
5183 SelectableParts selectedParts()
const;
5184 QPen selectedBorderPen()
const {
return mSelectedBorderPen; }
5185 QPen selectedIconBorderPen()
const {
return mSelectedIconBorderPen; }
5186 QBrush selectedBrush()
const {
return mSelectedBrush; }
5187 QFont selectedFont()
const {
return mSelectedFont; }
5188 QColor selectedTextColor()
const {
return mSelectedTextColor; }
5191 void setBorderPen(
const QPen &pen);
5192 void setBrush(
const QBrush &brush);
5193 void setFont(
const QFont &font);
5194 void setTextColor(
const QColor &color);
5195 void setIconSize(
const QSize &size);
5196 void setIconSize(
int width,
int height);
5197 void setIconTextPadding(
int padding);
5198 void setIconBorderPen(
const QPen &pen);
5199 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
5200 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
5201 void setSelectedBorderPen(
const QPen &pen);
5202 void setSelectedIconBorderPen(
const QPen &pen);
5203 void setSelectedBrush(
const QBrush &brush);
5204 void setSelectedFont(
const QFont &font);
5205 void setSelectedTextColor(
const QColor &color);
5208 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
5211 QCPAbstractLegendItem *item(
int index) const;
5212 QCPPlottableLegendItem *itemWithPlottable(const QCPAbstractPlottable *plottable) const;
5213 int itemCount() const;
5214 bool hasItem(QCPAbstractLegendItem *item) const;
5215 bool hasItemWithPlottable(const QCPAbstractPlottable *plottable) const;
5216 bool addItem(QCPAbstractLegendItem *item);
5217 bool removeItem(
int index);
5218 bool removeItem(QCPAbstractLegendItem *item);
5220 QList<QCPAbstractLegendItem*> selectedItems() const;
5224 void selectableChanged(
QCPLegend::SelectableParts parts);
5228 QPen mBorderPen, mIconBorderPen;
5233 int mIconTextPadding;
5234 SelectableParts mSelectedParts, mSelectableParts;
5235 QPen mSelectedBorderPen, mSelectedIconBorderPen;
5236 QBrush mSelectedBrush;
5237 QFont mSelectedFont;
5238 QColor mSelectedTextColor;
5241 virtual
void parentPlotInitialized(QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
5242 virtual
QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
5243 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
5244 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5246 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5247 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5250 QPen getBorderPen() const;
5251 QBrush getBrush() const;
5256 friend class QCustomPlot;
5257 friend class QCPAbstractLegendItem;
5259Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPLegend::SelectableParts)
5272 Q_PROPERTY(QString text READ text WRITE
setText)
5273 Q_PROPERTY(QFont font READ font WRITE
setFont)
5274 Q_PROPERTY(QColor textColor READ textColor WRITE
setTextColor)
5275 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE
setSelectedFont)
5277 Q_PROPERTY(
bool selectable READ selectable WRITE
setSelectable NOTIFY selectableChanged)
5283 QCPTextElement(QCustomPlot *parentPlot,
const QString &text,
double pointSize);
5284 QCPTextElement(QCustomPlot *parentPlot,
const QString &text,
const QString &fontFamily,
double pointSize);
5285 QCPTextElement(QCustomPlot *parentPlot,
const QString &text,
const QFont &font);
5288 QString text()
const {
return mText; }
5289 int textFlags()
const {
return mTextFlags; }
5290 QFont font()
const {
return mFont; }
5291 QColor textColor()
const {
return mTextColor; }
5292 QFont selectedFont()
const {
return mSelectedFont; }
5293 QColor selectedTextColor()
const {
return mSelectedTextColor; }
5294 bool selectable()
const {
return mSelectable; }
5295 bool selected()
const {
return mSelected; }
5298 void setText(
const QString &text);
5300 void setFont(
const QFont &font);
5308 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
5309 virtual void mousePressEvent(QMouseEvent *event,
const QVariant &details) Q_DECL_OVERRIDE;
5310 virtual void mouseReleaseEvent(QMouseEvent *event,
const QPointF &startPos) Q_DECL_OVERRIDE;
5315 void selectableChanged(
bool selectable);
5325 QFont mSelectedFont;
5326 QColor mSelectedTextColor;
5327 QRect mTextBoundingRect;
5328 bool mSelectable, mSelected;
5331 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
5332 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5336 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5337 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
5340 QFont mainFont() const;
5341 QColor mainTextColor() const;
5362 QCPColorScale *mParentColorScale;
5363 QImage mGradientImage;
5364 bool mGradientImageInvalidated;
5366 using QCPAxisRect::calculateAutoMargin;
5372 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5373 void updateGradientImage();
5374 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
5375 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
5376 friend class QCPColorScale;
5388 Q_PROPERTY(QString label READ label WRITE
setLabel)
5389 Q_PROPERTY(
int barWidth READ barWidth WRITE
setBarWidth)
5390 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE
setRangeDrag)
5391 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE
setRangeZoom)
5400 QCPRange dataRange()
const {
return mDataRange; }
5402 QCPColorGradient gradient()
const {
return mGradient; }
5403 QString label()
const;
5404 int barWidth ()
const {
return mBarWidth; }
5405 bool rangeDrag()
const;
5406 bool rangeZoom()
const;
5410 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5412 Q_SLOT
void setGradient(
const QCPColorGradient &gradient);
5413 void setLabel(
const QString &str);
5414 void setBarWidth(
int width);
5415 void setRangeDrag(
bool enabled);
5416 void setRangeZoom(
bool enabled);
5419 QList<QCPColorMap*> colorMaps()
const;
5420 void rescaleDataRange(
bool onlyVisibleMaps);
5423 virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
5439 QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
5440 QPointer<QCPAxis> mColorAxis;
5443 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
5445 virtual void mousePressEvent(QMouseEvent *event,
const QVariant &details) Q_DECL_OVERRIDE;
5446 virtual void mouseMoveEvent(QMouseEvent *event,
const QPointF &startPos) Q_DECL_OVERRIDE;
5447 virtual void mouseReleaseEvent(QMouseEvent *event,
const QPointF &startPos) Q_DECL_OVERRIDE;
5448 virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
5453 friend class QCPColorScaleAxisRectPrivate;
5480Q_DECLARE_TYPEINFO(QCPGraphData, Q_PRIMITIVE_TYPE);
5492typedef QCPDataContainer<QCPGraphData> QCPGraphDataContainer;
5500 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE
setScatterSkip)
5524 QSharedPointer<QCPGraphDataContainer>
data()
const {
return mDataContainer; }
5525 LineStyle lineStyle()
const {
return mLineStyle; }
5526 QCPScatterStyle scatterStyle()
const {
return mScatterStyle; }
5527 int scatterSkip()
const {
return mScatterSkip; }
5528 QCPGraph *channelFillGraph()
const {
return mChannelFillGraph.data(); }
5529 bool adaptiveSampling()
const {
return mAdaptiveSampling; }
5532 void setData(QSharedPointer<QCPGraphDataContainer> data);
5533 void setData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5534 void setLineStyle(LineStyle ls);
5535 void setScatterStyle(
const QCPScatterStyle &style);
5536 void setScatterSkip(
int skip);
5537 void setChannelFillGraph(QCPGraph *targetGraph);
5538 void setAdaptiveSampling(
bool enabled);
5541 void addData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5542 void addData(
double key,
double value);
5545 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
5546 virtual QCPRange getKeyRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5547 virtual QCPRange getValueRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5551 LineStyle mLineStyle;
5552 QCPScatterStyle mScatterStyle;
5554 QPointer<QCPGraph> mChannelFillGraph;
5555 bool mAdaptiveSampling;
5558 virtual
void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5559 virtual
void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
5562 virtual
void drawFill(QCPPainter *painter, QVector<QPointF> *lines) const;
5563 virtual
void drawScatterPlot(QCPPainter *painter, const QVector<QPointF> &scatters, const QCPScatterStyle &style) const;
5564 virtual
void drawLinePlot(QCPPainter *painter, const QVector<QPointF> &lines) const;
5565 virtual
void drawImpulsePlot(QCPPainter *painter, const QVector<QPointF> &lines) const;
5567 virtual
void getOptimizedLineData(QVector<QCPGraphData> *lineData, const QCPGraphDataContainer::const_iterator &begin, const QCPGraphDataContainer::const_iterator &end) const;
5568 virtual
void getOptimizedScatterData(QVector<QCPGraphData> *scatterData, QCPGraphDataContainer::const_iterator begin, QCPGraphDataContainer::const_iterator end) const;
5571 void getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const;
5572 void getLines(QVector<QPointF> *lines, const QCPDataRange &dataRange) const;
5573 void getScatters(QVector<QPointF> *scatters, const QCPDataRange &dataRange) const;
5574 QVector<QPointF> dataToLines(const QVector<QCPGraphData> &data) const;
5575 QVector<QPointF> dataToStepLeftLines(const QVector<QCPGraphData> &data) const;
5576 QVector<QPointF> dataToStepRightLines(const QVector<QCPGraphData> &data) const;
5577 QVector<QPointF> dataToStepCenterLines(const QVector<QCPGraphData> &data) const;
5578 QVector<QPointF> dataToImpulseLines(const QVector<QCPGraphData> &data) const;
5579 QVector<QCPDataRange> getNonNanSegments(const QVector<QPointF> *lineData, Qt::Orientation keyOrientation) const;
5580 QVector<QPair<QCPDataRange, QCPDataRange> > getOverlappingSegments(QVector<QCPDataRange> thisSegments, const QVector<QPointF> *thisData, QVector<QCPDataRange> otherSegments, const QVector<QPointF> *otherData) const;
5581 bool segmentsIntersect(
double aLower,
double aUpper,
double bLower,
double bUpper,
int &bPrecedence) const;
5582 QPointF getFillBasePoint(QPointF matchingDataPoint) const;
5583 const QPolygonF getFillPolygon(const QVector<QPointF> *lineData, QCPDataRange segment) const;
5584 const QPolygonF getChannelFillPolygon(const QVector<QPointF> *thisData, QCPDataRange thisSegment, const QVector<QPointF> *otherData, QCPDataRange otherSegment) const;
5585 int findIndexBelowX(const QVector<QPointF> *data,
double x) const;
5586 int findIndexAboveX(const QVector<QPointF> *data,
double x) const;
5587 int findIndexBelowY(const QVector<QPointF> *data,
double y) const;
5588 int findIndexAboveY(const QVector<QPointF> *data,
double y) const;
5589 double pointDistance(const QPointF &pixelPoint, QCPGraphDataContainer::const_iterator &closestData) const;
5591 friend class QCustomPlot;
5592 friend class QCPLegend;
5594Q_DECLARE_METATYPE(QCPGraph::LineStyle)
5617 double t, key, value;
5619Q_DECLARE_TYPEINFO(QCPCurveData, Q_PRIMITIVE_TYPE);
5632typedef QCPDataContainer<QCPCurveData> QCPCurveDataContainer;
5639 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE
setScatterSkip)
5657 QSharedPointer<QCPCurveDataContainer>
data()
const {
return mDataContainer; }
5659 int scatterSkip()
const {
return mScatterSkip; }
5660 LineStyle lineStyle()
const {
return mLineStyle; }
5663 void setData(QSharedPointer<QCPCurveDataContainer> data);
5664 void setData(
const QVector<double> &t,
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5665 void setData(
const QVector<double> &keys,
const QVector<double> &values);
5666 void setScatterStyle(
const QCPScatterStyle &style);
5667 void setScatterSkip(
int skip);
5668 void setLineStyle(LineStyle style);
5671 void addData(
const QVector<double> &t,
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5672 void addData(
const QVector<double> &keys,
const QVector<double> &values);
5673 void addData(
double t,
double key,
double value);
5674 void addData(
double key,
double value);
5677 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
5678 virtual QCPRange getKeyRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5679 virtual QCPRange getValueRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5683 QCPScatterStyle mScatterStyle;
5685 LineStyle mLineStyle;
5688 virtual
void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
5689 virtual
void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
5692 virtual
void drawCurveLine(QCPPainter *painter, const QVector<QPointF> &lines) const;
5693 virtual
void drawScatterPlot(QCPPainter *painter, const QVector<QPointF> &points, const QCPScatterStyle &style) const;
5696 void getCurveLines(QVector<QPointF> *lines, const QCPDataRange &dataRange,
double penWidth) const;
5697 void getScatters(QVector<QPointF> *scatters, const QCPDataRange &dataRange,
double scatterWidth) const;
5698 int getRegion(
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin) const;
5699 QPointF getOptimizedPoint(
int otherRegion,
double otherKey,
double otherValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin) const;
5700 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin) const;
5701 bool mayTraverse(
int prevRegion,
int currentRegion) const;
5702 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin, QPointF &crossA, QPointF &crossB) const;
5703 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double keyMin,
double valueMax,
double keyMax,
double valueMin, QVector<QPointF> &beforeTraverse, QVector<QPointF> &afterTraverse) const;
5704 double pointDistance(const QPointF &pixelPoint, QCPCurveDataContainer::const_iterator &closestData) const;
5706 friend class QCustomPlot;
5707 friend class QCPLegend;
5709Q_DECLARE_METATYPE(QCPCurve::LineStyle)
5722 Q_PROPERTY(
double spacing READ spacing WRITE
setSpacing)
5735 Q_ENUMS(SpacingType)
5741 SpacingType spacingType()
const {
return mSpacingType; }
5742 double spacing()
const {
return mSpacing; }
5745 void setSpacingType(SpacingType spacingType);
5746 void setSpacing(
double spacing);
5749 QList<QCPBars*>
bars()
const {
return mBars; }
5750 QCPBars* bars(
int index)
const;
5751 int size()
const {
return mBars.size(); }
5756 void insert(
int i,
QCPBars *bars);
5762 SpacingType mSpacingType;
5764 QList<QCPBars*> mBars;
5767 void registerBars(
QCPBars *bars);
5768 void unregisterBars(
QCPBars *bars);
5771 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
5772 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
5799Q_DECLARE_TYPEINFO(QCPBarsData, Q_PRIMITIVE_TYPE);
5811typedef QCPDataContainer<QCPBarsData> QCPBarsDataContainer;
5817 Q_PROPERTY(
double width READ width WRITE
setWidth)
5819 Q_PROPERTY(QCPBarsGroup* barsGroup READ barsGroup WRITE
setBarsGroup)
5820 Q_PROPERTY(
double baseValue READ baseValue WRITE
setBaseValue)
5821 Q_PROPERTY(
double stackingGap READ stackingGap WRITE
setStackingGap)
5839 virtual ~QCPBars() Q_DECL_OVERRIDE;
5842 double width()
const {
return mWidth; }
5843 WidthType widthType()
const {
return mWidthType; }
5844 QCPBarsGroup *barsGroup()
const {
return mBarsGroup; }
5845 double baseValue()
const {
return mBaseValue; }
5846 double stackingGap()
const {
return mStackingGap; }
5849 QSharedPointer<QCPBarsDataContainer>
data()
const {
return mDataContainer; }
5852 void setData(QSharedPointer<QCPBarsDataContainer> data);
5853 void setData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5854 void setWidth(
double width);
5855 void setWidthType(WidthType widthType);
5857 void setBaseValue(
double baseValue);
5858 void setStackingGap(
double pixels);
5861 void addData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5862 void addData(
double key,
double value);
5863 void moveBelow(
QCPBars *bars);
5864 void moveAbove(
QCPBars *bars);
5867 virtual QCPDataSelection selectTestRect(
const QRectF &rect,
bool onlySelectable)
const Q_DECL_OVERRIDE;
5868 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
5869 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5870 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5871 virtual QPointF dataPixelPosition(
int index) const Q_DECL_OVERRIDE;
5876 WidthType mWidthType;
5879 double mStackingGap;
5880 QPointer<
QCPBars> mBarBelow, mBarAbove;
5883 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5884 virtual
void drawLegendIcon(
QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
5887 void getVisibleDataBounds(QCPBarsDataContainer::const_iterator &begin, QCPBarsDataContainer::const_iterator &end) const;
5888 QRectF getBarRect(
double key,
double value) const;
5889 void getPixelWidth(
double key,
double &lower,
double &upper) const;
5890 double getStackedBaseValue(
double key,
bool positive) const;
5897Q_DECLARE_METATYPE(
QCPBars::WidthType)
5909 QCPStatisticalBoxData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum,
const QVector<double>& outliers=QVector<double>());
5921 for (QVector<double>::const_iterator it = outliers.constBegin(); it != outliers.constEnd(); ++it)
5926 double key, minimum, lowerQuartile, median, upperQuartile, maximum;
5927 QVector<double> outliers;
5929Q_DECLARE_TYPEINFO(QCPStatisticalBoxData, Q_MOVABLE_TYPE);
5942typedef QCPDataContainer<QCPStatisticalBoxData> QCPStatisticalBoxDataContainer;
5948 Q_PROPERTY(
double width READ width WRITE
setWidth)
5949 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE
setWhiskerWidth)
5950 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE
setWhiskerPen)
5953 Q_PROPERTY(QPen medianPen READ medianPen WRITE
setMedianPen)
5960 QSharedPointer<QCPStatisticalBoxDataContainer>
data()
const {
return mDataContainer; }
5961 double width()
const {
return mWidth; }
5962 double whiskerWidth()
const {
return mWhiskerWidth; }
5963 QPen whiskerPen()
const {
return mWhiskerPen; }
5964 QPen whiskerBarPen()
const {
return mWhiskerBarPen; }
5965 bool whiskerAntialiased()
const {
return mWhiskerAntialiased; }
5966 QPen medianPen()
const {
return mMedianPen; }
5967 QCPScatterStyle outlierStyle()
const {
return mOutlierStyle; }
5970 void setData(QSharedPointer<QCPStatisticalBoxDataContainer> data);
5971 void setData(
const QVector<double> &keys,
const QVector<double> &minimum,
const QVector<double> &lowerQuartile,
const QVector<double> &median,
const QVector<double> &upperQuartile,
const QVector<double> &maximum,
bool alreadySorted=
false);
5972 void setWidth(
double width);
5973 void setWhiskerWidth(
double width);
5974 void setWhiskerPen(
const QPen &pen);
5975 void setWhiskerBarPen(
const QPen &pen);
5976 void setWhiskerAntialiased(
bool enabled);
5977 void setMedianPen(
const QPen &pen);
5978 void setOutlierStyle(
const QCPScatterStyle &style);
5981 void addData(
const QVector<double> &keys,
const QVector<double> &minimum,
const QVector<double> &lowerQuartile,
const QVector<double> &median,
const QVector<double> &upperQuartile,
const QVector<double> &maximum,
bool alreadySorted=
false);
5982 void addData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum,
const QVector<double> &outliers=QVector<double>());
5985 virtual QCPDataSelection selectTestRect(
const QRectF &rect,
bool onlySelectable)
const Q_DECL_OVERRIDE;
5986 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
5987 virtual QCPRange getKeyRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
5988 virtual QCPRange getValueRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
5993 double mWhiskerWidth;
5994 QPen mWhiskerPen, mWhiskerBarPen;
5995 bool mWhiskerAntialiased;
5997 QCPScatterStyle mOutlierStyle;
6000 virtual
void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6001 virtual
void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
6004 virtual
void drawStatisticalBox(QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it, const QCPScatterStyle &outlierStyle) const;
6007 void getVisibleDataBounds(QCPStatisticalBoxDataContainer::const_iterator &begin, QCPStatisticalBoxDataContainer::const_iterator &end) const;
6008 QRectF getQuartileBox(QCPStatisticalBoxDataContainer::const_iterator it) const;
6009 QVector<QLineF> getWhiskerBackboneLines(QCPStatisticalBoxDataContainer::const_iterator it) const;
6010 QVector<QLineF> getWhiskerBarLines(QCPStatisticalBoxDataContainer::const_iterator it) const;
6012 friend class QCustomPlot;
6013 friend class QCPLegend;
6031 int keySize()
const {
return mKeySize; }
6032 int valueSize()
const {
return mValueSize; }
6033 QCPRange keyRange()
const {
return mKeyRange; }
6034 QCPRange valueRange()
const {
return mValueRange; }
6035 QCPRange dataBounds()
const {
return mDataBounds; }
6036 double data(
double key,
double value);
6037 double cell(
int keyIndex,
int valueIndex);
6038 unsigned char alpha(
int keyIndex,
int valueIndex);
6041 void setSize(
int keySize,
int valueSize);
6047 void setData(
double key,
double value,
double z);
6048 void setCell(
int keyIndex,
int valueIndex,
double z);
6049 void setAlpha(
int keyIndex,
int valueIndex,
unsigned char alpha);
6055 void fill(
double z);
6058 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
6059 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
6063 int mKeySize, mValueSize;
6069 unsigned char *mAlpha;
6073 bool createAlpha(
bool initializeOpaque=
true);
6086 Q_PROPERTY(
bool interpolate READ interpolate WRITE
setInterpolate)
6091 explicit QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis);
6096 QCPRange dataRange()
const {
return mDataRange; }
6098 bool interpolate()
const {
return mInterpolate; }
6099 bool tightBoundary()
const {
return mTightBoundary; }
6100 QCPColorGradient gradient()
const {
return mGradient; }
6101 QCPColorScale *colorScale()
const {
return mColorScale.data(); }
6104 void setData(QCPColorMapData *data,
bool copy=
false);
6105 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
6107 Q_SLOT
void setGradient(
const QCPColorGradient &gradient);
6108 void setInterpolate(
bool enabled);
6109 void setTightBoundary(
bool enabled);
6110 void setColorScale(QCPColorScale *colorScale);
6113 void rescaleDataRange(
bool recalculateDataBounds=
false);
6114 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
6117 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
6118 virtual QCPRange getKeyRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
6119 virtual QCPRange getValueRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
6129 QCPAxis::ScaleType mDataScaleType;
6133 bool mTightBoundary;
6137 QImage mMapImage, mUndersampledMapImage;
6138 QPixmap mLegendIcon;
6139 bool mMapImageInvalidated;
6142 virtual
void updateMapImage();
6145 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6146 virtual
void drawLegendIcon(
QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
6148 friend class QCustomPlot;
6149 friend class QCPLegend;
6162 QCPFinancialData(
double key,
double open,
double high,
double low,
double close);
6173 double key, open, high, low, close;
6175Q_DECLARE_TYPEINFO(QCPFinancialData, Q_PRIMITIVE_TYPE);
6187typedef QCPDataContainer<QCPFinancialData> QCPFinancialDataContainer;
6194 Q_PROPERTY(
double width READ width WRITE
setWidth)
6196 Q_PROPERTY(
bool twoColored READ twoColored WRITE
setTwoColored)
6199 Q_PROPERTY(QPen penPositive READ penPositive WRITE
setPenPositive)
6200 Q_PROPERTY(QPen penNegative READ penNegative WRITE
setPenNegative)
6229 QSharedPointer<QCPFinancialDataContainer>
data()
const {
return mDataContainer; }
6230 ChartStyle chartStyle()
const {
return mChartStyle; }
6231 double width()
const {
return mWidth; }
6232 WidthType widthType()
const {
return mWidthType; }
6233 bool twoColored()
const {
return mTwoColored; }
6234 QBrush brushPositive()
const {
return mBrushPositive; }
6235 QBrush brushNegative()
const {
return mBrushNegative; }
6236 QPen penPositive()
const {
return mPenPositive; }
6237 QPen penNegative()
const {
return mPenNegative; }
6240 void setData(QSharedPointer<QCPFinancialDataContainer> data);
6241 void setData(
const QVector<double> &keys,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close,
bool alreadySorted=
false);
6242 void setChartStyle(ChartStyle style);
6243 void setWidth(
double width);
6244 void setWidthType(WidthType widthType);
6245 void setTwoColored(
bool twoColored);
6246 void setBrushPositive(
const QBrush &brush);
6247 void setBrushNegative(
const QBrush &brush);
6248 void setPenPositive(
const QPen &pen);
6249 void setPenNegative(
const QPen &pen);
6252 void addData(
const QVector<double> &keys,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close,
bool alreadySorted=
false);
6253 void addData(
double key,
double open,
double high,
double low,
double close);
6256 virtual QCPDataSelection selectTestRect(
const QRectF &rect,
bool onlySelectable)
const Q_DECL_OVERRIDE;
6257 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
6258 virtual QCPRange getKeyRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE;
6259 virtual QCPRange getValueRange(
bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE;
6262 static QCPFinancialDataContainer timeSeriesToOhlc(const QVector<
double> &time, const QVector<
double> &value,
double timeBinSize,
double timeBinOffset = 0);
6266 ChartStyle mChartStyle;
6268 WidthType mWidthType;
6270 QBrush mBrushPositive, mBrushNegative;
6271 QPen mPenPositive, mPenNegative;
6274 virtual
void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6275 virtual
void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
6278 void drawOhlcPlot(QCPPainter *painter, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end,
bool isSelected);
6279 void drawCandlestickPlot(QCPPainter *painter, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end,
bool isSelected);
6280 double getPixelWidth(
double key,
double keyPixel) const;
6281 double ohlcSelectTest(const QPointF &pos, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end, QCPFinancialDataContainer::const_iterator &closestDataPoint) const;
6282 double candlestickSelectTest(const QPointF &pos, const QCPFinancialDataContainer::const_iterator &begin, const QCPFinancialDataContainer::const_iterator &end, QCPFinancialDataContainer::const_iterator &closestDataPoint) const;
6283 void getVisibleDataBounds(QCPFinancialDataContainer::const_iterator &begin, QCPFinancialDataContainer::const_iterator &end) const;
6284 QRectF selectionHitBox(QCPFinancialDataContainer::const_iterator it) const;
6286 friend class QCustomPlot;
6287 friend class QCPLegend;
6289Q_DECLARE_METATYPE(QCPFinancial::ChartStyle)
6304 double errorMinus, errorPlus;
6324typedef QVector<QCPErrorBarsData> QCPErrorBarsDataContainer;
6330 Q_PROPERTY(QSharedPointer<QCPErrorBarsDataContainer>
data READ
data WRITE
setData)
6333 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE
setWhiskerWidth)
6334 Q_PROPERTY(
double symbolGap READ symbolGap WRITE
setSymbolGap)
6352 QSharedPointer<QCPErrorBarsDataContainer>
data()
const {
return mDataContainer; }
6354 ErrorType errorType()
const {
return mErrorType; }
6355 double whiskerWidth()
const {
return mWhiskerWidth; }
6356 double symbolGap()
const {
return mSymbolGap; }
6359 void setData(QSharedPointer<QCPErrorBarsDataContainer> data);
6360 void setData(
const QVector<double> &error);
6361 void setData(
const QVector<double> &errorMinus,
const QVector<double> &errorPlus);
6362 void setDataPlottable(QCPAbstractPlottable* plottable);
6363 void setErrorType(ErrorType type);
6364 void setWhiskerWidth(
double pixels);
6365 void setSymbolGap(
double pixels);
6368 void addData(
const QVector<double> &error);
6369 void addData(
const QVector<double> &errorMinus,
const QVector<double> &errorPlus);
6370 void addData(
double error);
6371 void addData(
double errorMinus,
double errorPlus);
6374 virtual int dataCount() const Q_DECL_OVERRIDE;
6375 virtual
double dataMainKey(
int index) const Q_DECL_OVERRIDE;
6376 virtual
double dataSortKey(
int index) const Q_DECL_OVERRIDE;
6377 virtual
double dataMainValue(
int index) const Q_DECL_OVERRIDE;
6378 virtual QCPRange dataValueRange(
int index) const Q_DECL_OVERRIDE;
6379 virtual QPointF dataPixelPosition(
int index) const Q_DECL_OVERRIDE;
6380 virtual
bool sortKeyIsMainKey() const Q_DECL_OVERRIDE;
6381 virtual QCPDataSelection selectTestRect(const QRectF &rect,
bool onlySelectable) const Q_DECL_OVERRIDE;
6382 virtual
int findBegin(
double sortKey,
bool expandedRange=true) const Q_DECL_OVERRIDE;
6383 virtual
int findEnd(
double sortKey,
bool expandedRange=true) const Q_DECL_OVERRIDE;
6386 virtual
double selectTest(const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
6391 QSharedPointer<QCPErrorBarsDataContainer> mDataContainer;
6392 QPointer<QCPAbstractPlottable> mDataPlottable;
6393 ErrorType mErrorType;
6394 double mWhiskerWidth;
6398 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6399 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
6404 void getErrorBarLines(QCPErrorBarsDataContainer::const_iterator it, QVector<QLineF> &backbones, QVector<QLineF> &whiskers) const;
6405 void getVisibleDataBounds(QCPErrorBarsDataContainer::const_iterator &begin, QCPErrorBarsDataContainer::const_iterator &end, const
QCPDataRange &rangeRestriction) const;
6406 double pointDistance(const QPointF &pixelPoint, QCPErrorBarsDataContainer::const_iterator &closestData) const;
6409 bool errorBarVisible(
int index) const;
6410 bool rectIntersectsLine(const QRectF &pixelRect, const QLineF &line) const;
6426 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6427 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6434 QPen pen()
const {
return mPen; }
6435 QPen selectedPen()
const {
return mSelectedPen; }
6438 void setPen(
const QPen &pen);
6442 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6449 QPen mPen, mSelectedPen;
6452 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6455 QLineF getRectClippedStraightLine(
const QCPVector2D &base,
const QCPVector2D &vec,
const QRect &rect)
const;
6456 QPen mainPen()
const;
6469 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6470 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6479 QPen pen()
const {
return mPen; }
6480 QPen selectedPen()
const {
return mSelectedPen; }
6485 void setPen(
const QPen &pen);
6491 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6498 QPen mPen, mSelectedPen;
6502 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6506 QPen mainPen()
const;
6519 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6520 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6529 QPen pen()
const {
return mPen; }
6530 QPen selectedPen()
const {
return mSelectedPen; }
6535 void setPen(
const QPen &pen);
6541 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6550 QPen mPen, mSelectedPen;
6554 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6557 QPen mainPen()
const;
6570 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6571 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6572 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
6580 QPen pen()
const {
return mPen; }
6581 QPen selectedPen()
const {
return mSelectedPen; }
6582 QBrush brush()
const {
return mBrush; }
6583 QBrush selectedBrush()
const {
return mSelectedBrush; }
6586 void setPen(
const QPen &pen);
6588 void setBrush(
const QBrush &brush);
6592 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6596 QCPItemAnchor *
const top;
6597 QCPItemAnchor *
const topRight;
6598 QCPItemAnchor *
const right;
6599 QCPItemAnchor *
const bottom;
6600 QCPItemAnchor *
const bottomLeft;
6601 QCPItemAnchor *
const left;
6604 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
6607 QPen mPen, mSelectedPen;
6608 QBrush mBrush, mSelectedBrush;
6611 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6612 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6615 QPen mainPen()
const;
6616 QBrush mainBrush()
const;
6629 Q_PROPERTY(QColor color READ color WRITE
setColor)
6631 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6632 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6633 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
6635 Q_PROPERTY(QFont font READ font WRITE
setFont)
6636 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE
setSelectedFont)
6637 Q_PROPERTY(QString text READ text WRITE
setText)
6639 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE
setTextAlignment)
6640 Q_PROPERTY(
double rotation READ rotation WRITE
setRotation)
6641 Q_PROPERTY(QMargins padding READ padding WRITE
setPadding)
6648 QColor color()
const {
return mColor; }
6649 QColor selectedColor()
const {
return mSelectedColor; }
6650 QPen pen()
const {
return mPen; }
6651 QPen selectedPen()
const {
return mSelectedPen; }
6652 QBrush brush()
const {
return mBrush; }
6653 QBrush selectedBrush()
const {
return mSelectedBrush; }
6654 QFont font()
const {
return mFont; }
6655 QFont selectedFont()
const {
return mSelectedFont; }
6656 QString text()
const {
return mText; }
6657 Qt::Alignment positionAlignment()
const {
return mPositionAlignment; }
6658 Qt::Alignment textAlignment()
const {
return mTextAlignment; }
6659 double rotation()
const {
return mRotation; }
6660 QMargins padding()
const {
return mPadding; }
6663 void setColor(
const QColor &color);
6665 void setPen(
const QPen &pen);
6667 void setBrush(
const QBrush &brush);
6669 void setFont(
const QFont &font);
6671 void setText(
const QString &text);
6678 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6681 QCPItemAnchor *
const topLeft;
6682 QCPItemAnchor *
const top;
6683 QCPItemAnchor *
const topRight;
6684 QCPItemAnchor *
const right;
6685 QCPItemAnchor *
const bottomRight;
6686 QCPItemAnchor *
const bottom;
6687 QCPItemAnchor *
const bottomLeft;
6688 QCPItemAnchor *
const left;
6691 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
6694 QColor mColor, mSelectedColor;
6695 QPen mPen, mSelectedPen;
6696 QBrush mBrush, mSelectedBrush;
6697 QFont mFont, mSelectedFont;
6699 Qt::Alignment mPositionAlignment;
6700 Qt::Alignment mTextAlignment;
6705 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6706 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6709 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
6710 QFont mainFont()
const;
6711 QColor mainColor()
const;
6712 QPen mainPen()
const;
6713 QBrush mainBrush()
const;
6726 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6727 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6728 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
6736 QPen pen()
const {
return mPen; }
6737 QPen selectedPen()
const {
return mSelectedPen; }
6738 QBrush brush()
const {
return mBrush; }
6739 QBrush selectedBrush()
const {
return mSelectedBrush; }
6742 void setPen(
const QPen &pen);
6744 void setBrush(
const QBrush &brush);
6748 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6752 QCPItemAnchor *
const topLeftRim;
6753 QCPItemAnchor *
const top;
6754 QCPItemAnchor *
const topRightRim;
6755 QCPItemAnchor *
const right;
6756 QCPItemAnchor *
const bottomRightRim;
6757 QCPItemAnchor *
const bottom;
6758 QCPItemAnchor *
const bottomLeftRim;
6759 QCPItemAnchor *
const left;
6760 QCPItemAnchor *
const center;
6763 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
6766 QPen mPen, mSelectedPen;
6767 QBrush mBrush, mSelectedBrush;
6770 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6771 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6774 QPen mainPen()
const;
6775 QBrush mainBrush()
const;
6788 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE
setPixmap)
6789 Q_PROPERTY(
bool scaled READ scaled WRITE
setScaled)
6790 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
6791 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
6792 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6793 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6800 QPixmap pixmap()
const {
return mPixmap; }
6801 bool scaled()
const {
return mScaled; }
6802 Qt::AspectRatioMode aspectRatioMode()
const {
return mAspectRatioMode; }
6803 Qt::TransformationMode transformationMode()
const {
return mTransformationMode; }
6804 QPen pen()
const {
return mPen; }
6805 QPen selectedPen()
const {
return mSelectedPen; }
6809 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
6810 void setPen(
const QPen &pen);
6814 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr)
const Q_DECL_OVERRIDE;
6818 QCPItemAnchor *
const top;
6819 QCPItemAnchor *
const topRight;
6820 QCPItemAnchor *
const right;
6821 QCPItemAnchor *
const bottom;
6822 QCPItemAnchor *
const bottomLeft;
6823 QCPItemAnchor *
const left;
6826 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
6830 QPixmap mScaledPixmap;
6832 bool mScaledPixmapInvalidated;
6833 Qt::AspectRatioMode mAspectRatioMode;
6834 Qt::TransformationMode mTransformationMode;
6835 QPen mPen, mSelectedPen;
6838 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6839 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6842 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
6843 QRect getFinalRect(
bool *flippedHorz=
nullptr,
bool *flippedVert=
nullptr)
const;
6844 QPen mainPen()
const;
6857 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6858 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6859 Q_PROPERTY(QBrush brush READ brush WRITE
setBrush)
6861 Q_PROPERTY(
double size READ size WRITE
setSize)
6864 Q_PROPERTY(
double graphKey READ graphKey WRITE
setGraphKey)
6879 Q_ENUMS(TracerStyle)
6885 QPen pen()
const {
return mPen; }
6886 QPen selectedPen()
const {
return mSelectedPen; }
6887 QBrush brush()
const {
return mBrush; }
6888 QBrush selectedBrush()
const {
return mSelectedBrush; }
6889 double size()
const {
return mSize; }
6890 TracerStyle style()
const {
return mStyle; }
6891 QCPGraph *graph()
const {
return mGraph; }
6892 double graphKey()
const {
return mGraphKey; }
6893 bool interpolating()
const {
return mInterpolating; }
6896 void setPen(
const QPen &pen);
6897 void setSelectedPen(
const QPen &pen);
6898 void setBrush(
const QBrush &brush);
6899 void setSelectedBrush(
const QBrush &brush);
6900 void setSize(
double size);
6901 void setStyle(TracerStyle style);
6902 void setGraph(QCPGraph *graph);
6903 void setGraphKey(
double key);
6904 void setInterpolating(
bool enabled);
6907 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
6910 void updatePosition();
6912 QCPItemPosition * const position;
6916 QPen mPen, mSelectedPen;
6917 QBrush mBrush, mSelectedBrush;
6922 bool mInterpolating;
6925 virtual
void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6928 QPen mainPen() const;
6929 QBrush mainBrush() const;
6931Q_DECLARE_METATYPE(QCPItemTracer::TracerStyle)
6943 Q_PROPERTY(QPen pen READ pen WRITE
setPen)
6944 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE
setSelectedPen)
6945 Q_PROPERTY(
double length READ length WRITE
setLength)
6960 Q_ENUMS(BracketStyle)
6966 QPen pen()
const {
return mPen; }
6967 QPen selectedPen()
const {
return mSelectedPen; }
6968 double length()
const {
return mLength; }
6969 BracketStyle style()
const {
return mStyle; }
6972 void setPen(
const QPen &pen);
6973 void setSelectedPen(
const QPen &pen);
6974 void setLength(
double length);
6975 void setStyle(BracketStyle style);
6978 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=
nullptr) const Q_DECL_OVERRIDE;
6980 QCPItemPosition * const left;
6981 QCPItemPosition * const right;
6982 QCPItemAnchor * const center;
6986 enum AnchorIndex {aiCenter};
6987 QPen mPen, mSelectedPen;
6989 BracketStyle mStyle;
6992 virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
6993 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6996 QPen mainPen()
const;
7020 Q_ENUMS(AngleReference)
7038 Q_ENUMS(SelectablePart)
7039 Q_FLAGS(SelectableParts)
7040 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
7042 enum LabelMode { lmUpright
7047 explicit QCPPolarAxisRadial(QCPPolarAxisAngular *parent);
7048 virtual ~QCPPolarAxisRadial();
7051 bool rangeDrag()
const {
return mRangeDrag; }
7052 bool rangeZoom()
const {
return mRangeZoom; }
7053 double rangeZoomFactor()
const {
return mRangeZoomFactor; }
7055 QCPPolarAxisAngular *angularAxis()
const {
return mAngularAxis; }
7056 ScaleType scaleType()
const {
return mScaleType; }
7057 const QCPRange range()
const {
return mRange; }
7058 bool rangeReversed()
const {
return mRangeReversed; }
7059 double angle()
const {
return mAngle; }
7060 AngleReference angleReference()
const {
return mAngleReference; }
7061 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
7062 bool ticks()
const {
return mTicks; }
7063 bool tickLabels()
const {
return mTickLabels; }
7064 int tickLabelPadding()
const {
return mLabelPainter.padding(); }
7065 QFont tickLabelFont()
const {
return mTickLabelFont; }
7066 QColor tickLabelColor()
const {
return mTickLabelColor; }
7067 double tickLabelRotation()
const {
return mLabelPainter.rotation(); }
7068 LabelMode tickLabelMode()
const;
7069 QString numberFormat()
const;
7070 int numberPrecision()
const {
return mNumberPrecision; }
7071 QVector<double> tickVector()
const {
return mTickVector; }
7072 QVector<double> subTickVector()
const {
return mSubTickVector; }
7073 QVector<QString> tickVectorLabels()
const {
return mTickVectorLabels; }
7074 int tickLengthIn()
const;
7075 int tickLengthOut()
const;
7076 bool subTicks()
const {
return mSubTicks; }
7077 int subTickLengthIn()
const;
7078 int subTickLengthOut()
const;
7079 QPen basePen()
const {
return mBasePen; }
7080 QPen tickPen()
const {
return mTickPen; }
7081 QPen subTickPen()
const {
return mSubTickPen; }
7082 QFont labelFont()
const {
return mLabelFont; }
7083 QColor labelColor()
const {
return mLabelColor; }
7084 QString label()
const {
return mLabel; }
7085 int labelPadding()
const;
7086 SelectableParts selectedParts()
const {
return mSelectedParts; }
7087 SelectableParts selectableParts()
const {
return mSelectableParts; }
7088 QFont selectedTickLabelFont()
const {
return mSelectedTickLabelFont; }
7089 QFont selectedLabelFont()
const {
return mSelectedLabelFont; }
7090 QColor selectedTickLabelColor()
const {
return mSelectedTickLabelColor; }
7091 QColor selectedLabelColor()
const {
return mSelectedLabelColor; }
7092 QPen selectedBasePen()
const {
return mSelectedBasePen; }
7093 QPen selectedTickPen()
const {
return mSelectedTickPen; }
7094 QPen selectedSubTickPen()
const {
return mSelectedSubTickPen; }
7097 void setRangeDrag(
bool enabled);
7098 void setRangeZoom(
bool enabled);
7099 void setRangeZoomFactor(
double factor);
7102 Q_SLOT
void setRange(
const QCPRange &range);
7103 void setRange(
double lower,
double upper);
7104 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
7105 void setRangeLower(
double lower);
7106 void setRangeUpper(
double upper);
7107 void setRangeReversed(
bool reversed);
7108 void setAngle(
double degrees);
7109 void setAngleReference(AngleReference reference);
7110 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
7111 void setTicks(
bool show);
7112 void setTickLabels(
bool show);
7113 void setTickLabelPadding(
int padding);
7114 void setTickLabelFont(
const QFont &font);
7115 void setTickLabelColor(
const QColor &color);
7116 void setTickLabelRotation(
double degrees);
7117 void setTickLabelMode(LabelMode mode);
7118 void setNumberFormat(
const QString &formatCode);
7119 void setNumberPrecision(
int precision);
7120 void setTickLength(
int inside,
int outside=0);
7121 void setTickLengthIn(
int inside);
7122 void setTickLengthOut(
int outside);
7123 void setSubTicks(
bool show);
7124 void setSubTickLength(
int inside,
int outside=0);
7125 void setSubTickLengthIn(
int inside);
7126 void setSubTickLengthOut(
int outside);
7127 void setBasePen(
const QPen &pen);
7128 void setTickPen(
const QPen &pen);
7129 void setSubTickPen(
const QPen &pen);
7130 void setLabelFont(
const QFont &font);
7131 void setLabelColor(
const QColor &color);
7132 void setLabel(
const QString &str);
7133 void setLabelPadding(
int padding);
7134 void setSelectedTickLabelFont(
const QFont &font);
7135 void setSelectedLabelFont(
const QFont &font);
7136 void setSelectedTickLabelColor(
const QColor &color);
7137 void setSelectedLabelColor(
const QColor &color);
7138 void setSelectedBasePen(
const QPen &pen);
7139 void setSelectedTickPen(
const QPen &pen);
7140 void setSelectedSubTickPen(
const QPen &pen);
7141 Q_SLOT
void setSelectableParts(
const QCPPolarAxisRadial::SelectableParts &selectableParts);
7142 Q_SLOT
void setSelectedParts(
const QCPPolarAxisRadial::SelectableParts &selectedParts);
7145 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE;
7148 void moveRange(
double diff);
7149 void scaleRange(
double factor);
7150 void scaleRange(
double factor,
double center);
7151 void rescale(
bool onlyVisiblePlottables=false);
7152 void pixelToCoord(QPointF pixelPos,
double &angleCoord,
double &radiusCoord) const;
7153 QPointF coordToPixel(
double angleCoord,
double radiusCoord) const;
7154 double coordToRadius(
double coord) const;
7155 double radiusToCoord(
double radius) const;
7156 SelectablePart getPartAt(const QPointF &pos) const;
7169 double mRangeZoomFactor;
7172 QCPPolarAxisAngular *mAngularAxis;
7175 SelectableParts mSelectableParts, mSelectedParts;
7176 QPen mBasePen, mSelectedBasePen;
7180 QFont mLabelFont, mSelectedLabelFont;
7181 QColor mLabelColor, mSelectedLabelColor;
7186 QFont mTickLabelFont, mSelectedTickLabelFont;
7187 QColor mTickLabelColor, mSelectedTickLabelColor;
7188 int mNumberPrecision;
7189 QLatin1Char mNumberFormatChar;
7190 bool mNumberBeautifulPowers;
7191 bool mNumberMultiplyCross;
7195 int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut;
7196 QPen mTickPen, mSelectedTickPen;
7197 QPen mSubTickPen, mSelectedSubTickPen;
7200 bool mRangeReversed;
7207 QVector<
double> mTickVector;
7208 QVector<QString> mTickVectorLabels;
7209 QVector<
double> mSubTickVector;
7212 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
7216 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
7217 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
7218 virtual
QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
7220 virtual
void selectEvent(QMouseEvent *event,
bool additive, const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
7221 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
7223 virtual
void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE;
7224 virtual
void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
7225 virtual
void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
7226 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
7229 void updateGeometry(const QPointF ¢er,
double radius);
7230 void setupTickVectors();
7231 QPen getBasePen() const;
7232 QPen getTickPen() const;
7233 QPen getSubTickPen() const;
7234 QFont getTickLabelFont() const;
7235 QFont getLabelFont() const;
7236 QColor getTickLabelColor() const;
7237 QColor getLabelColor() const;
7242 friend class QCustomPlot;
7243 friend class QCPPolarAxisAngular;
7274 Q_ENUMS(SelectablePart)
7275 Q_FLAGS(SelectableParts)
7276 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
7290 QPixmap background()
const {
return mBackgroundPixmap; }
7291 QBrush backgroundBrush()
const {
return mBackgroundBrush; }
7292 bool backgroundScaled()
const {
return mBackgroundScaled; }
7293 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
7294 bool rangeDrag()
const {
return mRangeDrag; }
7295 bool rangeZoom()
const {
return mRangeZoom; }
7296 double rangeZoomFactor()
const {
return mRangeZoomFactor; }
7298 const QCPRange range()
const {
return mRange; }
7299 bool rangeReversed()
const {
return mRangeReversed; }
7300 double angle()
const {
return mAngle; }
7301 QSharedPointer<QCPAxisTicker> ticker()
const {
return mTicker; }
7302 bool ticks()
const {
return mTicks; }
7303 bool tickLabels()
const {
return mTickLabels; }
7304 int tickLabelPadding()
const {
return mLabelPainter.padding(); }
7305 QFont tickLabelFont()
const {
return mTickLabelFont; }
7306 QColor tickLabelColor()
const {
return mTickLabelColor; }
7307 double tickLabelRotation()
const {
return mLabelPainter.rotation(); }
7308 LabelMode tickLabelMode()
const;
7309 QString numberFormat()
const;
7310 int numberPrecision()
const {
return mNumberPrecision; }
7311 QVector<double> tickVector()
const {
return mTickVector; }
7312 QVector<QString> tickVectorLabels()
const {
return mTickVectorLabels; }
7313 int tickLengthIn()
const {
return mTickLengthIn; }
7314 int tickLengthOut()
const {
return mTickLengthOut; }
7315 bool subTicks()
const {
return mSubTicks; }
7316 int subTickLengthIn()
const {
return mSubTickLengthIn; }
7317 int subTickLengthOut()
const {
return mSubTickLengthOut; }
7318 QPen basePen()
const {
return mBasePen; }
7319 QPen tickPen()
const {
return mTickPen; }
7320 QPen subTickPen()
const {
return mSubTickPen; }
7321 QFont labelFont()
const {
return mLabelFont; }
7322 QColor labelColor()
const {
return mLabelColor; }
7323 QString label()
const {
return mLabel; }
7324 int labelPadding()
const {
return mLabelPadding; }
7325 SelectableParts selectedParts()
const {
return mSelectedParts; }
7326 SelectableParts selectableParts()
const {
return mSelectableParts; }
7327 QFont selectedTickLabelFont()
const {
return mSelectedTickLabelFont; }
7328 QFont selectedLabelFont()
const {
return mSelectedLabelFont; }
7329 QColor selectedTickLabelColor()
const {
return mSelectedTickLabelColor; }
7330 QColor selectedLabelColor()
const {
return mSelectedLabelColor; }
7331 QPen selectedBasePen()
const {
return mSelectedBasePen; }
7332 QPen selectedTickPen()
const {
return mSelectedTickPen; }
7333 QPen selectedSubTickPen()
const {
return mSelectedSubTickPen; }
7334 QCPPolarGrid *grid()
const {
return mGrid; }
7337 void setBackground(
const QPixmap &pm);
7338 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
7339 void setBackground(
const QBrush &brush);
7340 void setBackgroundScaled(
bool scaled);
7341 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
7342 void setRangeDrag(
bool enabled);
7343 void setRangeZoom(
bool enabled);
7344 void setRangeZoomFactor(
double factor);
7346 Q_SLOT
void setRange(
const QCPRange &range);
7347 void setRange(
double lower,
double upper);
7348 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
7349 void setRangeLower(
double lower);
7350 void setRangeUpper(
double upper);
7351 void setRangeReversed(
bool reversed);
7352 void setAngle(
double degrees);
7353 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
7354 void setTicks(
bool show);
7355 void setTickLabels(
bool show);
7356 void setTickLabelPadding(
int padding);
7357 void setTickLabelFont(
const QFont &font);
7358 void setTickLabelColor(
const QColor &color);
7359 void setTickLabelRotation(
double degrees);
7360 void setTickLabelMode(LabelMode mode);
7361 void setNumberFormat(
const QString &formatCode);
7362 void setNumberPrecision(
int precision);
7363 void setTickLength(
int inside,
int outside=0);
7364 void setTickLengthIn(
int inside);
7365 void setTickLengthOut(
int outside);
7366 void setSubTicks(
bool show);
7367 void setSubTickLength(
int inside,
int outside=0);
7368 void setSubTickLengthIn(
int inside);
7369 void setSubTickLengthOut(
int outside);
7370 void setBasePen(
const QPen &pen);
7371 void setTickPen(
const QPen &pen);
7372 void setSubTickPen(
const QPen &pen);
7373 void setLabelFont(
const QFont &font);
7374 void setLabelColor(
const QColor &color);
7375 void setLabel(
const QString &str);
7376 void setLabelPadding(
int padding);
7377 void setLabelPosition(Qt::AlignmentFlag position);
7378 void setSelectedTickLabelFont(
const QFont &font);
7379 void setSelectedLabelFont(
const QFont &font);
7380 void setSelectedTickLabelColor(
const QColor &color);
7381 void setSelectedLabelColor(
const QColor &color);
7382 void setSelectedBasePen(
const QPen &pen);
7383 void setSelectedTickPen(
const QPen &pen);
7384 void setSelectedSubTickPen(
const QPen &pen);
7385 Q_SLOT
void setSelectableParts(
const QCPPolarAxisAngular::SelectableParts &selectableParts);
7386 Q_SLOT
void setSelectedParts(
const QCPPolarAxisAngular::SelectableParts &selectedParts);
7389 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE;
7390 virtual
void update(UpdatePhase phase) Q_DECL_OVERRIDE;
7391 virtual QList<QCPLayoutElement*> elements(
bool recursive) const Q_DECL_OVERRIDE;
7394 bool removeGraph(QCPPolarGraph *graph);
7395 int radialAxisCount() const;
7396 QCPPolarAxisRadial *radialAxis(
int index=0) const;
7397 QList<QCPPolarAxisRadial*> radialAxes() const;
7398 QCPPolarAxisRadial *addRadialAxis(QCPPolarAxisRadial *axis=0);
7399 bool removeRadialAxis(QCPPolarAxisRadial *axis);
7401 QRegion exactClipRegion()
const;
7403 void moveRange(
double diff);
7404 void scaleRange(
double factor);
7405 void scaleRange(
double factor,
double center);
7406 void rescale(
bool onlyVisiblePlottables=
false);
7407 double coordToAngleRad(
double coord)
const {
return mAngleRad+(coord-mRange.lower)/mRange.
size()*(mRangeReversed ? -2.0*M_PI : 2.0*M_PI); }
7408 double angleRadToCoord(
double angleRad)
const {
return mRange.lower+(angleRad-mAngleRad)/(mRangeReversed ? -2.0*M_PI : 2.0*M_PI)*mRange.
size(); }
7409 void pixelToCoord(QPointF pixelPos,
double &angleCoord,
double &radiusCoord)
const;
7410 QPointF coordToPixel(
double angleCoord,
double radiusCoord)
const;
7411 SelectablePart getPartAt(
const QPointF &pos)
const;
7414 int left()
const {
return mRect.left(); }
7415 int right()
const {
return mRect.right(); }
7416 int top()
const {
return mRect.top(); }
7417 int bottom()
const {
return mRect.bottom(); }
7418 int width()
const {
return mRect.width(); }
7419 int height()
const {
return mRect.height(); }
7420 QSize
size()
const {
return mRect.size(); }
7421 QPoint
topLeft()
const {
return mRect.topLeft(); }
7426 double radius()
const {
return mRadius; }
7429 void rangeChanged(
const QCPRange &newRange);
7430 void rangeChanged(
const QCPRange &newRange,
const QCPRange &oldRange);
7431 void selectionChanged(
const QCPPolarAxisAngular::SelectableParts &parts);
7432 void selectableChanged(
const QCPPolarAxisAngular::SelectableParts &parts);
7436 QBrush mBackgroundBrush;
7437 QPixmap mBackgroundPixmap;
7438 QPixmap mScaledBackgroundPixmap;
7439 bool mBackgroundScaled;
7440 Qt::AspectRatioMode mBackgroundScaledMode;
7441 QCPLayoutInset *mInsetLayout;
7444 double mRangeZoomFactor;
7447 double mAngle, mAngleRad;
7448 SelectableParts mSelectableParts, mSelectedParts;
7449 QPen mBasePen, mSelectedBasePen;
7453 QFont mLabelFont, mSelectedLabelFont;
7454 QColor mLabelColor, mSelectedLabelColor;
7459 QFont mTickLabelFont, mSelectedTickLabelFont;
7460 QColor mTickLabelColor, mSelectedTickLabelColor;
7461 int mNumberPrecision;
7462 QLatin1Char mNumberFormatChar;
7463 bool mNumberBeautifulPowers;
7464 bool mNumberMultiplyCross;
7468 int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut;
7469 QPen mTickPen, mSelectedTickPen;
7470 QPen mSubTickPen, mSelectedSubTickPen;
7473 bool mRangeReversed;
7478 QList<QCPPolarAxisRadial*> mRadialAxes;
7479 QCPPolarGrid *mGrid;
7480 QList<QCPPolarGraph*> mGraphs;
7481 QSharedPointer<QCPAxisTicker> mTicker;
7482 QVector<double> mTickVector;
7483 QVector<QString> mTickVectorLabels;
7484 QVector<QPointF> mTickVectorCosSin;
7485 QVector<double> mSubTickVector;
7486 QVector<QPointF> mSubTickVectorCosSin;
7488 QCPRange mDragAngularStart;
7489 QList<QCPRange> mDragRadialStart;
7490 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
7491 QCPLabelPainterPrivate mLabelPainter;
7494 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const Q_DECL_OVERRIDE;
7495 virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7498 virtual
void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE;
7499 virtual
void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
7500 virtual
void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE;
7501 virtual
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
7504 bool registerPolarGraph(QCPPolarGraph *graph);
7505 void drawBackground(QCPPainter *painter, const QPointF ¢er,
double radius);
7506 void setupTickVectors();
7507 QPen getBasePen() const;
7508 QPen getTickPen() const;
7509 QPen getSubTickPen() const;
7510 QFont getTickLabelFont() const;
7511 QFont getLabelFont() const;
7512 QColor getTickLabelColor() const;
7513 QColor getLabelColor() const;
7516 Q_DISABLE_COPY(QCPPolarAxisAngular)
7518 friend class QCustomPlot;
7519 friend class QCPPolarGrid;
7520 friend class QCPPolarGraph;
7522Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPolarAxisAngular::SelectableParts)
7523Q_DECLARE_METATYPE(QCPPolarAxisAngular::SelectablePart)
7548 Q_DECLARE_FLAGS(GridTypes, GridType)
7554 GridTypes type()
const {
return mType; }
7555 GridTypes subGridType()
const {
return mSubGridType; }
7556 bool antialiasedSubGrid()
const {
return mAntialiasedSubGrid; }
7557 bool antialiasedZeroLine()
const {
return mAntialiasedZeroLine; }
7558 QPen angularPen()
const {
return mAngularPen; }
7559 QPen angularSubGridPen()
const {
return mAngularSubGridPen; }
7560 QPen radialPen()
const {
return mRadialPen; }
7561 QPen radialSubGridPen()
const {
return mRadialSubGridPen; }
7562 QPen radialZeroLinePen()
const {
return mRadialZeroLinePen; }
7565 void setRadialAxis(QCPPolarAxisRadial *axis);
7566 void setType(GridTypes type);
7567 void setSubGridType(GridTypes type);
7568 void setAntialiasedSubGrid(
bool enabled);
7569 void setAntialiasedZeroLine(
bool enabled);
7570 void setAngularPen(
const QPen &pen);
7571 void setAngularSubGridPen(
const QPen &pen);
7572 void setRadialPen(
const QPen &pen);
7573 void setRadialSubGridPen(
const QPen &pen);
7574 void setRadialZeroLinePen(
const QPen &pen);
7579 GridTypes mSubGridType;
7580 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
7581 QPen mAngularPen, mAngularSubGridPen;
7582 QPen mRadialPen, mRadialSubGridPen, mRadialZeroLinePen;
7585 QCPPolarAxisAngular *mParentAxis;
7586 QPointer<QCPPolarAxisRadial> mRadialAxis;
7589 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const Q_DECL_OVERRIDE;
7590 virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
7593 void drawRadialGrid(QCPPainter *painter,
const QPointF ¢er,
const QVector<double> &coords,
const QPen &pen,
const QPen &zeroPen=Qt::NoPen);
7594 void drawAngularGrid(QCPPainter *painter,
const QPointF ¢er,
double radius,
const QVector<QPointF> &ticksCosSin,
const QPen &pen);
7597 Q_DISABLE_COPY(QCPPolarGrid)
7601Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPolarGrid::GridTypes)
7616 QCPPolarLegendItem(QCPLegend *parent,
QCPPolarGraph *graph);
7626 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
7630 QPen getIconBorderPen()
const;
7631 QColor getTextColor()
const;
7632 QFont getFont()
const;
7658 QString name()
const {
return mName; }
7659 bool antialiasedFill()
const {
return mAntialiasedFill; }
7660 bool antialiasedScatters()
const {
return mAntialiasedScatters; }
7661 QPen pen()
const {
return mPen; }
7662 QBrush brush()
const {
return mBrush; }
7663 bool periodic()
const {
return mPeriodic; }
7664 QCPPolarAxisAngular *keyAxis()
const {
return mKeyAxis.data(); }
7665 QCPPolarAxisRadial *valueAxis()
const {
return mValueAxis.data(); }
7667 bool selected()
const {
return !mSelection.
isEmpty(); }
7668 QCPDataSelection selection()
const {
return mSelection; }
7670 QSharedPointer<QCPGraphDataContainer> data()
const {
return mDataContainer; }
7671 LineStyle lineStyle()
const {
return mLineStyle; }
7672 QCPScatterStyle scatterStyle()
const {
return mScatterStyle; }
7675 void setName(
const QString &name);
7676 void setAntialiasedFill(
bool enabled);
7677 void setAntialiasedScatters(
bool enabled);
7678 void setPen(
const QPen &pen);
7679 void setBrush(
const QBrush &brush);
7680 void setPeriodic(
bool enabled);
7681 void setKeyAxis(QCPPolarAxisAngular *axis);
7682 void setValueAxis(QCPPolarAxisRadial *axis);
7684 Q_SLOT
void setSelection(QCPDataSelection selection);
7686 void setData(QSharedPointer<QCPGraphDataContainer> data);
7687 void setData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
7688 void setLineStyle(LineStyle ls);
7689 void setScatterStyle(
const QCPScatterStyle &style);
7692 void addData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
7693 void addData(
double key,
double value);
7694 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
7695 const QPointF coordsToPixels(
double key,
double value)
const;
7696 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
7697 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
7698 void rescaleAxes(
bool onlyEnlarge=
false)
const;
7699 void rescaleKeyAxis(
bool onlyEnlarge=
false)
const;
7700 void rescaleValueAxis(
bool onlyEnlarge=
false,
bool inKeyRange=
false)
const;
7701 bool addToLegend(QCPLegend *legend);
7703 bool removeFromLegend(QCPLegend *legend)
const;
7704 bool removeFromLegend()
const;
7707 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
7708 virtual QCPPlottableInterface1D *interface1D() {
return 0; }
7710 virtual QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth,
const QCPRange &inKeyRange=QCPRange())
const;
7713 void selectionChanged(
bool selected);
7714 void selectionChanged(
const QCPDataSelection &selection);
7719 QSharedPointer<QCPGraphDataContainer> mDataContainer;
7720 LineStyle mLineStyle;
7721 QCPScatterStyle mScatterStyle;
7723 bool mAntialiasedFill, mAntialiasedScatters;
7727 QPointer<QCPPolarAxisAngular> mKeyAxis;
7728 QPointer<QCPPolarAxisRadial> mValueAxis;
7730 QCPDataSelection mSelection;
7734 virtual QRect clipRect()
const;
7735 virtual void draw(QCPPainter *painter);
7737 void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
7739 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
7740 virtual void deselectEvent(
bool *selectionStateChanged);
7742 virtual void drawLinePlot(QCPPainter *painter,
const QVector<QPointF> &lines)
const;
7743 virtual void drawFill(QCPPainter *painter, QVector<QPointF> *lines)
const;
7744 virtual void drawScatterPlot(QCPPainter *painter,
const QVector<QPointF> &scatters,
const QCPScatterStyle &style)
const;
7747 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
7750 void applyFillAntialiasingHint(QCPPainter *painter)
const;
7751 void applyScattersAntialiasingHint(QCPPainter *painter)
const;
7752 double pointDistance(
const QPointF &pixelPoint, QCPGraphDataContainer::const_iterator &closestData)
const;
7754 virtual int dataCount()
const;
7755 void getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments)
const;
7756 void drawPolyline(QCPPainter *painter,
const QVector<QPointF> &lineData)
const;
7757 void getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end,
const QCPDataRange &rangeRestriction)
const;
7758 void getLines(QVector<QPointF> *lines,
const QCPDataRange &dataRange)
const;
7759 void getScatters(QVector<QPointF> *scatters,
const QCPDataRange &dataRange)
const;
7760 void getOptimizedLineData(QVector<QCPGraphData> *lineData,
const QCPGraphDataContainer::const_iterator &begin,
const QCPGraphDataContainer::const_iterator &end)
const;
7761 void getOptimizedScatterData(QVector<QCPGraphData> *scatterData, QCPGraphDataContainer::const_iterator begin, QCPGraphDataContainer::const_iterator end)
const;
7762 QVector<QPointF> dataToLines(
const QVector<QCPGraphData> &data)
const;
7765 Q_DISABLE_COPY(QCPPolarGraph)
7767 friend class QCPPolarLegendItem;
The abstract base class for all items in a plot.
Definition qcustomplot.h:3714
Q_SLOT void setSelected(bool selected)
Definition qcustomplot.cpp:13017
void setClipToAxisRect(bool clip)
Definition qcustomplot.cpp:12965
QList< QCPItemPosition * > positions() const
Definition qcustomplot.h:3742
void setClipAxisRect(QCPAxisRect *rect)
Definition qcustomplot.cpp:12978
QList< QCPItemAnchor * > anchors() const
Definition qcustomplot.h:3743
Q_SLOT void setSelectable(bool selectable)
Definition qcustomplot.cpp:12994
QCPAbstractItem(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:12931
void selectionChanged(bool selected)
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE=0
The abstract base class for all entries in a QCPLegend.
Definition qcustomplot.h:5051
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:18840
void setFont(const QFont &font)
Definition qcustomplot.cpp:18771
void setSelectedTextColor(const QColor &color)
Definition qcustomplot.cpp:18803
void setTextColor(const QColor &color)
Definition qcustomplot.cpp:18781
Q_SLOT void setSelected(bool selected)
Definition qcustomplot.cpp:18830
void selectionChanged(bool selected)
void setSelectedFont(const QFont &font)
Definition qcustomplot.cpp:18792
Q_SLOT void setSelectable(bool selectable)
Definition qcustomplot.cpp:18813
QCPAbstractLegendItem(QCPLegend *parent)
Definition qcustomplot.cpp:18752
The abstract base class for paint buffers, which define the rendering backend.
Definition qcustomplot.h:575
virtual void draw(QCPPainter *painter) const =0
QCPAbstractPaintBuffer(const QSize &size, double devicePixelRatio)
Definition qcustomplot.cpp:581
void setDevicePixelRatio(double ratio)
Definition qcustomplot.cpp:638
virtual void clear(const QColor &color)=0
void setSize(const QSize &size)
Definition qcustomplot.cpp:600
virtual void donePainting()
Definition qcustomplot.h:592
virtual void reallocateBuffer()=0
virtual QCPPainter * startPainting()=0
void setInvalidated(bool invalidated=true)
Definition qcustomplot.cpp:624
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4522
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4596
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.h:4404
virtual QCPRange dataValueRange(int index) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4476
virtual double dataMainValue(int index) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4460
virtual QPointF dataPixelPosition(int index) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4492
virtual int findEnd(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4580
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
Definition qcustomplot.h:4688
virtual double dataSortKey(int index) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4444
virtual int dataCount() const Q_DECL_OVERRIDE
Definition qcustomplot.h:4419
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
Definition qcustomplot.h:4200
virtual int findBegin(double sortKey, bool expandedRange=true) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4571
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
Definition qcustomplot.h:4658
virtual double dataMainKey(int index) const Q_DECL_OVERRIDE
Definition qcustomplot.h:4428
virtual bool sortKeyIsMainKey() const Q_DECL_OVERRIDE
Definition qcustomplot.h:4509
The abstract base class for all data representing objects in a plot.
Definition qcustomplot.h:3496
QCPDataSelection selection() const
Definition qcustomplot.h:3524
void setAntialiasedFill(bool enabled)
Definition qcustomplot.cpp:11463
bool selected() const
Definition qcustomplot.h:3523
void rescaleAxes(bool onlyEnlarge=false) const
Definition qcustomplot.cpp:11710
void setSelectionDecorator(QCPSelectionDecorator *decorator)
Definition qcustomplot.cpp:11577
Q_SLOT void setSelection(QCPDataSelection selection)
Definition qcustomplot.cpp:11557
void setAntialiasedScatters(bool enabled)
Definition qcustomplot.cpp:11474
void pixelsToCoords(double x, double y, double &key, double &value) const
Definition qcustomplot.cpp:11671
void selectionChanged(bool selected)
virtual QCPPlottableInterface1D * interface1D()
Definition qcustomplot.h:3541
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
void selectableChanged(QCP::SelectionType selectable)
bool addToLegend()
Definition qcustomplot.cpp:11837
void rescaleValueAxis(bool onlyEnlarge=false, bool inKeyRange=false) const
Definition qcustomplot.cpp:11763
void setValueAxis(QCPAxis *axis)
Definition qcustomplot.cpp:11533
QCPSelectionDecorator * selectionDecorator() const
Definition qcustomplot.h:3525
void selectionChanged(const QCPDataSelection &selection)
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:11501
void coordsToPixels(double key, double value, double &x, double &y) const
Definition qcustomplot.cpp:11629
void setKeyAxis(QCPAxis *axis)
Definition qcustomplot.cpp:11517
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE=0
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
void setPen(const QPen &pen)
Definition qcustomplot.cpp:11487
void setName(const QString &name)
Definition qcustomplot.cpp:11452
Q_SLOT void setSelectable(QCP::SelectionType selectable)
Definition qcustomplot.cpp:11603
bool removeFromLegend() const
Definition qcustomplot.cpp:11875
void rescaleKeyAxis(bool onlyEnlarge=false) const
Definition qcustomplot.cpp:11721
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:11418
Definition qcustomplot.h:2426
QCPAxisPainterPrivate(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:9898
Holds multiple axes and arranges them in a rectangular shape.
Definition qcustomplot.h:4925
bool removeAxis(QCPAxis *axis)
Definition qcustomplot.cpp:17770
int width() const
Definition qcustomplot.h:4990
QCPAxis * addAxis(QCPAxis::AxisType type, QCPAxis *axis=nullptr)
Definition qcustomplot.cpp:17694
QPoint bottomRight() const
Definition qcustomplot.h:4996
int right() const
Definition qcustomplot.h:4987
int top() const
Definition qcustomplot.h:4988
QCPAxis * axis(QCPAxis::AxisType type, int index=0) const
Definition qcustomplot.cpp:17623
QPoint topLeft() const
Definition qcustomplot.h:4993
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
Definition qcustomplot.cpp:18114
QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes=true)
Definition qcustomplot.cpp:17555
void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical)
Definition qcustomplot.cpp:18261
QCPAxis * rangeZoomAxis(Qt::Orientation orientation)
Definition qcustomplot.cpp:18139
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:18635
QCPAxis * rangeDragAxis(Qt::Orientation orientation)
Definition qcustomplot.cpp:18125
QList< QCPAxis * > addAxes(QCPAxis::AxisTypes types)
Definition qcustomplot.cpp:17749
void setRangeZoom(Qt::Orientations orientations)
Definition qcustomplot.cpp:18245
QSize size() const
Definition qcustomplot.h:4992
QPoint topRight() const
Definition qcustomplot.h:4994
int axisCount(QCPAxis::AxisType type) const
Definition qcustomplot.cpp:17613
QList< QCPAxis * > rangeZoomAxes(Qt::Orientation orientation)
Definition qcustomplot.cpp:18178
void setRangeZoomFactor(double horizontalFactor, double verticalFactor)
Definition qcustomplot.cpp:18403
QList< QCPAxis * > axes(QCPAxis::AxisTypes types) const
Definition qcustomplot.cpp:17644
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:18661
void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical)
Definition qcustomplot.cpp:18333
QCPLayoutInset * insetLayout() const
Definition qcustomplot.h:4976
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:18575
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:18543
QList< QCPAxis * > rangeDragAxes(Qt::Orientation orientation)
Definition qcustomplot.cpp:18152
QPoint bottomLeft() const
Definition qcustomplot.h:4995
int height() const
Definition qcustomplot.h:4991
int bottom() const
Definition qcustomplot.h:4989
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:17991
QPoint center() const
Definition qcustomplot.h:4997
double rangeZoomFactor(Qt::Orientation orientation)
Definition qcustomplot.cpp:18204
void setRangeDrag(Qt::Orientations orientations)
Definition qcustomplot.cpp:18225
void setBackgroundScaled(bool scaled)
Definition qcustomplot.cpp:18104
void setBackground(const QPixmap &pm)
Definition qcustomplot.cpp:18055
int left() const
Definition qcustomplot.h:4986
static double dateTimeToKey(const QDateTime &dateTime)
Definition qcustomplot.cpp:6804
void setTimeZone(const QTimeZone &zone)
Definition qcustomplot.cpp:6602
static QDateTime keyToDateTime(double key)
Definition qcustomplot.cpp:6784
void setTickOrigin(double origin)
Definition qcustomplot.cpp:6618
QCPAxisTickerDateTime()
Definition qcustomplot.cpp:6527
void setDateTimeFormat(const QString &format)
Definition qcustomplot.cpp:6572
void setDateTimeSpec(Qt::TimeSpec spec)
Definition qcustomplot.cpp:6590
Specialized axis ticker with a fixed tick step.
Definition qcustomplot.h:1899
ScaleStrategy
Definition qcustomplot.h:1908
@ ssMultiples
An integer multiple of the specified tick step is allowed. The used factor follows the base class pro...
Definition qcustomplot.h:1909
@ ssNone
Modifications are not allowed, the specified tick step is absolutely fixed. This might cause a high t...
Definition qcustomplot.h:1908
@ ssPowers
An integer power of the specified tick step is allowed.
Definition qcustomplot.h:1910
QCPAxisTickerFixed()
Definition qcustomplot.cpp:7116
void setLogBase(double base)
Definition qcustomplot.cpp:7739
void setSubTickCount(int subTicks)
Definition qcustomplot.cpp:7759
QCPAxisTickerLog()
Definition qcustomplot.cpp:7728
Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi.
Definition qcustomplot.h:1979
FractionStyle
Definition qcustomplot.h:1987
@ fsFloatingPoint
Fractions are displayed as regular decimal floating point numbers, e.g. "0.25" or "0....
Definition qcustomplot.h:1987
@ fsAsciiFractions
Fractions are written as rationals using ASCII characters only, e.g. "1/4" or "1/8".
Definition qcustomplot.h:1988
@ fsUnicodeFractions
Fractions are written using sub- and superscript UTF-8 digits and the fraction symbol.
Definition qcustomplot.h:1989
QCPAxisTickerPi()
Definition qcustomplot.cpp:7431
QCPAxisTickerText()
Definition qcustomplot.cpp:7231
QMap< double, QString > & ticks()
Definition qcustomplot.h:1946
Specialized axis ticker for time spans in units of milliseconds to days.
Definition qcustomplot.h:1847
QCPAxisTickerTime()
Definition qcustomplot.cpp:6883
TimeUnit
Definition qcustomplot.h:1855
@ tuSeconds
Seconds (%s in setTimeFormat)
Definition qcustomplot.h:1856
@ tuMinutes
Minutes (%m in setTimeFormat)
Definition qcustomplot.h:1857
@ tuMilliseconds
Milliseconds, one thousandth of a second (%z in setTimeFormat)
Definition qcustomplot.h:1855
@ tuHours
Hours (%h in setTimeFormat)
Definition qcustomplot.h:1858
@ tuDays
Days (%d in setTimeFormat)
Definition qcustomplot.h:1859
The base class tick generator used by QCPAxis to create tick positions and tick labels.
Definition qcustomplot.h:1733
QCPAxisTicker()
Definition qcustomplot.cpp:6123
TickStepStrategy
Definition qcustomplot.h:1742
@ tssMeetTickCount
Less readable tick steps are allowed which in turn facilitates getting closer to the requested tick c...
Definition qcustomplot.h:1744
@ tssReadability
A nicely readable tick step is prioritized over matching the requested number of ticks (see setTickCo...
Definition qcustomplot.h:1743
Manages a single axis inside a QCustomPlot.
Definition qcustomplot.h:2121
void setSelectedLabelFont(const QFont &font)
Definition qcustomplot.cpp:9019
void setOffset(int offset)
Definition qcustomplot.cpp:8995
void setTickLabels(bool show)
Definition qcustomplot.cpp:8600
void rangeChanged(const QCPRange &newRange)
void setLowerEnding(const QCPLineEnding &ending)
Definition qcustomplot.cpp:9088
void setTickLabelSide(LabelSide side)
Definition qcustomplot.cpp:8673
void setTickLabelRotation(double degrees)
Definition qcustomplot.cpp:8657
void setRangeReversed(bool reversed)
Definition qcustomplot.cpp:8553
void setNumberPrecision(int precision)
Definition qcustomplot.cpp:8774
LabelSide
Definition qcustomplot.h:2186
@ lsOutside
Tick labels will be displayed outside the axis rect.
Definition qcustomplot.h:2187
@ lsInside
Tick labels will be displayed inside the axis rect and clipped to the inner axis rect.
Definition qcustomplot.h:2186
void setSelectedSubTickPen(const QPen &pen)
Definition qcustomplot.cpp:9073
void setTickLabelFont(const QFont &font)
Definition qcustomplot.cpp:8629
void setLabel(const QString &str)
Definition qcustomplot.cpp:8945
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
ScaleType
Definition qcustomplot.h:2194
@ stLogarithmic
Logarithmic scaling with correspondingly transformed axis coordinates (possibly also setTicker to a Q...
Definition qcustomplot.h:2195
@ stLinear
Linear scaling.
Definition qcustomplot.h:2194
void setTickLabelColor(const QColor &color)
Definition qcustomplot.cpp:8643
void setTickLengthOut(int outside)
Definition qcustomplot.cpp:8818
void setLabelPadding(int padding)
Definition qcustomplot.cpp:8959
int pixelOrientation() const
Definition qcustomplot.h:2310
void setSubTickLengthOut(int outside)
Definition qcustomplot.cpp:8878
void setTicker(QSharedPointer< QCPAxisTicker > ticker)
Definition qcustomplot.cpp:8571
Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts)
Definition qcustomplot.cpp:8417
void setPadding(int padding)
Definition qcustomplot.cpp:8978
void setSelectedLabelColor(const QColor &color)
Definition qcustomplot.cpp:9043
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:9524
void selectionChanged(const QCPAxis::SelectableParts &parts)
QCPGrid * grid() const
Definition qcustomplot.h:2257
void setUpperEnding(const QCPLineEnding &ending)
Definition qcustomplot.cpp:9103
void setLabelColor(const QColor &color)
Definition qcustomplot.cpp:8936
void setLabelFont(const QFont &font)
Definition qcustomplot.cpp:8922
void setBasePen(const QPen &pen)
Definition qcustomplot.cpp:8892
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:9596
QSharedPointer< QCPAxisTicker > ticker() const
Definition qcustomplot.h:2220
void setSelectedTickPen(const QPen &pen)
Definition qcustomplot.cpp:9063
void setSelectedTickLabelFont(const QFont &font)
Definition qcustomplot.cpp:9005
static Qt::Orientation orientation(AxisType type)
Definition qcustomplot.h:2324
void setSelectedTickLabelColor(const QColor &color)
Definition qcustomplot.cpp:9030
void selectableChanged(const QCPAxis::SelectableParts &parts)
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:9623
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
Qt::Orientation orientation() const
Definition qcustomplot.h:2309
Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts)
Definition qcustomplot.cpp:8441
SelectablePart
Definition qcustomplot.h:2202
@ spTickLabels
Tick labels (numbers) of this axis (as a whole, not individually)
Definition qcustomplot.h:2204
@ spAxisLabel
The axis label.
Definition qcustomplot.h:2205
@ spAxis
The axis backbone and tick marks.
Definition qcustomplot.h:2203
@ spNone
None of the selectable parts.
Definition qcustomplot.h:2202
void setSubTickLengthIn(int inside)
Definition qcustomplot.cpp:8863
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:9562
QCPAxis(QCPAxisRect *parent, AxisType type)
Definition qcustomplot.cpp:8200
void setTicks(bool show)
Definition qcustomplot.cpp:8588
void setTickPen(const QPen &pen)
Definition qcustomplot.cpp:8902
Q_SLOT void setScaleType(QCPAxis::ScaleType type)
Definition qcustomplot.cpp:8369
AxisType
Definition qcustomplot.h:2173
@ atBottom
0x08 Axis is horizontal and on the bottom side of the axis rect
Definition qcustomplot.h:2176
@ atTop
0x04 Axis is horizontal and on the top side of the axis rect
Definition qcustomplot.h:2175
@ atRight
0x02 Axis is vertical and on the right side of the axis rect
Definition qcustomplot.h:2174
@ atLeft
0x01 Axis is vertical and on the left side of the axis rect
Definition qcustomplot.h:2173
void setNumberFormat(const QString &formatCode)
Definition qcustomplot.cpp:8714
void setSelectedBasePen(const QPen &pen)
Definition qcustomplot.cpp:9053
Q_SLOT void setRange(const QCPRange &range)
Definition qcustomplot.cpp:8389
void setSubTickPen(const QPen &pen)
Definition qcustomplot.cpp:8912
void setTickLabelPadding(int padding)
Definition qcustomplot.cpp:8615
void setSubTicks(bool show)
Definition qcustomplot.cpp:8834
void setTickLengthIn(int inside)
Definition qcustomplot.cpp:8803
double sortKey() const
Definition qcustomplot.h:5788
static bool sortKeyIsMainKey()
Definition qcustomplot.h:5790
double mainValue() const
Definition qcustomplot.h:5793
QCPBarsData()
Definition qcustomplot.cpp:24353
double mainKey() const
Definition qcustomplot.h:5792
QCPRange valueRange() const
Definition qcustomplot.h:5795
static QCPBarsData fromSortKey(double sortKey)
Definition qcustomplot.h:5789
Groups multiple QCPBars together so they appear side by side.
Definition qcustomplot.h:5718
void setSpacingType(SpacingType spacingType)
Definition qcustomplot.cpp:24048
int size() const
Definition qcustomplot.h:5751
SpacingType
Definition qcustomplot.h:5731
@ stAbsolute
Bar spacing is in absolute pixels.
Definition qcustomplot.h:5731
@ stPlotCoords
Bar spacing is in key coordinates and thus scales with the key axis range.
Definition qcustomplot.h:5733
@ stAxisRectRatio
Bar spacing is given by a fraction of the axis rect size.
Definition qcustomplot.h:5732
QList< QCPBars * > bars() const
Definition qcustomplot.h:5749
QCPBarsGroup(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:24028
void setSpacing(double spacing)
Definition qcustomplot.cpp:24059
bool isEmpty() const
Definition qcustomplot.h:5752
bool contains(QCPBars *bars) const
Definition qcustomplot.h:5754
A plottable representing a bar chart in a plot.
Definition qcustomplot.h:5814
QCPBars * barBelow() const
Definition qcustomplot.h:5847
void setBaseValue(double baseValue)
Definition qcustomplot.cpp:24556
QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:24443
WidthType
Definition qcustomplot.h:5832
@ wtAxisRectRatio
Bar width is given by a fraction of the axis rect size.
Definition qcustomplot.h:5833
@ wtPlotCoords
Bar width is in key coordinates and thus scales with the key axis range.
Definition qcustomplot.h:5834
@ wtAbsolute
Bar width is in absolute pixels.
Definition qcustomplot.h:5832
QSharedPointer< QCPBarsDataContainer > data() const
Definition qcustomplot.h:5849
QCPBars * barAbove() const
Definition qcustomplot.h:5848
void setWidthType(WidthType widthType)
Definition qcustomplot.cpp:24522
void setStackingGap(double pixels)
Definition qcustomplot.cpp:24566
void setBarsGroup(QCPBarsGroup *barsGroup)
Definition qcustomplot.cpp:24533
void setWidth(double width)
Definition qcustomplot.cpp:24509
Defines a color gradient for use with e.g. QCPColorMap.
Definition qcustomplot.h:4753
QCPColorGradient()
Definition qcustomplot.cpp:16545
ColorInterpolation
Definition qcustomplot.h:4761
@ ciRGB
Color channels red, green and blue are linearly interpolated.
Definition qcustomplot.h:4761
@ ciHSV
Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the ...
Definition qcustomplot.h:4762
GradientPreset
Definition qcustomplot.h:4783
@ gpNight
Continuous lightness from black over weak blueish colors to white (suited for non-biased data represe...
Definition qcustomplot.h:4786
@ gpHues
Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and pha...
Definition qcustomplot.h:4794
@ gpGeography
Colors suitable to represent different elevations on geographical maps.
Definition qcustomplot.h:4788
@ gpIon
Half hue spectrum from black over purple to blue and finally green (creates banding illusion but allo...
Definition qcustomplot.h:4789
@ gpHot
Continuous lightness from black over firey colors to white (suited for non-biased data representation...
Definition qcustomplot.h:4784
@ gpJet
Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion ...
Definition qcustomplot.h:4793
@ gpCandy
Blue over pink to white.
Definition qcustomplot.h:4787
@ gpPolar
Colors suitable to emphasize polarity around the center, with blue for negative, black in the middle ...
Definition qcustomplot.h:4791
@ gpSpectrum
An approximation of the visible light spectrum (creates banding illusion but allows more precise magn...
Definition qcustomplot.h:4792
@ gpGrayscale
Continuous lightness from black to white (suited for non-biased data representation)
Definition qcustomplot.h:4783
@ gpCold
Continuous lightness from black over icey colors to white (suited for non-biased data representation)
Definition qcustomplot.h:4785
@ gpThermal
Colors suitable for thermal imaging, ranging from dark blue over purple to orange,...
Definition qcustomplot.h:4790
NanHandling
Definition qcustomplot.h:4771
@ nhHighestColor
NaN data points appear as the highest color defined in this QCPColorGradient.
Definition qcustomplot.h:4773
@ nhTransparent
NaN data points appear transparent.
Definition qcustomplot.h:4774
@ nhLowestColor
NaN data points appear as the lowest color defined in this QCPColorGradient.
Definition qcustomplot.h:4772
@ nhNone
NaN data points are not explicitly handled and shouldn't occur in the data (this gives slight perform...
Definition qcustomplot.h:4771
@ nhNanColor
NaN data points appear as the color defined with setNanColor.
Definition qcustomplot.h:4775
Holds the two-dimensional data of a QCPColorMap plottable.
Definition qcustomplot.h:6023
void setKeyRange(const QCPRange &keyRange)
Definition qcustomplot.cpp:26045
void setValueSize(int valueSize)
Definition qcustomplot.cpp:26014
void setSize(int keySize, int valueSize)
Definition qcustomplot.cpp:25958
void clearAlpha()
Definition qcustomplot.cpp:26190
void fill(double z)
Definition qcustomplot.cpp:26203
unsigned char alpha(int keyIndex, int valueIndex)
Definition qcustomplot.cpp:25938
void setCell(int keyIndex, int valueIndex, double z)
Definition qcustomplot.cpp:26103
void fillAlpha(unsigned char alpha)
Definition qcustomplot.cpp:26220
void clear()
Definition qcustomplot.cpp:26182
QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange, const QCPRange &valueRange)
Definition qcustomplot.cpp:25848
void setRange(const QCPRange &keyRange, const QCPRange &valueRange)
Definition qcustomplot.cpp:26029
void setAlpha(int keyIndex, int valueIndex, unsigned char alpha)
Definition qcustomplot.cpp:26132
void recalculateDataBounds()
Definition qcustomplot.cpp:26158
void setKeySize(int keySize)
Definition qcustomplot.cpp:25999
void setValueRange(const QCPRange &valueRange)
Definition qcustomplot.cpp:26060
bool isEmpty() const
Definition qcustomplot.h:6057
void setData(double key, double value, double z)
Definition qcustomplot.cpp:26077
QCPColorMapData & operator=(const QCPColorMapData &other)
Definition qcustomplot.cpp:25886
A plottable representing a two-dimensional color map in a plot.
Definition qcustomplot.h:6080
QCPColorMapData * data() const
Definition qcustomplot.h:6095
void gradientChanged(const QCPColorGradient &newGradient)
void setInterpolate(bool enabled)
Definition qcustomplot.cpp:26548
Q_SLOT void setGradient(const QCPColorGradient &gradient)
Definition qcustomplot.cpp:26532
void dataRangeChanged(const QCPRange &newRange)
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
Q_SLOT void setDataRange(const QCPRange &dataRange)
Definition qcustomplot.cpp:26490
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
Definition qcustomplot.cpp:26509
QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:26441
void setColorScale(QCPColorScale *colorScale)
Definition qcustomplot.cpp:26584
void setTightBoundary(bool enabled)
Definition qcustomplot.cpp:26565
QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale)
Definition qcustomplot.cpp:20569
A color scale for use with color coding data such as QCPColorMap.
Definition qcustomplot.h:5381
void setType(QCPAxis::AxisType type)
Definition qcustomplot.cpp:20192
Q_SLOT void setGradient(const QCPColorGradient &gradient)
Definition qcustomplot.cpp:20296
void setRangeDrag(bool enabled)
Definition qcustomplot.cpp:20337
QCPAxis * axis() const
Definition qcustomplot.h:5398
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:20519
void gradientChanged(const QCPColorGradient &newGradient)
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:20541
void dataRangeChanged(const QCPRange &newRange)
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:20530
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:20508
void setRangeZoom(bool enabled)
Definition qcustomplot.cpp:20364
QCPColorScale(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:20127
void setBarWidth(int width)
Definition qcustomplot.cpp:20326
Q_SLOT void setDataRange(const QCPRange &dataRange)
Definition qcustomplot.cpp:20246
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
Definition qcustomplot.cpp:20276
void setLabel(const QString &str)
Definition qcustomplot.cpp:20311
static bool sortKeyIsMainKey()
Definition qcustomplot.h:5610
double mainValue() const
Definition qcustomplot.h:5613
static QCPCurveData fromSortKey(double sortKey)
Definition qcustomplot.h:5609
QCPCurveData()
Definition qcustomplot.cpp:22574
double sortKey() const
Definition qcustomplot.h:5608
double mainKey() const
Definition qcustomplot.h:5612
QCPRange valueRange() const
Definition qcustomplot.h:5615
A plottable representing a parametric curve in a plot.
Definition qcustomplot.h:5635
LineStyle
Definition qcustomplot.h:5648
@ lsLine
Data points are connected with a straight line.
Definition qcustomplot.h:5649
@ lsNone
No line is drawn between data points (e.g. only scatters)
Definition qcustomplot.h:5648
QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:22653
void setLineStyle(LineStyle style)
Definition qcustomplot.cpp:22761
void setScatterStyle(const QCPScatterStyle &style)
Definition qcustomplot.cpp:22733
QSharedPointer< QCPCurveDataContainer > data() const
Definition qcustomplot.h:5657
void setScatterSkip(int skip)
Definition qcustomplot.cpp:22749
The generic data container for one-dimensional plottables.
Definition qcustomplot.h:2614
void setAutoSqueeze(bool enabled)
Definition qcustomplot.h:2822
const_iterator findBegin(double sortKey, bool expandedRange=true) const
Definition qcustomplot.h:3105
void remove(double sortKey)
Definition qcustomplot.h:3018
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
Definition qcustomplot.h:3284
iterator end()
Definition qcustomplot.h:2646
void add(const QCPDataContainer< DataType > &data)
Definition qcustomplot.h:2871
void add(const QVector< DataType > &data, bool alreadySorted=false)
Definition qcustomplot.h:2903
iterator begin()
Definition qcustomplot.h:2645
void add(const DataType &data)
Definition qcustomplot.h:2940
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
Definition qcustomplot.h:2610
void sort()
Definition qcustomplot.h:3057
bool isEmpty() const
Definition qcustomplot.h:2623
void clear()
Definition qcustomplot.h:3038
void squeeze(bool preAllocation=true, bool postAllocation=true)
Definition qcustomplot.h:3073
int size() const
Definition qcustomplot.h:2622
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
Definition qcustomplot.h:3372
const_iterator constEnd() const
Definition qcustomplot.h:2644
void removeBefore(double sortKey)
Definition qcustomplot.h:2964
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
Definition qcustomplot.h:3159
void removeAfter(double sortKey)
Definition qcustomplot.h:2979
const_iterator at(int index) const
Definition qcustomplot.h:2649
void remove(double sortKeyFrom, double sortKeyTo)
Definition qcustomplot.h:2996
void set(const QCPDataContainer< DataType > &data)
Definition qcustomplot.h:2839
QCPDataRange dataRange() const
Definition qcustomplot.h:2652
QCPDataContainer()
Definition qcustomplot.h:2806
const_iterator findEnd(double sortKey, bool expandedRange=true) const
Definition qcustomplot.h:3132
const_iterator constBegin() const
Definition qcustomplot.h:2643
void set(const QVector< DataType > &data, bool alreadySorted=false)
Definition qcustomplot.h:2855
Describes a data range given by begin and end index.
Definition qcustomplot.h:950
int length() const
Definition qcustomplot.h:962
void setEnd(int end)
Definition qcustomplot.h:966
QCPDataRange adjusted(int changeBegin, int changeEnd) const
Definition qcustomplot.h:974
QCPDataRange()
Definition qcustomplot.cpp:2257
void setBegin(int begin)
Definition qcustomplot.h:965
QCPDataRange bounded(const QCPDataRange &other) const
Definition qcustomplot.cpp:2283
bool isValid() const
Definition qcustomplot.h:969
bool isEmpty() const
Definition qcustomplot.h:970
int size() const
Definition qcustomplot.h:961
Describes a data set by holding multiple QCPDataRange instances.
Definition qcustomplot.h:987
QCPDataSelection()
Definition qcustomplot.cpp:2415
friend const QCPDataSelection operator-(const QCPDataSelection &a, const QCPDataSelection &b)
Definition qcustomplot.h:1081
QCPDataSelection & operator+=(const QCPDataSelection &other)
Definition qcustomplot.cpp:2450
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
Definition qcustomplot.cpp:2574
friend const QCPDataSelection operator+(const QCPDataSelection &a, const QCPDataSelection &b)
Definition qcustomplot.h:1038
void simplify()
Definition qcustomplot.cpp:2600
bool operator==(const QCPDataSelection &other) const
Definition qcustomplot.cpp:2434
QCPDataSelection & operator-=(const QCPDataSelection &other)
Definition qcustomplot.cpp:2470
QCPDataRange dataRange(int index=0) const
Definition qcustomplot.cpp:2544
bool isEmpty() const
Definition qcustomplot.h:1017
int dataRangeCount() const
Definition qcustomplot.h:1008
QList< QCPDataRange > dataRanges() const
Definition qcustomplot.h:1011
QCPDataSelection inverse(const QCPDataRange &outerRange) const
Definition qcustomplot.cpp:2739
Holds the data of one single error bar for QCPErrorBars.
Definition qcustomplot.h:6298
QCPErrorBarsData()
Definition qcustomplot.cpp:27909
A plottable that adds a set of error bars to other plottables.
Definition qcustomplot.h:6327
void setSymbolGap(double pixels)
Definition qcustomplot.cpp:28116
QCPErrorBars(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:27992
void setData(QSharedPointer< QCPErrorBarsDataContainer > data)
Definition qcustomplot.cpp:28025
ErrorType
Definition qcustomplot.h:6344
@ etValueError
The errors are for the value dimension (bars appear parallel to the value axis)
Definition qcustomplot.h:6345
@ etKeyError
The errors are for the key dimension (bars appear parallel to the key axis)
Definition qcustomplot.h:6344
void setDataPlottable(QCPAbstractPlottable *plottable)
Definition qcustomplot.cpp:28075
void setWhiskerWidth(double pixels)
Definition qcustomplot.cpp:28106
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
Definition qcustomplot.h:6387
QSharedPointer< QCPErrorBarsDataContainer > data() const
Definition qcustomplot.h:6352
void setErrorType(ErrorType type)
Definition qcustomplot.cpp:28097
QCPRange valueRange() const
Definition qcustomplot.h:6171
QCPFinancialData()
Definition qcustomplot.cpp:27002
static bool sortKeyIsMainKey()
Definition qcustomplot.h:6166
static QCPFinancialData fromSortKey(double sortKey)
Definition qcustomplot.h:6165
double mainValue() const
Definition qcustomplot.h:6169
double sortKey() const
Definition qcustomplot.h:6164
double mainKey() const
Definition qcustomplot.h:6168
A plottable representing a financial stock chart.
Definition qcustomplot.h:6190
ChartStyle
Definition qcustomplot.h:6220
@ csOhlc
Open-High-Low-Close bar representation.
Definition qcustomplot.h:6220
@ csCandlestick
Candlestick representation.
Definition qcustomplot.h:6221
void setTwoColored(bool twoColored)
Definition qcustomplot.cpp:27193
void setWidthType(WidthType widthType)
Definition qcustomplot.cpp:27179
QCPFinancial(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:27098
void setChartStyle(ChartStyle style)
Definition qcustomplot.cpp:27156
void setBrushPositive(const QBrush &brush)
Definition qcustomplot.cpp:27207
void setBrushNegative(const QBrush &brush)
Definition qcustomplot.cpp:27221
void setWidth(double width)
Definition qcustomplot.cpp:27166
QSharedPointer< QCPFinancialDataContainer > data() const
Definition qcustomplot.h:6229
void setPenPositive(const QPen &pen)
Definition qcustomplot.cpp:27235
WidthType
Definition qcustomplot.h:6209
@ wtAbsolute
width is in absolute pixels
Definition qcustomplot.h:6209
@ wtAxisRectRatio
width is given by a fraction of the axis rect size
Definition qcustomplot.h:6210
@ wtPlotCoords
width is in key coordinates and thus scales with the key axis range
Definition qcustomplot.h:6211
void setPenNegative(const QPen &pen)
Definition qcustomplot.cpp:27249
double mainValue() const
Definition qcustomplot.h:5474
QCPRange valueRange() const
Definition qcustomplot.h:5476
static QCPGraphData fromSortKey(double sortKey)
Definition qcustomplot.h:5470
double sortKey() const
Definition qcustomplot.h:5469
static bool sortKeyIsMainKey()
Definition qcustomplot.h:5471
double mainKey() const
Definition qcustomplot.h:5473
QCPGraphData()
Definition qcustomplot.cpp:20798
A plottable representing a graph in a plot.
Definition qcustomplot.h:5495
QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:20879
void setScatterStyle(const QCPScatterStyle &style)
Definition qcustomplot.cpp:20955
QSharedPointer< QCPGraphDataContainer > data() const
Definition qcustomplot.h:5524
void setScatterSkip(int skip)
Definition qcustomplot.cpp:20971
void setChannelFillGraph(QCPGraph *targetGraph)
Definition qcustomplot.cpp:20985
void setLineStyle(LineStyle ls)
Definition qcustomplot.cpp:20944
void setAdaptiveSampling(bool enabled)
Definition qcustomplot.cpp:21036
LineStyle
Definition qcustomplot.h:5510
@ lsLine
data points are connected by a straight line
Definition qcustomplot.h:5512
@ lsStepCenter
line is drawn as steps where the step is in between two data points
Definition qcustomplot.h:5515
@ lsStepRight
line is drawn as steps where the step height is the value of the right data point
Definition qcustomplot.h:5514
@ lsImpulse
each data point is represented by a line parallel to the value axis, which reaches from the data poin...
Definition qcustomplot.h:5516
@ lsStepLeft
line is drawn as steps where the step height is the value of the left data point
Definition qcustomplot.h:5513
@ lsNone
Definition qcustomplot.h:5510
void setZeroLinePen(const QPen &pen)
Definition qcustomplot.cpp:7925
void setAntialiasedZeroLine(bool enabled)
Definition qcustomplot.cpp:7898
void setAntialiasedSubGrid(bool enabled)
Definition qcustomplot.cpp:7890
void setSubGridPen(const QPen &pen)
Definition qcustomplot.cpp:7914
void setPen(const QPen &pen)
Definition qcustomplot.cpp:7906
QCPGrid(QCPAxis *parentAxis)
Definition qcustomplot.cpp:7859
void setSubGridVisible(bool visible)
Definition qcustomplot.cpp:7882
An anchor of an item to which positions can be attached to.
Definition qcustomplot.h:3606
virtual QPointF pixelPosition() const
Definition qcustomplot.cpp:12071
QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString &name, int anchorId=-1)
Definition qcustomplot.cpp:12042
virtual QCPItemPosition * toQCPItemPosition()
Definition qcustomplot.h:3627
A bracket for referencing/highlighting certain parts in the plot.
Definition qcustomplot.h:6940
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:30838
QCPItemBracket(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:30800
void setStyle(BracketStyle style)
Definition qcustomplot.cpp:30861
BracketStyle
Definition qcustomplot.h:6955
@ bsRound
A brace with round edges.
Definition qcustomplot.h:6956
@ bsCurly
A curly brace.
Definition qcustomplot.h:6957
@ bsSquare
A brace with angled edges.
Definition qcustomplot.h:6955
@ bsCalligraphic
A curly brace with varying stroke width giving a calligraphic impression.
Definition qcustomplot.h:6958
void setPen(const QPen &pen)
Definition qcustomplot.cpp:30828
void setLength(double length)
Definition qcustomplot.cpp:30851
void setPen(const QPen &pen)
Definition qcustomplot.cpp:29319
void setHead(const QCPLineEnding &head)
Definition qcustomplot.cpp:29342
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:29329
void setTail(const QCPLineEnding &tail)
Definition qcustomplot.cpp:29355
QCPItemCurve(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:29294
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:29361
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:30029
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:30012
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:30001
QCPItemEllipse(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:29959
void setSelectedBrush(const QBrush &brush)
Definition qcustomplot.cpp:30023
void setPen(const QPen &pen)
Definition qcustomplot.cpp:29991
QCPItemLine(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:29056
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:29087
void setPen(const QPen &pen)
Definition qcustomplot.cpp:29077
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:29119
void setTail(const QCPLineEnding &tail)
Definition qcustomplot.cpp:29113
void setHead(const QCPLineEnding &head)
Definition qcustomplot.cpp:29100
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:30224
void setPixmap(const QPixmap &pixmap)
Definition qcustomplot.cpp:30183
QCPItemPixmap(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:30154
void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation)
Definition qcustomplot.cpp:30195
void setPen(const QPen &pen)
Definition qcustomplot.cpp:30208
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:30218
Manages the position of an item.
Definition qcustomplot.h:3644
QCPItemAnchor * parentAnchor() const
Definition qcustomplot.h:3671
virtual QCPItemPosition * toQCPItemPosition() Q_DECL_OVERRIDE
Definition qcustomplot.h:3704
QCPItemPosition(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString &name)
Definition qcustomplot.cpp:12216
PositionType
Definition qcustomplot.h:3653
@ ptAxisRectRatio
Definition qcustomplot.h:3657
@ ptAbsolute
Static positioning in pixels, starting from the top left corner of the viewport/widget.
Definition qcustomplot.h:3653
@ ptViewportRatio
Definition qcustomplot.h:3654
@ ptPlotCoords
Dynamic positioning at a plot coordinate defined by two axes (see setAxes).
Definition qcustomplot.h:3660
PositionType type() const
Definition qcustomplot.h:3668
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:29521
QCPItemRect(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:29454
void setPen(const QPen &pen)
Definition qcustomplot.cpp:29483
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:29493
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:29504
void setSelectedBrush(const QBrush &brush)
Definition qcustomplot.cpp:29515
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:28910
QCPItemStraightLine(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:28873
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:28904
void setPen(const QPen &pen)
Definition qcustomplot.cpp:28894
void setSelectedFont(const QFont &font)
Definition qcustomplot.cpp:29722
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:29691
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:29680
void setText(const QString &text)
Definition qcustomplot.cpp:29733
void setRotation(double degrees)
Definition qcustomplot.cpp:29767
void setSelectedBrush(const QBrush &brush)
Definition qcustomplot.cpp:29702
QCPItemText(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:29617
void setPositionAlignment(Qt::Alignment alignment)
Definition qcustomplot.cpp:29750
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:29782
void setFont(const QFont &font)
Definition qcustomplot.cpp:29712
void setPen(const QPen &pen)
Definition qcustomplot.cpp:29669
void setColor(const QColor &color)
Definition qcustomplot.cpp:29650
void setTextAlignment(Qt::Alignment alignment)
Definition qcustomplot.cpp:29758
void setSelectedColor(const QColor &color)
Definition qcustomplot.cpp:29658
void setPadding(const QMargins &padding)
Definition qcustomplot.cpp:29776
Item that sticks to QCPGraph data points.
Definition qcustomplot.h:6854
void setSelectedBrush(const QBrush &brush)
Definition qcustomplot.cpp:30496
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:30486
TracerStyle
Definition qcustomplot.h:6873
@ tsPlus
A plus shaped crosshair with limited size.
Definition qcustomplot.h:6874
@ tsSquare
A square.
Definition qcustomplot.h:6877
@ tsNone
The tracer is not visible.
Definition qcustomplot.h:6873
@ tsCircle
A circle.
Definition qcustomplot.h:6876
@ tsCrosshair
A plus shaped crosshair which spans the complete axis rect.
Definition qcustomplot.h:6875
void setStyle(TracerStyle style)
Definition qcustomplot.cpp:30516
void setGraphKey(double key)
Definition qcustomplot.cpp:30558
void setInterpolating(bool enabled)
Definition qcustomplot.cpp:30574
QCPItemTracer(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:30440
void setSelectedPen(const QPen &pen)
Definition qcustomplot.cpp:30476
void setSize(double size)
Definition qcustomplot.cpp:30505
void setGraph(QCPGraph *graph)
Definition qcustomplot.cpp:30531
void setPen(const QPen &pen)
Definition qcustomplot.cpp:30466
Definition qcustomplot.h:1593
QCPLabelPainterPrivate(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:5484
AnchorReferenceType
Definition qcustomplot.h:1608
AnchorSide
Definition qcustomplot.h:1616
AnchorMode
Definition qcustomplot.h:1599
A layer that may contain objects, to control the rendering order.
Definition qcustomplot.h:683
QList< QCPLayerable * > children() const
Definition qcustomplot.h:714
QCPLayer(QCustomPlot *parentPlot, const QString &layerName)
Definition qcustomplot.cpp:1067
LayerMode
Definition qcustomplot.h:702
@ lmLogical
Layer is used only for rendering order, and shares paint buffer with all other adjacent logical layer...
Definition qcustomplot.h:702
@ lmBuffered
Layer has its own paint buffer and may be replotted individually (see replot).
Definition qcustomplot.h:703
void setMode(LayerMode mode)
Definition qcustomplot.cpp:1127
void setVisible(bool visible)
Definition qcustomplot.cpp:1101
int index() const
Definition qcustomplot.h:713
Base class for all drawable objects.
Definition qcustomplot.h:752
void setVisible(bool on)
Definition qcustomplot.cpp:1397
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details)
Definition qcustomplot.cpp:1808
virtual void wheelEvent(QWheelEvent *event)
Definition qcustomplot.cpp:1831
QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr)
Definition qcustomplot.cpp:1366
void setAntialiased(bool enabled)
Definition qcustomplot.cpp:1444
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
Definition qcustomplot.cpp:1758
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
Definition qcustomplot.cpp:1776
QCPLayerable * parentLayerable() const
Definition qcustomplot.h:768
Q_SLOT bool setLayer(QCPLayer *layer)
Definition qcustomplot.cpp:1411
void layerChanged(QCPLayer *newLayer)
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
Definition qcustomplot.cpp:1740
The abstract base class for all objects that form the layout system.
Definition qcustomplot.h:1239
void setMinimumMargins(const QMargins &margins)
Definition qcustomplot.cpp:3278
SizeConstraintRect
Definition qcustomplot.h:1270
@ scrInnerRect
Minimum/Maximum size constraints apply to inner rect.
Definition qcustomplot.h:1270
@ scrOuterRect
Minimum/Maximum size constraints apply to outer rect, thus include layout element margins.
Definition qcustomplot.h:1271
UpdatePhase
Definition qcustomplot.h:1256
@ upMargins
Phase in which the margins are calculated and set.
Definition qcustomplot.h:1257
@ upLayout
Final phase in which the layout system places the rects of the elements.
Definition qcustomplot.h:1258
@ upPreparation
Phase used for any type of preparation that needs to be done before margin calculation and layout.
Definition qcustomplot.h:1256
QRect rect() const
Definition qcustomplot.h:1280
QRect outerRect() const
Definition qcustomplot.h:1281
QCPLayoutElement(QCustomPlot *parentPlot=nullptr)
Definition qcustomplot.cpp:3207
void setSizeConstraintRect(SizeConstraintRect constraintRect)
Definition qcustomplot.cpp:3373
void setOuterRect(const QRect &rect)
Definition qcustomplot.cpp:3240
QCPLayout * layout() const
Definition qcustomplot.h:1279
void setMinimumSize(const QSize &size)
Definition qcustomplot.cpp:3313
void setMaximumSize(const QSize &size)
Definition qcustomplot.cpp:3342
void setMargins(const QMargins &margins)
Definition qcustomplot.cpp:3260
A layout that arranges child elements in a grid.
Definition qcustomplot.h:1382
int rowCount() const
Definition qcustomplot.h:1412
int columnCount() const
Definition qcustomplot.h:1413
void setRowStretchFactors(const QList< double > &factors)
Definition qcustomplot.cpp:4318
void setColumnSpacing(int pixels)
Definition qcustomplot.cpp:4340
void setColumnStretchFactors(const QList< double > &factors)
Definition qcustomplot.cpp:4265
FillOrder
Definition qcustomplot.h:1403
@ foRowsFirst
Rows are filled first, and a new element is wrapped to the next column if the row count would exceed ...
Definition qcustomplot.h:1403
@ foColumnsFirst
Columns are filled first, and a new element is wrapped to the next row if the column count would exce...
Definition qcustomplot.h:1404
virtual int elementCount() const Q_DECL_OVERRIDE
Definition qcustomplot.h:1433
void setRowSpacing(int pixels)
Definition qcustomplot.cpp:4350
QCPLayoutGrid()
Definition qcustomplot.cpp:4104
void setWrap(int count)
Definition qcustomplot.cpp:4372
void setFillOrder(FillOrder order, bool rearrange=true)
Definition qcustomplot.cpp:4402
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition qcustomplot.h:1473
QCPLayoutInset()
Definition qcustomplot.cpp:4887
InsetPlacement
Definition qcustomplot.h:1479
@ ipFree
The element may be positioned/sized arbitrarily, see setInsetRect.
Definition qcustomplot.h:1479
@ ipBorderAligned
The element is aligned to one of the layout sides, see setInsetAlignment.
Definition qcustomplot.h:1480
virtual void simplify() Q_DECL_OVERRIDE
Definition qcustomplot.h:1503
The abstract base class for layouts.
Definition qcustomplot.h:1342
void clear()
Definition qcustomplot.cpp:3776
QCPLayout()
Definition qcustomplot.cpp:3666
bool removeAt(int index)
Definition qcustomplot.cpp:3739
virtual void simplify()
Definition qcustomplot.cpp:3724
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:3679
bool remove(QCPLayoutElement *element)
Definition qcustomplot.cpp:3760
virtual QCPLayoutElement * takeAt(int index)=0
virtual QCPLayoutElement * elementAt(int index) const =0
virtual QList< QCPLayoutElement * > elements(bool recursive) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:3697
virtual int elementCount() const =0
virtual bool take(QCPLayoutElement *element)=0
void sizeConstraintsChanged() const
Definition qcustomplot.cpp:3794
Manages a legend inside a QCustomPlot.
Definition qcustomplot.h:5139
QCPLegend()
Definition qcustomplot.cpp:19073
Q_SLOT void setSelectedParts(const SelectableParts &selectedParts)
Definition qcustomplot.cpp:19258
void setSelectedBorderPen(const QPen &pen)
Definition qcustomplot.cpp:19289
void setIconBorderPen(const QPen &pen)
Definition qcustomplot.cpp:19213
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:19137
SelectablePart
Definition qcustomplot.h:5163
@ spLegendBox
0x001 The legend box (frame)
Definition qcustomplot.h:5164
@ spNone
0x000 None
Definition qcustomplot.h:5163
@ spItems
0x002 Legend items individually (see selectedItems)
Definition qcustomplot.h:5165
void setIconTextPadding(int padding)
Definition qcustomplot.cpp:19202
void setSelectedTextColor(const QColor &color)
Definition qcustomplot.cpp:19339
void selectionChanged(QCPLegend::SelectableParts parts)
void setBorderPen(const QPen &pen)
Definition qcustomplot.cpp:19129
void setSelectedBrush(const QBrush &brush)
Definition qcustomplot.cpp:19310
void setIconSize(const QSize &size)
Definition qcustomplot.cpp:19184
Q_SLOT void setSelectableParts(const SelectableParts &selectableParts)
Definition qcustomplot.cpp:19228
void setFont(const QFont &font)
Definition qcustomplot.cpp:19151
void setSelectedFont(const QFont &font)
Definition qcustomplot.cpp:19322
void setSelectedIconBorderPen(const QPen &pen)
Definition qcustomplot.cpp:19299
void setTextColor(const QColor &color)
Definition qcustomplot.cpp:19170
Handles the different ending decorations for line-like items.
Definition qcustomplot.h:1529
EndingStyle
Definition qcustomplot.h:1543
@ esHalfBar
A bar perpendicular to the line, pointing out to only one side (to which side can be changed with set...
Definition qcustomplot.h:1551
@ esSkewedBar
A bar that is skewed (skew controllable via setLength)
Definition qcustomplot.h:1552
@ esBar
A bar perpendicular to the line.
Definition qcustomplot.h:1550
@ esDiamond
A filled diamond (45 degrees rotated square)
Definition qcustomplot.h:1549
@ esFlatArrow
A filled arrow head with a straight/flat back (a triangle)
Definition qcustomplot.h:1544
@ esLineArrow
A non-filled arrow head with open back.
Definition qcustomplot.h:1546
@ esSpikeArrow
A filled arrow head with an indented back.
Definition qcustomplot.h:1545
@ esNone
No ending decoration.
Definition qcustomplot.h:1543
@ esSquare
A filled square.
Definition qcustomplot.h:1548
@ esDisc
A filled circle.
Definition qcustomplot.h:1547
QCPLineEnding()
Definition qcustomplot.cpp:5193
A margin group allows synchronization of margin sides if working with multiple layout elements.
Definition qcustomplot.h:1208
QCPMarginGroup(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:3041
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition qcustomplot.h:1215
void clear(const QColor &color) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:697
virtual QCPPainter * startPainting() Q_DECL_OVERRIDE
Definition qcustomplot.cpp:678
virtual void reallocateBuffer() Q_DECL_OVERRIDE
Definition qcustomplot.cpp:703
QCPPaintBufferPixmap(const QSize &size, double devicePixelRatio)
Definition qcustomplot.cpp:667
virtual void draw(QCPPainter *painter) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:688
QPainter subclass used internally.
Definition qcustomplot.h:516
void drawLine(const QLineF &line)
Definition qcustomplot.cpp:371
PainterMode
Definition qcustomplot.h:523
@ pmDefault
0x00 Default mode for painting on screen devices
Definition qcustomplot.h:523
@ pmNonCosmetic
0x04 Turns pen widths 0 to 1, i.e. disables cosmetic pens. (A cosmetic pen is always drawn with width...
Definition qcustomplot.h:526
@ pmNoCaching
0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixma...
Definition qcustomplot.h:525
@ pmVectorized
0x01 Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fix...
Definition qcustomplot.h:524
QCPPainter()
Definition qcustomplot.cpp:297
void setPen(const QPen &pen)
Definition qcustomplot.cpp:328
Defines an abstract interface for one-dimensional plottables.
Definition qcustomplot.h:4161
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const =0
virtual double dataMainValue(int index) const =0
virtual int findEnd(double sortKey, bool expandedRange=true) const =0
virtual QPointF dataPixelPosition(int index) const =0
virtual double dataMainKey(int index) const =0
virtual double dataSortKey(int index) const =0
virtual int findBegin(double sortKey, bool expandedRange=true) const =0
virtual bool sortKeyIsMainKey() const =0
virtual int dataCount() const =0
virtual QCPRange dataValueRange(int index) const =0
virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:19002
QCPPlottableLegendItem(QCPLegend *parent, QCPAbstractPlottable *plottable)
Definition qcustomplot.cpp:18926
The main container for polar plots, representing the angular axis as a circle.
Definition qcustomplot.h:7259
int height() const
Definition qcustomplot.h:7419
QSize size() const
Definition qcustomplot.h:7420
QPointF center() const
Definition qcustomplot.h:7425
int left() const
Definition qcustomplot.h:7414
SelectablePart
Definition qcustomplot.h:7269
@ spTickLabels
Tick labels (numbers) of this axis (as a whole, not individually)
Definition qcustomplot.h:7271
@ spNone
None of the selectable parts.
Definition qcustomplot.h:7269
@ spAxis
The axis backbone and tick marks.
Definition qcustomplot.h:7270
@ spAxisLabel
The axis label.
Definition qcustomplot.h:7272
QPoint topRight() const
Definition qcustomplot.h:7422
QPoint topLeft() const
Definition qcustomplot.h:7421
QPoint bottomLeft() const
Definition qcustomplot.h:7423
int bottom() const
Definition qcustomplot.h:7417
QCPLayoutInset * insetLayout() const
Definition qcustomplot.h:7400
int right() const
Definition qcustomplot.h:7415
int width() const
Definition qcustomplot.h:7418
int top() const
Definition qcustomplot.h:7416
LabelMode
Definition qcustomplot.h:7281
QPoint bottomRight() const
Definition qcustomplot.h:7424
QCPPolarAxisAngular(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:32572
The radial axis inside a radial plot.
Definition qcustomplot.h:7008
QSharedPointer< QCPAxisTicker > ticker() const
Definition qcustomplot.h:7061
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:32179
ScaleType
Definition qcustomplot.h:7025
@ stLogarithmic
Logarithmic scaling with correspondingly transformed axis coordinates (possibly also setTicker to a Q...
Definition qcustomplot.h:7026
@ stLinear
Linear scaling.
Definition qcustomplot.h:7025
AngleReference
Definition qcustomplot.h:7017
@ arAngularAxis
The axis tilt is measured in the angular coordinate system given by the parent angular axis.
Definition qcustomplot.h:7018
@ arAbsolute
The axis tilt is given in absolute degrees. The zero is to the right and positive angles are measured...
Definition qcustomplot.h:7017
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:32253
void selectionChanged(const QCPPolarAxisRadial::SelectableParts &parts)
void scaleTypeChanged(QCPPolarAxisRadial::ScaleType scaleType)
void rangeChanged(const QCPRange &newRange)
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:32280
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:32215
QCPPolarAxisRadial(QCPPolarAxisAngular *parent)
Definition qcustomplot.cpp:31097
void selectableChanged(const QCPPolarAxisRadial::SelectableParts &parts)
SelectablePart
Definition qcustomplot.h:7033
@ spTickLabels
Tick labels (numbers) of this axis (as a whole, not individually)
Definition qcustomplot.h:7035
@ spAxis
The axis backbone and tick marks.
Definition qcustomplot.h:7034
@ spNone
None of the selectable parts.
Definition qcustomplot.h:7033
@ spAxisLabel
The axis label.
Definition qcustomplot.h:7036
A radial graph used to display data in polar plots.
Definition qcustomplot.h:7637
LineStyle
Definition qcustomplot.h:7648
@ lsNone
Definition qcustomplot.h:7648
@ lsLine
data points are connected by a straight line
Definition qcustomplot.h:7650
QCPPolarGraph(QCPPolarAxisAngular *keyAxis, QCPPolarAxisRadial *valueAxis)
Definition qcustomplot.cpp:34456
The grid in both angular and radial dimensions for polar plots.
Definition qcustomplot.h:7532
QCPPolarGrid(QCPPolarAxisAngular *parentAxis)
Definition qcustomplot.cpp:34180
GridType
Definition qcustomplot.h:7541
virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:34395
Represents the range an axis is encompassing.
Definition qcustomplot.h:832
void expand(const QCPRange &otherRange)
Definition qcustomplot.cpp:1959
friend const QCPRange operator/(const QCPRange &range, double value)
Definition qcustomplot.h:936
friend const QCPRange operator*(const QCPRange &range, double value)
Definition qcustomplot.h:916
static const double maxRange
Definition qcustomplot.h:868
QCPRange & operator/=(const double &value)
Definition qcustomplot.h:845
double size() const
Definition qcustomplot.h:853
QCPRange & operator*=(const double &value)
Definition qcustomplot.h:844
friend const QCPRange operator-(const QCPRange &range, double value)
Definition qcustomplot.h:906
QCPRange & operator-=(const double &value)
Definition qcustomplot.h:843
static const double minRange
Definition qcustomplot.h:867
QCPRange()
Definition qcustomplot.cpp:1927
bool contains(double value) const
Definition qcustomplot.h:863
friend const QCPRange operator+(const QCPRange &, double)
Definition qcustomplot.h:886
double center() const
Definition qcustomplot.h:854
void normalize()
Definition qcustomplot.h:855
QCPRange & operator+=(const double &value)
Definition qcustomplot.h:842
Represents the visual appearance of scatter points.
Definition qcustomplot.h:2498
bool isPenDefined() const
Definition qcustomplot.h:2575
bool isNone() const
Definition qcustomplot.h:2574
QCPScatterStyle()
Definition qcustomplot.cpp:10639
ScatterProperty
Definition qcustomplot.h:2509
@ spShape
0x08 The shape property, see setShape
Definition qcustomplot.h:2513
@ spSize
0x04 The size property, see setSize
Definition qcustomplot.h:2512
@ spNone
0x00 None
Definition qcustomplot.h:2509
@ spPen
0x01 The pen property, see setPen
Definition qcustomplot.h:2510
@ spBrush
0x02 The brush property, see setBrush
Definition qcustomplot.h:2511
@ spAll
0xFF All properties
Definition qcustomplot.h:2514
ScatterShape
Definition qcustomplot.h:2527
@ ssDot
\enumimage{ssDot.png} a single pixel (use ssDisc or ssCircle if you want a round shape with a certain...
Definition qcustomplot.h:2528
@ ssCustom
custom painter operations are performed per scatter (As QPainterPath, see setCustomPath)
Definition qcustomplot.h:2544
@ ssSquare
\enumimage{ssSquare.png} a square
Definition qcustomplot.h:2533
@ ssDisc
\enumimage{ssDisc.png} a circle which is filled with the pen's color (not the brush as with ssCircle)
Definition qcustomplot.h:2532
@ ssPlus
\enumimage{ssPlus.png} a plus
Definition qcustomplot.h:2530
@ ssDiamond
\enumimage{ssDiamond.png} a diamond
Definition qcustomplot.h:2534
@ ssCrossCircle
\enumimage{ssCrossCircle.png} a circle with a cross inside
Definition qcustomplot.h:2540
@ ssPlusSquare
\enumimage{ssPlusSquare.png} a square with a plus inside
Definition qcustomplot.h:2539
@ ssStar
\enumimage{ssStar.png} a star with eight arms, i.e. a combination of cross and plus
Definition qcustomplot.h:2535
@ ssTriangleInverted
\enumimage{ssTriangleInverted.png} an equilateral triangle, standing on corner
Definition qcustomplot.h:2537
@ ssPlusCircle
\enumimage{ssPlusCircle.png} a circle with a plus inside
Definition qcustomplot.h:2541
@ ssCrossSquare
\enumimage{ssCrossSquare.png} a square with a cross inside
Definition qcustomplot.h:2538
@ ssTriangle
\enumimage{ssTriangle.png} an equilateral triangle, standing on baseline
Definition qcustomplot.h:2536
@ ssCircle
\enumimage{ssCircle.png} a circle
Definition qcustomplot.h:2531
@ ssPixmap
a custom pixmap specified by setPixmap, centered on the data point coordinates
Definition qcustomplot.h:2543
@ ssCross
\enumimage{ssCross.png} a cross
Definition qcustomplot.h:2529
@ ssNone
no scatter symbols are drawn (e.g. in QCPGraph, data only represented with lines)
Definition qcustomplot.h:2527
@ ssPeace
\enumimage{ssPeace.png} a circle, with one vertical and two downward diagonal lines
Definition qcustomplot.h:2542
A selection decorator which draws brackets around each selected data segment.
Definition qcustomplot.h:4856
BracketStyle
Definition qcustomplot.h:4866
@ bsUserStyle
Start custom bracket styles at this index when subclassing and reimplementing drawBracket.
Definition qcustomplot.h:4870
@ bsEllipse
An ellipse is drawn. The size of the ellipse is given by the bracket width/height properties.
Definition qcustomplot.h:4868
@ bsPlus
A plus is drawn.
Definition qcustomplot.h:4869
@ bsSquareBracket
A square bracket is drawn.
Definition qcustomplot.h:4866
@ bsHalfEllipse
A half ellipse is drawn. The size of the ellipse is given by the bracket width/height properties.
Definition qcustomplot.h:4867
QCPSelectionDecoratorBracket()
Definition qcustomplot.cpp:17162
Controls how a plottable's data selection is drawn.
Definition qcustomplot.h:3449
QCPScatterStyle getFinalScatterStyle(const QCPScatterStyle &unselectedStyle) const
Definition qcustomplot.cpp:11141
void applyBrush(QCPPainter *painter) const
Definition qcustomplot.cpp:11128
virtual void copyFrom(const QCPSelectionDecorator *other)
Definition qcustomplot.cpp:11159
virtual void drawDecoration(QCPPainter *painter, QCPDataSelection selection)
Definition qcustomplot.cpp:11174
void applyPen(QCPPainter *painter) const
Definition qcustomplot.cpp:11118
void setUsedScatterProperties(const QCPScatterStyle::ScatterProperties &properties)
Definition qcustomplot.cpp:11108
QCPSelectionDecorator()
Definition qcustomplot.cpp:11060
void setBrush(const QBrush &brush)
Definition qcustomplot.cpp:11083
void setScatterStyle(const QCPScatterStyle &scatterStyle, QCPScatterStyle::ScatterProperties usedProperties=QCPScatterStyle::spPen)
Definition qcustomplot.cpp:11095
void setPen(const QPen &pen)
Definition qcustomplot.cpp:11075
Provides rect/rubber-band data selection and range zoom interaction.
Definition qcustomplot.h:1154
void accepted(const QRect &rect, QMouseEvent *event)
void changed(const QRect &rect, QMouseEvent *event)
QCPRange range(const QCPAxis *axis) const
Definition qcustomplot.cpp:2863
void started(QMouseEvent *event)
bool isActive() const
Definition qcustomplot.h:1165
QCPSelectionRect(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:2846
void canceled(const QRect &rect, QInputEvent *event)
double mainValue() const
Definition qcustomplot.h:5916
double sortKey() const
Definition qcustomplot.h:5911
QCPRange valueRange() const
Definition qcustomplot.h:5918
double mainKey() const
Definition qcustomplot.h:5915
static QCPStatisticalBoxData fromSortKey(double sortKey)
Definition qcustomplot.h:5912
QCPStatisticalBoxData()
Definition qcustomplot.cpp:25228
static bool sortKeyIsMainKey()
Definition qcustomplot.h:5913
void setWidth(double width)
Definition qcustomplot.cpp:25383
void setWhiskerPen(const QPen &pen)
Definition qcustomplot.cpp:25412
void setWhiskerAntialiased(bool enabled)
Definition qcustomplot.cpp:25437
void setMedianPen(const QPen &pen)
Definition qcustomplot.cpp:25445
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
Definition qcustomplot.h:5960
QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition qcustomplot.cpp:25327
void setWhiskerBarPen(const QPen &pen)
Definition qcustomplot.cpp:25426
void setOutlierStyle(const QCPScatterStyle &style)
Definition qcustomplot.cpp:25456
void setWhiskerWidth(double width)
Definition qcustomplot.cpp:25396
void setFont(const QFont &font)
Definition qcustomplot.cpp:19832
void setSelectedFont(const QFont &font)
Definition qcustomplot.cpp:19852
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:20009
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=nullptr) const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:19968
Q_SLOT void setSelectable(bool selectable)
Definition qcustomplot.cpp:19873
virtual QSize minimumOuterSizeHint() const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:19913
void selectionChanged(bool selected)
void setTextColor(const QColor &color)
Definition qcustomplot.cpp:19842
void doubleClicked(QMouseEvent *event)
void setTextFlags(int flags)
Definition qcustomplot.cpp:19822
Q_SLOT void setSelected(bool selected)
Definition qcustomplot.cpp:19889
void setSelectedTextColor(const QColor &color)
Definition qcustomplot.cpp:19862
void setText(const QString &text)
Definition qcustomplot.cpp:19797
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:19998
void clicked(QMouseEvent *event)
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition qcustomplot.cpp:19986
QCPTextElement(QCustomPlot *parentPlot)
Definition qcustomplot.cpp:19679
virtual QSize maximumOuterSizeHint() const Q_DECL_OVERRIDE
Definition qcustomplot.cpp:19923
Represents two doubles as a mathematical 2D vector.
Definition qcustomplot.h:441
QCPVector2D()
Definition qcustomplot.cpp:118
QCPVector2D perpendicular() const
Definition qcustomplot.h:468
double length() const
Definition qcustomplot.h:459
double angle() const
Definition qcustomplot.h:461
double dot(const QCPVector2D &vec) const
Definition qcustomplot.h:469
double lengthSquared() const
Definition qcustomplot.h:460
void setX(double x)
Definition qcustomplot.h:455
QPointF toPointF() const
Definition qcustomplot.h:463
bool isNull() const
Definition qcustomplot.h:465
void setY(double y)
Definition qcustomplot.h:456
QPoint toPoint() const
Definition qcustomplot.h:462
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition qcustomplot.h:3791
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void setBackground(const QPixmap &pm)
Definition qcustomplot.cpp:14169
QCPAbstractPlottable * plottable(int index)
Definition qcustomplot.cpp:14242
void setBackgroundScaled(bool scaled)
Definition qcustomplot.cpp:14218
QCustomPlot(QWidget *parent=nullptr)
Definition qcustomplot.cpp:13597
void setViewport(const QRect &rect)
Definition qcustomplot.cpp:14120
RefreshPriority
Definition qcustomplot.h:3821
@ rpQueuedReplot
Queues the entire replot for the next event loop iteration. This way multiple redundant replots can b...
Definition qcustomplot.h:3824
@ rpRefreshHint
Whether to use immediate or queued refresh depends on whether the plotting hint QCP::phImmediateRefre...
Definition qcustomplot.h:3823
@ rpImmediateRefresh
Replots immediately and repaints the widget immediately by calling QWidget::repaint() after the replo...
Definition qcustomplot.h:3821
@ rpQueuedRefresh
Replots immediately, but queues the widget repaint, by calling QWidget::update() after the replot....
Definition qcustomplot.h:3822
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
Definition qcustomplot.cpp:14229
void setSelectionTolerance(int pixels)
Definition qcustomplot.cpp:13900
void selectionChangedByUser()
PlottableType * plottableAt(const QPointF &pos, bool onlySelectable=false, int *dataIndex=nullptr) const
Definition qcustomplot.h:4081
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
QCPGraph * graph(int index) const
Definition qcustomplot.cpp:14386
QCPLegend * legend
Definition qcustomplot.h:3945
void mouseMove(QMouseEvent *event)
LayerInsertMode
Definition qcustomplot.h:3811
@ limAbove
Layer is inserted above other layer.
Definition qcustomplot.h:3812
@ limBelow
Layer is inserted below other layer.
Definition qcustomplot.h:3811
void setNoAntialiasingOnDrag(bool enabled)
Definition qcustomplot.cpp:13914
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
void setOpenGl(bool enabled, int multisampling=16)
Definition qcustomplot.cpp:14066
void plottableDoubleClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
ItemType * itemAt(const QPointF &pos, bool onlySelectable=false) const
Definition qcustomplot.h:4128
void setMultiSelectModifier(Qt::KeyboardModifier modifier)
Definition qcustomplot.cpp:13956
QCPAxis * xAxis
Definition qcustomplot.h:3944
void mouseDoubleClick(QMouseEvent *event)
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
QCPAbstractItem * item(int index) const
Definition qcustomplot.cpp:14526
void mouseWheel(QWheelEvent *event)
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
void mouseRelease(QMouseEvent *event)
void mousePress(QMouseEvent *event)
bool hasInvalidatedPaintBuffers()
Definition qcustomplot.cpp:15912
QCPSelectionRect * selectionRect() const
Definition qcustomplot.h:3847
void setAutoAddPlottableToLegend(bool on)
Definition qcustomplot.cpp:13808
QCPAxis * xAxis2
Definition qcustomplot.h:3944
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
QCPAxis * yAxis2
Definition qcustomplot.h:3944
QCPLayoutGrid * plotLayout() const
Definition qcustomplot.h:3837
void plottableClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event)
QCPAxis * yAxis
Definition qcustomplot.h:3944
Definition qcustomplot.h:166
ExportPen
Definition qcustomplot.h:205
@ epAllowCosmetic
Cosmetic pens are exported normally (e.g. in PDF exports, cosmetic pens always appear as 1 pixel on s...
Definition qcustomplot.h:206
@ epNoCosmetic
Cosmetic pens are converted to pens with pixel width 1 when exporting.
Definition qcustomplot.h:205
Interaction
Definition qcustomplot.h:281
@ iSelectLegend
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts)
Definition qcustomplot.h:287
@ iRangeDrag
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes)
Definition qcustomplot.h:282
@ iSelectPlottables
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable)
Definition qcustomplot.h:285
@ iNone
0x000 None of the interactions are possible
Definition qcustomplot.h:281
@ iRangeZoom
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom,...
Definition qcustomplot.h:283
@ iSelectPlottablesBeyondAxisRect
0x100 When performing plottable selection/hit tests, this flag extends the sensitive area beyond the ...
Definition qcustomplot.h:290
@ iSelectAxes
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition qcustomplot.h:286
@ iSelectItems
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem)
Definition qcustomplot.h:288
@ iMultiSelect
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition qcustomplot.h:284
@ iSelectOther
0x080 All other objects are selectable (e.g. your own derived layerables, other layout elements,...
Definition qcustomplot.h:289
PlottingHint
Definition qcustomplot.h:265
@ phImmediateRefresh
Definition qcustomplot.h:268
@ phCacheLabels
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition qcustomplot.h:270
@ phFastPolylines
Definition qcustomplot.h:266
@ phNone
0x000 No hints are set
Definition qcustomplot.h:265
ResolutionUnit
Definition qcustomplot.h:195
@ ruDotsPerCentimeter
Resolution is given in dots per centimeter (dpcm)
Definition qcustomplot.h:196
@ ruDotsPerMeter
Resolution is given in dots per meter (dpm)
Definition qcustomplot.h:195
@ ruDotsPerInch
Resolution is given in dots per inch (DPI/PPI)
Definition qcustomplot.h:197
MarginSide
Definition qcustomplot.h:226
@ msAll
0xFF all margins
Definition qcustomplot.h:230
@ msBottom
0x08 bottom margin
Definition qcustomplot.h:229
@ msTop
0x04 top margin
Definition qcustomplot.h:228
@ msNone
0x00 no margin
Definition qcustomplot.h:231
@ msRight
0x02 right margin
Definition qcustomplot.h:227
@ msLeft
0x01 left margin
Definition qcustomplot.h:226
SelectionType
Definition qcustomplot.h:323
@ stMultipleDataRanges
Any combination of data points/ranges can be selected.
Definition qcustomplot.h:327
@ stDataRange
Multiple contiguous data points (a data range) can be selected.
Definition qcustomplot.h:326
@ stNone
The plottable is not selectable.
Definition qcustomplot.h:323
@ stSingleData
One individual data point can be selected at a time.
Definition qcustomplot.h:325
@ stWhole
Selection behaves like stMultipleDataRanges, but if there are any data points selected,...
Definition qcustomplot.h:324
SelectionRectMode
Definition qcustomplot.h:299
@ srmCustom
When dragging the mouse, a selection rect becomes active. It is the programmer's responsibility to co...
Definition qcustomplot.h:302
@ srmSelect
When dragging the mouse, a selection rect becomes active. Upon releasing, plottable data points that ...
Definition qcustomplot.h:301
@ srmZoom
When dragging the mouse, a selection rect becomes active. Upon releasing, the axes that are currently...
Definition qcustomplot.h:300
@ srmNone
The selection rect is disabled, and all mouse events are forwarded to the underlying objects,...
Definition qcustomplot.h:299
AntialiasedElement
Definition qcustomplot.h:244
@ aeLegendItems
0x0010 Legend items
Definition qcustomplot.h:248
@ aeZeroLine
0x0200 Zero-lines, see QCPGrid::setZeroLinePen
Definition qcustomplot.h:253
@ aePlottables
0x0020 Main lines of plottables
Definition qcustomplot.h:249
@ aeGrid
0x0002 Grid lines
Definition qcustomplot.h:245
@ aeOther
0x8000 Other elements that don't fit into any of the existing categories
Definition qcustomplot.h:254
@ aeFills
0x0100 Borders of fills (e.g. under or between graphs)
Definition qcustomplot.h:252
@ aeLegend
0x0008 Legend box
Definition qcustomplot.h:247
@ aeAll
0xFFFF All elements
Definition qcustomplot.h:255
@ aeNone
0x0000 No elements
Definition qcustomplot.h:256
@ aeSubGrid
0x0004 Sub grid lines
Definition qcustomplot.h:246
@ aeScatters
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap)
Definition qcustomplot.h:251
@ aeAxes
0x0001 Axis base line and tick marks
Definition qcustomplot.h:244
@ aeItems
0x0040 Main lines of items
Definition qcustomplot.h:250
SignDomain
Definition qcustomplot.h:216
@ sdNegative
The negative sign domain, i.e. numbers smaller than zero.
Definition qcustomplot.h:216
@ sdPositive
The positive sign domain, i.e. numbers greater than zero.
Definition qcustomplot.h:218
@ sdBoth
Both sign domains, including zero, i.e. all numbers.
Definition qcustomplot.h:217
Definition qcustomplot.h:2467
Definition qcustomplot.h:2472
Definition qcustomplot.h:1670
Definition qcustomplot.h:1675