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 47 #include <QtCore/QObject> 48 #include <QtCore/QPointer> 49 #include <QtCore/QSharedPointer> 50 #include <QtCore/QTimer> 51 #include <QtGui/QPainter> 52 #include <QtGui/QPaintEvent> 53 #include <QtGui/QMouseEvent> 54 #include <QtGui/QWheelEvent> 55 #include <QtGui/QPixmap> 56 #include <QtCore/QVector> 57 #include <QtCore/QString> 58 #include <QtCore/QDateTime> 59 #include <QtCore/QMultiMap> 60 #include <QtCore/QFlags> 61 #include <QtCore/QDebug> 62 #include <QtCore/QStack> 63 #include <QtCore/QCache> 64 #include <QtCore/QMargins> 69 # include <QtGui/QOpenGLContext> 70 # include <QtGui/QOpenGLFramebufferObject> 71 # ifdef QCP_OPENGL_OFFSCREENSURFACE 72 # include <QtGui/QOffscreenSurface> 74 # include <QtGui/QWindow> 77 #ifdef QCP_OPENGL_PBUFFER 78 # include <QtOpenGL/QGLPixelBuffer> 80 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 81 # include <qnumeric.h> 82 # include <QtGui/QWidget> 83 # include <QtGui/QPrinter> 84 # include <QtGui/QPrintEngine> 87 # include <QtWidgets/QWidget> 88 # include <QtPrintSupport/QtPrintSupport> 116 #if defined(QCUSTOMPLOT_COMPILE_LIBRARY) 117 # define QCP_LIB_DECL Q_DECL_EXPORT 118 #elif defined(QCUSTOMPLOT_USE_LIBRARY) 119 # define QCP_LIB_DECL Q_DECL_IMPORT 121 # define QCP_LIB_DECL 125 #ifndef Q_DECL_OVERRIDE 126 # define Q_DECL_OVERRIDE 146 Q_FLAGS(AntialiasedElements)
148 Q_FLAGS(PlottingHints)
150 Q_FLAGS(Interactions)
301 inline bool isInvalidData(
double value)
303 return qIsNaN(value) || qIsInf(value);
311 inline bool isInvalidData(
double value1,
double value2)
313 return isInvalidData(value1) || isInvalidData(value2);
322 inline void setMarginValue(QMargins &margins,
QCP::MarginSide side,
int value)
328 case QCP::msTop: margins.setTop(value);
break;
330 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
342 inline int getMarginValue(
const QMargins &margins,
QCP::MarginSide side)
356 extern const QMetaObject staticMetaObject;
359 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
360 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
361 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
362 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
388 double x()
const {
return mX; }
389 double y()
const {
return mY; }
390 double &rx() {
return mX; }
391 double &ry() {
return mY; }
394 void setX(
double x) { mX = x; }
395 void setY(
double y) { mY = y; }
398 double length()
const {
return qSqrt(mX*mX+mY*mY); }
400 QPoint
toPoint()
const {
return QPoint(mX, mY); }
403 bool isNull()
const {
return qIsNull(mX) && qIsNull(mY); }
409 double distanceSquaredToLine(
const QLineF &line)
const;
443 d.nospace() <<
"QCPVector2D(" << vec.x() <<
", " << vec.y() <<
")";
464 ,pmNonCosmetic = 0x04
467 Q_FLAGS(PainterModes)
468 Q_DECLARE_FLAGS(PainterModes, PainterMode)
474 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
475 PainterModes modes()
const {
return mModes; }
478 void setAntialiasing(
bool enabled);
479 void setMode(PainterMode mode,
bool enabled=
true);
480 void setModes(PainterModes modes);
484 void setPen(
const QPen &pen);
485 void setPen(
const QColor &color);
486 void setPen(Qt::PenStyle penStyle);
487 void drawLine(
const QLineF &line);
493 void makeNonCosmetic();
498 bool mIsAntialiasing;
501 QStack<bool> mAntialiasingStack;
503 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
519 QSize size()
const {
return mSize; }
520 bool invalidated()
const {
return mInvalidated; }
521 double devicePixelRatio()
const {
return mDevicePixelRatio; }
524 void setSize(
const QSize &size);
525 void setInvalidated(
bool invalidated=
true);
526 void setDevicePixelRatio(
double ratio);
531 virtual void draw(
QCPPainter *painter)
const = 0;
532 virtual void clear(
const QColor &color) = 0;
537 double mDevicePixelRatio;
543 virtual void reallocateBuffer() = 0;
554 virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
555 virtual void draw(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
556 void clear(
const QColor &color) Q_DECL_OVERRIDE;
563 virtual void reallocateBuffer() Q_DECL_OVERRIDE;
567 #ifdef QCP_OPENGL_PBUFFER 571 explicit QCPPaintBufferGlPbuffer(
const QSize &size,
double devicePixelRatio,
int multisamples);
572 virtual ~QCPPaintBufferGlPbuffer();
575 virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
576 virtual
void draw(
QCPPainter *painter) const Q_DECL_OVERRIDE;
577 void clear(const
QColor &color) Q_DECL_OVERRIDE;
585 virtual
void reallocateBuffer() Q_DECL_OVERRIDE;
587 #endif // QCP_OPENGL_PBUFFER 590 #ifdef QCP_OPENGL_FBO 594 explicit QCPPaintBufferGlFbo(
const QSize &size,
double devicePixelRatio, QWeakPointer<QOpenGLContext> glContext, QWeakPointer<QOpenGLPaintDevice> glPaintDevice);
595 virtual ~QCPPaintBufferGlFbo();
598 virtual QCPPainter *startPainting() Q_DECL_OVERRIDE;
599 virtual
void donePainting() Q_DECL_OVERRIDE;
600 virtual
void draw(
QCPPainter *painter) const Q_DECL_OVERRIDE;
601 void clear(const
QColor &color) Q_DECL_OVERRIDE;
605 QWeakPointer<QOpenGLContext> mGlContext;
606 QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
607 QOpenGLFramebufferObject *mGlFrameBuffer;
610 virtual
void reallocateBuffer() Q_DECL_OVERRIDE;
612 #endif // QCP_OPENGL_FBO 624 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
625 Q_PROPERTY(
QString name READ name)
626 Q_PROPERTY(
int index READ index)
628 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
629 Q_PROPERTY(
LayerMode mode READ mode WRITE setMode)
649 QCustomPlot *parentPlot()
const {
return mParentPlot; }
650 QString name()
const {
return mName; }
651 int index()
const {
return mIndex; }
653 bool visible()
const {
return mVisible; }
654 LayerMode mode()
const {
return mMode; }
657 void setVisible(
bool visible);
658 void setMode(LayerMode mode);
673 QWeakPointer<QCPAbstractPaintBuffer> mPaintBuffer;
677 void drawToPaintBuffer();
693 Q_PROPERTY(
bool visible READ visible WRITE
setVisible)
694 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
697 Q_PROPERTY(
bool antialiased READ antialiased WRITE
setAntialiased)
704 bool visible()
const {
return mVisible; }
705 QCustomPlot *parentPlot()
const {
return mParentPlot; }
707 QCPLayer *layer()
const {
return mLayer; }
708 bool antialiased()
const {
return mAntialiased; }
729 QPointer<QCPLayerable> mParentLayerable;
734 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
736 virtual QRect clipRect()
const;
737 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
740 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
741 virtual void deselectEvent(
bool *selectionStateChanged);
750 void initializeParentPlot(
QCustomPlot *parentPlot);
752 bool moveToLayer(
QCPLayer *layer,
bool prepend);
775 QCPRange(
double lower,
double upper);
777 bool operator==(
const QCPRange& other)
const {
return lower == other.lower && upper == other.upper; }
778 bool operator!=(
const QCPRange& other)
const {
return !(*
this == other); }
786 friend inline const QCPRange operator-(
const QCPRange& range,
double value);
787 friend inline const QCPRange operator*(
const QCPRange& range,
double value);
788 friend inline const QCPRange operator*(
double value,
const QCPRange& range);
789 friend inline const QCPRange operator/(
const QCPRange& range,
double value);
791 double size()
const {
return upper-lower; }
792 double center()
const {
return (upper+lower)*0.5; }
793 void normalize() {
if (lower > upper) qSwap(lower, upper); }
794 void expand(
const QCPRange &otherRange);
795 void expand(
double includeCoord);
797 QCPRange expanded(
double includeCoord)
const;
798 QCPRange bounded(
double lowerBound,
double upperBound)
const;
799 QCPRange sanitizedForLogScale()
const;
800 QCPRange sanitizedForLinScale()
const;
801 bool contains(
double value)
const {
return value >= lower && value <= upper; }
803 static bool validRange(
double lower,
double upper);
804 static bool validRange(
const QCPRange &range);
809 Q_DECLARE_TYPEINFO(
QCPRange, Q_MOVABLE_TYPE);
815 inline QDebug operator<< (QDebug d,
const QCPRange &range)
817 d.nospace() <<
"QCPRange(" << range.lower <<
", " << range.upper <<
")";
893 bool operator==(
const QCPDataRange& other)
const {
return mBegin == other.mBegin && mEnd == other.mEnd; }
894 bool operator!=(
const QCPDataRange& other)
const {
return !(*
this == other); }
897 int begin()
const {
return mBegin; }
898 int end()
const {
return mEnd; }
899 int size()
const {
return mEnd-mBegin; }
907 bool isValid()
const {
return (mEnd >= mBegin) && (mBegin >= 0); }
908 bool isEmpty()
const {
return length() == 0; }
931 bool operator!=(
const QCPDataSelection& other)
const {
return !(*
this == other); }
947 int dataPointCount()
const;
953 void addDataRange(
const QCPDataRange &dataRange,
bool simplify=
true);
955 bool isEmpty()
const {
return mDataRanges.isEmpty(); }
967 inline static bool lessThanDataRangeBegin(
const QCPDataRange &a,
const QCPDataRange &b) {
return a.begin() < b.begin(); }
1062 d.nospace() <<
"[" << dataRange.begin() <<
".." << dataRange.end()-1 <<
"]";
1072 d.nospace() <<
"QCPDataSelection(";
1099 QRect rect()
const {
return mRect; }
1101 QPen pen()
const {
return mPen; }
1102 QBrush brush()
const {
return mBrush; }
1106 void setPen(
const QPen &pen);
1107 void setBrush(
const QBrush &brush);
1110 Q_SLOT
void cancel();
1114 void changed(
const QRect &rect,
QMouseEvent *event);
1115 void canceled(
const QRect &rect,
QInputEvent *event);
1116 void accepted(
const QRect &rect,
QMouseEvent *event);
1130 virtual void keyPressEvent(
QKeyEvent *event);
1133 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
1134 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
1154 bool isEmpty()
const;
1180 Q_PROPERTY(
QCPLayout* layout READ layout)
1181 Q_PROPERTY(QRect rect READ rect)
1182 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
1183 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
1184 Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
1185 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
1186 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
1197 Q_ENUMS(UpdatePhase)
1204 QRect
rect()
const {
return mRect; }
1205 QRect outerRect()
const {
return mOuterRect; }
1206 QMargins margins()
const {
return mMargins; }
1207 QMargins minimumMargins()
const {
return mMinimumMargins; }
1208 QCP::MarginSides autoMargins()
const {
return mAutoMargins; }
1209 QSize minimumSize()
const {
return mMinimumSize; }
1210 QSize maximumSize()
const {
return mMaximumSize; }
1215 void setOuterRect(
const QRect &rect);
1216 void setMargins(
const QMargins &margins);
1217 void setMinimumMargins(
const QMargins &margins);
1218 void setAutoMargins(QCP::MarginSides sides);
1219 void setMinimumSize(
const QSize &size);
1220 void setMinimumSize(
int width,
int height);
1221 void setMaximumSize(
const QSize &size);
1222 void setMaximumSize(
int width,
int height);
1223 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
1226 virtual void update(UpdatePhase phase);
1227 virtual QSize minimumSizeHint()
const;
1228 virtual QSize maximumSizeHint()
const;
1232 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0) const Q_DECL_OVERRIDE;
1237 QSize mMinimumSize, mMaximumSize;
1238 QRect mRect, mOuterRect;
1239 QMargins mMargins, mMinimumMargins;
1240 QCP::MarginSides mAutoMargins;
1245 virtual
void layoutChanged();
1248 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1249 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE { Q_UNUSED(painter) }
1250 virtual void parentPlotInitialized(
QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
1269 virtual void update(
UpdatePhase phase) Q_DECL_OVERRIDE;
1273 virtual int elementCount()
const = 0;
1277 virtual void simplify();
1280 bool removeAt(
int index);
1286 virtual void updateLayout();
1289 void sizeConstraintsChanged()
const;
1304 Q_PROPERTY(
int rowCount READ rowCount)
1305 Q_PROPERTY(
int columnCount READ columnCount)
1306 Q_PROPERTY(
QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
1307 Q_PROPERTY(
QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
1308 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
1309 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
1310 Q_PROPERTY(
FillOrder fillOrder READ fillOrder WRITE setFillOrder)
1311 Q_PROPERTY(
int wrap READ wrap WRITE setWrap)
1332 int columnCount()
const {
return mElements.size() > 0 ? mElements.first().size() : 0; }
1333 QList<double> columnStretchFactors()
const {
return mColumnStretchFactors; }
1334 QList<double> rowStretchFactors()
const {
return mRowStretchFactors; }
1335 int columnSpacing()
const {
return mColumnSpacing; }
1336 int rowSpacing()
const {
return mRowSpacing; }
1337 int wrap()
const {
return mWrap; }
1338 FillOrder fillOrder()
const {
return mFillOrder; }
1341 void setColumnStretchFactor(
int column,
double factor);
1343 void setRowStretchFactor(
int row,
double factor);
1345 void setColumnSpacing(
int pixels);
1346 void setRowSpacing(
int pixels);
1347 void setWrap(
int count);
1348 void setFillOrder(FillOrder order,
bool rearrange=
true);
1351 virtual void updateLayout() Q_DECL_OVERRIDE;
1352 virtual
int elementCount() const Q_DECL_OVERRIDE {
return rowCount()*columnCount(); }
1357 virtual void simplify() Q_DECL_OVERRIDE;
1358 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
1359 virtual QSize maximumSizeHint() const Q_DECL_OVERRIDE;
1365 bool hasElement(
int row,
int column);
1366 void expandTo(
int newRowCount,
int newColumnCount);
1367 void insertRow(
int newIndex);
1368 void insertColumn(
int newIndex);
1369 int rowColToIndex(
int row,
int column) const;
1370 void indexToRowCol(
int index,
int &row,
int &column) const;
1375 QList<
double> mColumnStretchFactors;
1376 QList<
double> mRowStretchFactors;
1377 int mColumnSpacing, mRowSpacing;
1379 FillOrder mFillOrder;
1382 void getMinimumRowColSizes(
QVector<
int> *minColWidths,
QVector<
int> *minRowHeights) const;
1383 void getMaximumRowColSizes(
QVector<
int> *maxColWidths,
QVector<
int> *maxRowHeights) const;
1401 Q_ENUMS(InsetPlacement)
1407 InsetPlacement insetPlacement(
int index)
const;
1408 Qt::Alignment insetAlignment(
int index)
const;
1409 QRectF insetRect(
int index)
const;
1412 void setInsetPlacement(
int index, InsetPlacement placement);
1413 void setInsetAlignment(
int index, Qt::Alignment alignment);
1414 void setInsetRect(
int index,
const QRectF &rect);
1417 virtual void updateLayout() Q_DECL_OVERRIDE;
1418 virtual
int elementCount() const Q_DECL_OVERRIDE;
1422 virtual
void simplify() Q_DECL_OVERRIDE {}
1423 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0) const Q_DECL_OVERRIDE;
1432 QList<InsetPlacement> mInsetPlacement;
1433 QList<
Qt::Alignment> mInsetAlignment;
1473 Q_ENUMS(EndingStyle)
1476 QCPLineEnding(EndingStyle style,
double width=8,
double length=10,
bool inverted=
false);
1479 EndingStyle style()
const {
return mStyle; }
1480 double width()
const {
return mWidth; }
1481 double length()
const {
return mLength; }
1482 bool inverted()
const {
return mInverted; }
1485 void setStyle(EndingStyle style);
1486 void setWidth(
double width);
1487 void setLength(
double length);
1488 void setInverted(
bool inverted);
1491 double boundingDistance()
const;
1492 double realLength()
const;
1499 double mWidth, mLength;
1525 Q_ENUMS(TickStepStrategy)
1531 TickStepStrategy tickStepStrategy()
const {
return mTickStepStrategy; }
1532 int tickCount()
const {
return mTickCount; }
1533 double tickOrigin()
const {
return mTickOrigin; }
1536 void setTickStepStrategy(TickStepStrategy strategy);
1537 void setTickCount(
int count);
1538 void setTickOrigin(
double origin);
1545 TickStepStrategy mTickStepStrategy;
1550 virtual double getTickStep(
const QCPRange &range);
1551 virtual int getSubTickCount(
double tickStep);
1552 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision);
1559 double pickClosest(
double target,
const QVector<double> &candidates)
const;
1560 double getMantissa(
double input,
double *magnitude=0)
const;
1561 double cleanMantissa(
double input)
const;
1564 Q_DECLARE_METATYPE(QSharedPointer<QCPAxisTicker>)
1578 QString dateTimeFormat()
const {
return mDateTimeFormat; }
1579 Qt::TimeSpec dateTimeSpec()
const {
return mDateTimeSpec; }
1582 void setDateTimeFormat(
const QString &format);
1583 void setDateTimeSpec(Qt::TimeSpec spec);
1584 void setTickOrigin(
double origin);
1585 void setTickOrigin(
const QDateTime &origin);
1588 static QDateTime keyToDateTime(
double key);
1589 static double dateTimeToKey(
const QDateTime dateTime);
1590 static double dateTimeToKey(
const QDate date);
1595 Qt::TimeSpec mDateTimeSpec;
1598 enum DateStrategy {dsNone, dsUniformTimeInDay, dsUniformDayInMonth} mDateStrategy;
1601 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1602 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1603 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1633 QString timeFormat()
const {
return mTimeFormat; }
1634 int fieldWidth(TimeUnit unit)
const {
return mFieldWidth.value(unit); }
1637 void setTimeFormat(
const QString &format);
1638 void setFieldWidth(TimeUnit unit,
int width);
1646 TimeUnit mSmallestUnit, mBiggestUnit;
1650 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1651 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1652 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1655 void replaceUnit(
QString &text, TimeUnit unit,
int value)
const;
1679 Q_ENUMS(ScaleStrategy)
1684 double tickStep()
const {
return mTickStep; }
1685 ScaleStrategy scaleStrategy()
const {
return mScaleStrategy; }
1688 void setTickStep(
double step);
1689 void setScaleStrategy(ScaleStrategy strategy);
1694 ScaleStrategy mScaleStrategy;
1697 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1714 int subTickCount()
const {
return mSubTickCount; }
1719 void setSubTickCount(
int subTicks);
1723 void addTick(
double position,
QString label);
1733 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1734 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1735 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1759 Q_ENUMS(FractionStyle)
1764 QString piSymbol()
const {
return mPiSymbol; }
1765 double piValue()
const {
return mPiValue; }
1766 bool periodicity()
const {
return mPeriodicity; }
1767 FractionStyle fractionStyle()
const {
return mFractionStyle; }
1770 void setPiSymbol(
QString symbol);
1771 void setPiValue(
double pi);
1772 void setPeriodicity(
int multiplesOfPi);
1773 void setFractionStyle(FractionStyle style);
1780 FractionStyle mFractionStyle;
1786 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1787 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1788 virtual QString getTickLabel(
double tick,
const QLocale &locale,
QChar formatChar,
int precision) Q_DECL_OVERRIDE;
1791 void simplifyFraction(
int &numerator,
int &denominator)
const;
1792 QString fractionToString(
int numerator,
int denominator)
const;
1793 QString unicodeFraction(
int numerator,
int denominator)
const;
1794 QString unicodeSuperscript(
int number)
const;
1795 QString unicodeSubscript(
int number)
const;
1811 double logBase()
const {
return mLogBase; }
1812 int subTickCount()
const {
return mSubTickCount; }
1815 void setLogBase(
double base);
1816 void setSubTickCount(
int subTicks);
1824 double mLogBaseLnInv;
1827 virtual double getTickStep(
const QCPRange &range) Q_DECL_OVERRIDE;
1828 virtual int getSubTickCount(
double tickStep) Q_DECL_OVERRIDE;
1842 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
1843 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
1844 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
1845 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
1846 Q_PROPERTY(
QPen subGridPen READ subGridPen WRITE setSubGridPen)
1847 Q_PROPERTY(
QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
1853 bool subGridVisible()
const {
return mSubGridVisible; }
1854 bool antialiasedSubGrid()
const {
return mAntialiasedSubGrid; }
1855 bool antialiasedZeroLine()
const {
return mAntialiasedZeroLine; }
1856 QPen pen()
const {
return mPen; }
1857 QPen subGridPen()
const {
return mSubGridPen; }
1858 QPen zeroLinePen()
const {
return mZeroLinePen; }
1861 void setSubGridVisible(
bool visible);
1862 void setAntialiasedSubGrid(
bool enabled);
1863 void setAntialiasedZeroLine(
bool enabled);
1864 void setPen(
const QPen &pen);
1865 void setSubGridPen(
const QPen &pen);
1866 void setZeroLinePen(
const QPen &pen);
1870 bool mSubGridVisible;
1871 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
1872 QPen mPen, mSubGridPen, mZeroLinePen;
1878 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
1879 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
1882 void drawGridLines(
QCPPainter *painter)
const;
1883 void drawSubGridLines(
QCPPainter *painter)
const;
1893 Q_PROPERTY(
AxisType axisType READ axisType)
1895 Q_PROPERTY(
ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
1896 Q_PROPERTY(
QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
1897 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
1898 Q_PROPERTY(QSharedPointer<QCPAxisTicker> ticker READ ticker WRITE setTicker)
1899 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
1900 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
1901 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
1902 Q_PROPERTY(
QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
1903 Q_PROPERTY(
QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1904 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
1905 Q_PROPERTY(
LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
1906 Q_PROPERTY(
QString numberFormat READ numberFormat WRITE setNumberFormat)
1907 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1910 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1911 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1912 Q_PROPERTY(
bool subTicks READ subTicks WRITE setSubTicks)
1913 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1914 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1915 Q_PROPERTY(
QPen basePen READ basePen WRITE setBasePen)
1916 Q_PROPERTY(
QPen tickPen READ tickPen WRITE setTickPen)
1917 Q_PROPERTY(
QPen subTickPen READ subTickPen WRITE setSubTickPen)
1918 Q_PROPERTY(
QFont labelFont READ labelFont WRITE setLabelFont)
1919 Q_PROPERTY(
QColor labelColor READ labelColor WRITE setLabelColor)
1920 Q_PROPERTY(
QString label READ label WRITE setLabel)
1921 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
1922 Q_PROPERTY(
int padding READ padding WRITE setPadding)
1923 Q_PROPERTY(
int offset READ offset WRITE setOffset)
1924 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
1925 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
1926 Q_PROPERTY(
QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
1927 Q_PROPERTY(
QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1928 Q_PROPERTY(
QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
1929 Q_PROPERTY(
QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
1930 Q_PROPERTY(
QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1931 Q_PROPERTY(
QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1932 Q_PROPERTY(
QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
1933 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1934 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1935 Q_PROPERTY(
QCPGrid* grid READ grid)
1949 Q_DECLARE_FLAGS(AxisTypes, AxisType)
1973 ,spTickLabels = 0x002
1974 ,spAxisLabel = 0x004
1976 Q_ENUMS(SelectablePart)
1977 Q_FLAGS(SelectableParts)
1978 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
1984 AxisType axisType()
const {
return mAxisType; }
1985 QCPAxisRect *axisRect()
const {
return mAxisRect; }
1986 ScaleType scaleType()
const {
return mScaleType; }
1987 const QCPRange range()
const {
return mRange; }
1988 bool rangeReversed()
const {
return mRangeReversed; }
1989 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
1990 bool ticks()
const {
return mTicks; }
1991 bool tickLabels()
const {
return mTickLabels; }
1992 int tickLabelPadding()
const;
1993 QFont tickLabelFont()
const {
return mTickLabelFont; }
1994 QColor tickLabelColor()
const {
return mTickLabelColor; }
1995 double tickLabelRotation()
const;
1996 LabelSide tickLabelSide()
const;
1998 int numberPrecision()
const {
return mNumberPrecision; }
2001 int tickLengthIn()
const;
2002 int tickLengthOut()
const;
2003 bool subTicks()
const {
return mSubTicks; }
2004 int subTickLengthIn()
const;
2005 int subTickLengthOut()
const;
2006 QPen basePen()
const {
return mBasePen; }
2007 QPen tickPen()
const {
return mTickPen; }
2008 QPen subTickPen()
const {
return mSubTickPen; }
2009 QFont labelFont()
const {
return mLabelFont; }
2010 QColor labelColor()
const {
return mLabelColor; }
2011 QString label()
const {
return mLabel; }
2012 int labelPadding()
const;
2013 int padding()
const {
return mPadding; }
2015 SelectableParts selectedParts()
const {
return mSelectedParts; }
2016 SelectableParts selectableParts()
const {
return mSelectableParts; }
2017 QFont selectedTickLabelFont()
const {
return mSelectedTickLabelFont; }
2018 QFont selectedLabelFont()
const {
return mSelectedLabelFont; }
2019 QColor selectedTickLabelColor()
const {
return mSelectedTickLabelColor; }
2020 QColor selectedLabelColor()
const {
return mSelectedLabelColor; }
2021 QPen selectedBasePen()
const {
return mSelectedBasePen; }
2022 QPen selectedTickPen()
const {
return mSelectedTickPen; }
2023 QPen selectedSubTickPen()
const {
return mSelectedSubTickPen; }
2030 Q_SLOT
void setRange(
const QCPRange &range);
2031 void setRange(
double lower,
double upper);
2032 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
2033 void setRangeLower(
double lower);
2034 void setRangeUpper(
double upper);
2035 void setRangeReversed(
bool reversed);
2036 void setTicker(QSharedPointer<QCPAxisTicker> ticker);
2037 void setTicks(
bool show);
2038 void setTickLabels(
bool show);
2039 void setTickLabelPadding(
int padding);
2040 void setTickLabelFont(
const QFont &font);
2041 void setTickLabelColor(
const QColor &color);
2042 void setTickLabelRotation(
double degrees);
2043 void setTickLabelSide(LabelSide side);
2044 void setNumberFormat(
const QString &formatCode);
2045 void setNumberPrecision(
int precision);
2046 void setTickLength(
int inside,
int outside=0);
2047 void setTickLengthIn(
int inside);
2048 void setTickLengthOut(
int outside);
2049 void setSubTicks(
bool show);
2050 void setSubTickLength(
int inside,
int outside=0);
2051 void setSubTickLengthIn(
int inside);
2052 void setSubTickLengthOut(
int outside);
2053 void setBasePen(
const QPen &pen);
2054 void setTickPen(
const QPen &pen);
2055 void setSubTickPen(
const QPen &pen);
2056 void setLabelFont(
const QFont &font);
2057 void setLabelColor(
const QColor &color);
2058 void setLabel(
const QString &str);
2059 void setLabelPadding(
int padding);
2060 void setPadding(
int padding);
2061 void setOffset(
int offset);
2062 void setSelectedTickLabelFont(
const QFont &font);
2063 void setSelectedLabelFont(
const QFont &font);
2064 void setSelectedTickLabelColor(
const QColor &color);
2065 void setSelectedLabelColor(
const QColor &color);
2066 void setSelectedBasePen(
const QPen &pen);
2067 void setSelectedTickPen(
const QPen &pen);
2068 void setSelectedSubTickPen(
const QPen &pen);
2069 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
2070 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
2075 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0) const Q_DECL_OVERRIDE;
2078 Qt::Orientation orientation()
const {
return mOrientation; }
2079 int pixelOrientation()
const {
return rangeReversed() != (orientation()==Qt::Vertical) ? -1 : 1; }
2080 void moveRange(
double diff);
2081 void scaleRange(
double factor);
2082 void scaleRange(
double factor,
double center);
2083 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
2084 void rescale(
bool onlyVisiblePlottables=
false);
2085 double pixelToCoord(
double value)
const;
2086 double coordToPixel(
double value)
const;
2087 SelectablePart getPartAt(
const QPointF &pos)
const;
2093 static Qt::Orientation
orientation(
AxisType type) {
return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
2094 static AxisType opposite(AxisType type);
2097 void rangeChanged(
const QCPRange &newRange);
2100 void selectionChanged(
const QCPAxis::SelectableParts &parts);
2101 void selectableChanged(
const QCPAxis::SelectableParts &parts);
2110 Qt::Orientation mOrientation;
2111 SelectableParts mSelectableParts, mSelectedParts;
2112 QPen mBasePen, mSelectedBasePen;
2117 QFont mLabelFont, mSelectedLabelFont;
2118 QColor mLabelColor, mSelectedLabelColor;
2123 QFont mTickLabelFont, mSelectedTickLabelFont;
2124 QColor mTickLabelColor, mSelectedTickLabelColor;
2125 int mNumberPrecision;
2126 QLatin1Char mNumberFormatChar;
2127 bool mNumberBeautifulPowers;
2133 QPen mTickPen, mSelectedTickPen;
2134 QPen mSubTickPen, mSelectedSubTickPen;
2137 bool mRangeReversed;
2138 ScaleType mScaleType;
2143 QSharedPointer<QCPAxisTicker> mTicker;
2147 bool mCachedMarginValid;
2151 virtual int calculateMargin();
2154 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
2155 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
2158 virtual
void selectEvent(
QMouseEvent *event,
bool additive, const
QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2159 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
2162 void setupTickVectors();
2163 QPen getBasePen() const;
2164 QPen getTickPen() const;
2165 QPen getSubTickPen() const;
2166 QFont getTickLabelFont() const;
2167 QFont getLabelFont() const;
2168 QColor getTickLabelColor() const;
2169 QColor getLabelColor() const;
2178 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::SelectableParts)
2179 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::AxisTypes)
2180 Q_DECLARE_METATYPE(
QCPAxis::AxisType)
2181 Q_DECLARE_METATYPE(
QCPAxis::LabelSide)
2182 Q_DECLARE_METATYPE(
QCPAxis::ScaleType)
2183 Q_DECLARE_METATYPE(
QCPAxis::SelectablePart)
2193 virtual int size()
const;
2196 QRect axisSelectionBox()
const {
return mAxisSelectionBox; }
2197 QRect tickLabelsSelectionBox()
const {
return mTickLabelsSelectionBox; }
2198 QRect labelSelectionBox()
const {
return mLabelSelectionBox; }
2208 int tickLabelPadding;
2209 double tickLabelRotation;
2211 bool substituteExponent;
2212 bool numberMultiplyCross;
2213 int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut;
2214 QPen tickPen, subTickPen;
2215 QFont tickLabelFont;
2217 QRect axisRect, viewportRect;
2219 bool abbreviateDecimalPowers;
2220 bool reversedEndings;
2234 QString basePart, expPart, suffixPart;
2235 QRect baseBounds, expBounds, suffixBounds, totalBounds, rotatedTotalBounds;
2236 QFont baseFont, expFont;
2241 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
2243 virtual QByteArray generateLabelParameterHash()
const;
2245 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
2249 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
2277 Q_ENUMS(ScatterProperty)
2278 Q_FLAGS(ScatterProperties)
2279 Q_DECLARE_FLAGS(ScatterProperties, ScatterProperty)
2307 Q_ENUMS(ScatterShape)
2318 double size()
const {
return mSize; }
2319 ScatterShape shape()
const {
return mShape; }
2320 QPen pen()
const {
return mPen; }
2321 QBrush brush()
const {
return mBrush; }
2322 QPixmap pixmap()
const {
return mPixmap; }
2323 QPainterPath customPath()
const {
return mCustomPath; }
2326 void setFromOther(
const QCPScatterStyle &other, ScatterProperties properties);
2327 void setSize(
double size);
2328 void setShape(ScatterShape shape);
2329 void setPen(
const QPen &pen);
2330 void setBrush(
const QBrush &brush);
2331 void setPixmap(
const QPixmap &pixmap);
2335 bool isNone()
const {
return mShape == ssNone; }
2340 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
2345 ScatterShape mShape;
2355 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPScatterStyle::ScatterProperties)
2370 template <
class DataType>
2371 inline bool qcpLessThanSortKey(
const DataType &a,
const DataType &b) {
return a.sortKey() < b.sortKey(); }
2373 template <
class DataType>
2383 int size()
const {
return mData.size()-mPreallocSize; }
2385 bool autoSqueeze()
const {
return mAutoSqueeze; }
2388 void setAutoSqueeze(
bool enabled);
2395 void add(
const DataType &data);
2396 void removeBefore(
double sortKey);
2397 void removeAfter(
double sortKey);
2398 void remove(
double sortKeyFrom,
double sortKeyTo);
2399 void remove(
double sortKey);
2402 void squeeze(
bool preAllocation=
true,
bool postAllocation=
true);
2404 const_iterator
constBegin()
const {
return mData.constBegin()+mPreallocSize; }
2405 const_iterator
constEnd()
const {
return mData.constEnd(); }
2406 iterator
begin() {
return mData.begin()+mPreallocSize; }
2407 iterator
end() {
return mData.end(); }
2408 const_iterator findBegin(
double sortKey,
bool expandedRange=
true)
const;
2409 const_iterator findEnd(
double sortKey,
bool expandedRange=
true)
const;
2410 const_iterator
at(
int index)
const {
return constBegin()+qBound(0, index, size()); }
2414 void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end,
const QCPDataRange &dataRange)
const;
2423 int mPreallocIteration;
2426 void preallocateGrow(
int minimumPreallocSize);
2427 void performAutoSqueeze();
2568 template <
class DataType>
2572 mPreallocIteration(0)
2584 template <
class DataType>
2587 if (mAutoSqueeze != enabled)
2589 mAutoSqueeze = enabled;
2591 performAutoSqueeze();
2601 template <
class DataType>
2617 template <
class DataType>
2622 mPreallocIteration = 0;
2633 template <
class DataType>
2639 const int n = data.
size();
2640 const int oldSize = size();
2642 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*constBegin(), *(data.
constEnd()-1)))
2644 if (mPreallocSize < n)
2650 mData.resize(mData.size()+n);
2652 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*(constEnd()-n-1), *(constEnd()-n)))
2653 std::inplace_merge(begin(), end()-n, end(), qcpLessThanSortKey<DataType>);
2665 template <
class DataType>
2672 set(data, alreadySorted);
2676 const int n = data.size();
2677 const int oldSize = size();
2679 if (alreadySorted && oldSize > 0 && !qcpLessThanSortKey<DataType>(*constBegin(), *(data.constEnd()-1)))
2681 if (mPreallocSize < n)
2684 std::copy(data.constBegin(), data.constEnd(), begin());
2687 mData.resize(mData.size()+n);
2688 std::copy(data.constBegin(), data.constEnd(), end()-n);
2690 std::sort(end()-n, end(), qcpLessThanSortKey<DataType>);
2691 if (oldSize > 0 && !qcpLessThanSortKey<DataType>(*(constEnd()-n-1), *(constEnd()-n)))
2692 std::inplace_merge(begin(), end()-n, end(), qcpLessThanSortKey<DataType>);
2702 template <
class DataType>
2705 if (isEmpty() || !qcpLessThanSortKey<DataType>(data, *(constEnd()-1)))
2708 }
else if (qcpLessThanSortKey<DataType>(data, *constBegin()))
2710 if (mPreallocSize < 1)
2716 QCPDataContainer<DataType>::iterator insertionPoint = std::lower_bound(begin(), end(), data, qcpLessThanSortKey<DataType>);
2717 mData.insert(insertionPoint, data);
2726 template <
class DataType>
2729 QCPDataContainer<DataType>::iterator it = begin();
2730 QCPDataContainer<DataType>::iterator itEnd = std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2731 mPreallocSize += itEnd-it;
2733 performAutoSqueeze();
2741 template <
class DataType>
2744 QCPDataContainer<DataType>::iterator it = std::upper_bound(begin(), end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2745 QCPDataContainer<DataType>::iterator itEnd = end();
2746 mData.erase(it, itEnd);
2748 performAutoSqueeze();
2758 template <
class DataType>
2761 if (sortKeyFrom >= sortKeyTo || isEmpty())
2764 QCPDataContainer<DataType>::iterator it = std::lower_bound(begin(), end(), DataType::fromSortKey(sortKeyFrom), qcpLessThanSortKey<DataType>);
2765 QCPDataContainer<DataType>::iterator itEnd = std::upper_bound(it, end(), DataType::fromSortKey(sortKeyTo), qcpLessThanSortKey<DataType>);
2766 mData.erase(it, itEnd);
2768 performAutoSqueeze();
2780 template <
class DataType>
2783 QCPDataContainer::iterator it = std::lower_bound(begin(), end(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2784 if (it != end() && it->sortKey() == sortKey)
2792 performAutoSqueeze();
2800 template <
class DataType>
2804 mPreallocIteration = 0;
2819 template <
class DataType>
2822 std::sort(begin(), end(), qcpLessThanSortKey<DataType>);
2835 template <
class DataType>
2840 if (mPreallocSize > 0)
2842 std::copy(begin(), end(), mData.begin());
2843 mData.resize(size());
2846 mPreallocIteration = 0;
2867 template <
class DataType>
2873 QCPDataContainer<DataType>::const_iterator it = std::lower_bound(constBegin(), constEnd(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2874 if (expandedRange && it != constBegin())
2894 template <
class DataType>
2900 QCPDataContainer<DataType>::const_iterator it = std::upper_bound(constBegin(), constEnd(), DataType::fromSortKey(sortKey), qcpLessThanSortKey<DataType>);
2901 if (expandedRange && it != constEnd())
2921 template <
class DataType>
2930 bool haveLower =
false;
2931 bool haveUpper =
false;
2934 QCPDataContainer<DataType>::const_iterator it = constBegin();
2935 QCPDataContainer<DataType>::const_iterator itEnd = constEnd();
2938 if (DataType::sortKeyIsMainKey())
2942 if (!qIsNaN(it->mainValue()))
2944 range.lower = it->mainKey();
2951 while (it != constBegin())
2954 if (!qIsNaN(it->mainValue()))
2956 range.upper = it->mainKey();
2965 if (!qIsNaN(it->mainValue()))
2967 current = it->mainKey();
2968 if (current < range.lower || !haveLower)
2970 range.lower = current;
2973 if (current > range.upper || !haveUpper)
2975 range.upper = current;
2986 if (!qIsNaN(it->mainValue()))
2988 current = it->mainKey();
2989 if ((current < range.lower || !haveLower) && current < 0)
2991 range.lower = current;
2994 if ((current > range.upper || !haveUpper) && current < 0)
2996 range.upper = current;
3006 if (!qIsNaN(it->mainValue()))
3008 current = it->mainKey();
3009 if ((current < range.lower || !haveLower) && current > 0)
3011 range.lower = current;
3014 if ((current > range.upper || !haveUpper) && current > 0)
3016 range.upper = current;
3024 foundRange = haveLower && haveUpper;
3044 template <
class DataType>
3053 const bool restrictKeyRange = inKeyRange !=
QCPRange();
3054 bool haveLower =
false;
3055 bool haveUpper =
false;
3057 QCPDataContainer<DataType>::const_iterator itBegin = constBegin();
3058 QCPDataContainer<DataType>::const_iterator itEnd = constEnd();
3059 if (DataType::sortKeyIsMainKey() && restrictKeyRange)
3061 itBegin = findBegin(inKeyRange.lower);
3062 itEnd = findEnd(inKeyRange.upper);
3066 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3068 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3070 current = it->valueRange();
3071 if ((current.lower < range.lower || !haveLower) && !qIsNaN(current.lower))
3073 range.lower = current.lower;
3076 if ((current.upper > range.upper || !haveUpper) && !qIsNaN(current.upper))
3078 range.upper = current.upper;
3084 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3086 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3088 current = it->valueRange();
3089 if ((current.lower < range.lower || !haveLower) && current.lower < 0 && !qIsNaN(current.lower))
3091 range.lower = current.lower;
3094 if ((current.upper > range.upper || !haveUpper) && current.upper < 0 && !qIsNaN(current.upper))
3096 range.upper = current.upper;
3102 for (QCPDataContainer<DataType>::const_iterator it = itBegin; it != itEnd; ++it)
3104 if (restrictKeyRange && (it->mainKey() < inKeyRange.lower || it->mainKey() > inKeyRange.upper))
3106 current = it->valueRange();
3107 if ((current.lower < range.lower || !haveLower) && current.lower > 0 && !qIsNaN(current.lower))
3109 range.lower = current.lower;
3112 if ((current.upper > range.upper || !haveUpper) && current.upper > 0 && !qIsNaN(current.upper))
3114 range.upper = current.upper;
3120 foundRange = haveLower && haveUpper;
3131 template <
class DataType>
3134 QCPDataRange iteratorRange(begin-constBegin(), end-constBegin());
3135 iteratorRange = iteratorRange.
bounded(dataRange.
bounded(this->dataRange()));
3136 begin = constBegin()+iteratorRange.begin();
3137 end = constBegin()+iteratorRange.end();
3149 template <
class DataType>
3152 if (minimumPreallocSize <= mPreallocSize)
3155 int newPreallocSize = minimumPreallocSize;
3156 newPreallocSize += (1u<<qBound(4, mPreallocIteration+4, 15)) - 12;
3157 ++mPreallocIteration;
3159 int sizeDifference = newPreallocSize-mPreallocSize;
3160 mData.resize(mData.size()+sizeDifference);
3161 std::copy_backward(mData.begin()+mPreallocSize, mData.end()-sizeDifference, mData.end());
3162 mPreallocSize = newPreallocSize;
3179 template <
class DataType>
3182 const int totalAlloc = mData.capacity();
3183 const int postAllocSize = totalAlloc-mData.
size();
3184 const int usedSize = size();
3185 bool shrinkPostAllocation =
false;
3186 bool shrinkPreAllocation =
false;
3187 if (totalAlloc > 650000)
3189 shrinkPostAllocation = postAllocSize > usedSize*1.5;
3190 shrinkPreAllocation = mPreallocSize*10 > usedSize;
3191 }
else if (totalAlloc > 1000)
3193 shrinkPostAllocation = postAllocSize > usedSize*5;
3194 shrinkPreAllocation = mPreallocSize > usedSize*1.5;
3197 if (shrinkPreAllocation || shrinkPostAllocation)
3198 squeeze(shrinkPreAllocation, shrinkPostAllocation);
3217 QPen pen()
const {
return mPen; }
3218 QBrush brush()
const {
return mBrush; }
3220 QCPScatterStyle::ScatterProperties usedScatterProperties()
const {
return mUsedScatterProperties; }
3223 void setPen(
const QPen &pen);
3224 void setBrush(
const QBrush &brush);
3226 void setUsedScatterProperties(
const QCPScatterStyle::ScatterProperties &properties);
3242 QCPScatterStyle::ScatterProperties mUsedScatterProperties;
3276 QString name()
const {
return mName; }
3277 bool antialiasedFill()
const {
return mAntialiasedFill; }
3278 bool antialiasedScatters()
const {
return mAntialiasedScatters; }
3279 QPen pen()
const {
return mPen; }
3280 QBrush brush()
const {
return mBrush; }
3281 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
3282 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
3284 bool selected()
const {
return !mSelection.isEmpty(); }
3307 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
3309 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
3313 void rescaleValueAxis(
bool onlyEnlarge=
false,
bool inKeyRange=
false)
const;
3327 bool mAntialiasedFill, mAntialiasedScatters;
3330 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3336 virtual QRect clipRect() const Q_DECL_OVERRIDE;
3337 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3338 virtual
QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
3339 void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
3341 virtual
void selectEvent(
QMouseEvent *event,
bool additive, const
QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3342 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3345 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const = 0;
3348 void applyFillAntialiasingHint(
QCPPainter *painter) const;
3349 void applyScattersAntialiasingHint(
QCPPainter *painter) const;
3374 QString name()
const {
return mName; }
3375 virtual QPointF pixelPosition()
const;
3385 QSet<QCPItemPosition*> mChildrenX, mChildrenY;
3423 Q_ENUMS(PositionType)
3430 PositionType typeX()
const {
return mPositionTypeX; }
3431 PositionType typeY()
const {
return mPositionTypeY; }
3433 QCPItemAnchor *parentAnchorX()
const {
return mParentAnchorX; }
3434 QCPItemAnchor *parentAnchorY()
const {
return mParentAnchorY; }
3435 double key()
const {
return mKey; }
3436 double value()
const {
return mValue; }
3438 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
3439 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
3444 void setType(PositionType type);
3445 void setTypeX(PositionType type);
3446 void setTypeY(PositionType type);
3447 bool setParentAnchor(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
3448 bool setParentAnchorX(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
3449 bool setParentAnchorY(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
3450 void setCoords(
double key,
double value);
3451 void setCoords(
const QPointF &coords);
3454 void setPixelPosition(
const QPointF &pixelPosition);
3458 PositionType mPositionTypeX, mPositionTypeY;
3459 QPointer<QCPAxis> mKeyAxis, mValueAxis;
3460 QPointer<QCPAxisRect> mAxisRect;
3461 double mKey, mValue;
3478 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
3479 Q_PROPERTY(
QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
3480 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
3481 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
3488 bool clipToAxisRect()
const {
return mClipToAxisRect; }
3490 bool selectable()
const {
return mSelectable; }
3491 bool selected()
const {
return mSelected; }
3494 void setClipToAxisRect(
bool clip);
3496 Q_SLOT
void setSelectable(
bool selectable);
3497 Q_SLOT
void setSelected(
bool selected);
3500 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE = 0;
3507 bool hasAnchor(
const QString &name)
const;
3510 void selectionChanged(
bool selected);
3511 void selectableChanged(
bool selectable);
3515 bool mClipToAxisRect;
3516 QPointer<QCPAxisRect> mClipAxisRect;
3519 bool mSelectable, mSelected;
3523 virtual QRect clipRect() const Q_DECL_OVERRIDE;
3524 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
3525 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
3527 virtual
void selectEvent(
QMouseEvent *event,
bool additive, const
QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3528 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
3531 virtual
QPointF anchorPixelPosition(
int anchorId) const;
3534 double rectDistance(const
QRectF &rect, const
QPointF &pos,
bool filledRect) const;
3555 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
3556 Q_PROPERTY(
QPixmap background READ background WRITE setBackground)
3557 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
3558 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
3560 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
3561 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
3562 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
3563 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
3564 Q_PROPERTY(
bool openGl READ openGl WRITE setOpenGl)
3575 Q_ENUMS(LayerInsertMode)
3587 Q_ENUMS(RefreshPriority)
3593 QRect viewport()
const {
return mViewport; }
3594 double bufferDevicePixelRatio()
const {
return mBufferDevicePixelRatio; }
3595 QPixmap background()
const {
return mBackgroundPixmap; }
3596 bool backgroundScaled()
const {
return mBackgroundScaled; }
3597 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
3599 QCP::AntialiasedElements antialiasedElements()
const {
return mAntialiasedElements; }
3600 QCP::AntialiasedElements notAntialiasedElements()
const {
return mNotAntialiasedElements; }
3601 bool autoAddPlottableToLegend()
const {
return mAutoAddPlottableToLegend; }
3602 const QCP::Interactions interactions()
const {
return mInteractions; }
3603 int selectionTolerance()
const {
return mSelectionTolerance; }
3604 bool noAntialiasingOnDrag()
const {
return mNoAntialiasingOnDrag; }
3605 QCP::PlottingHints plottingHints()
const {
return mPlottingHints; }
3606 Qt::KeyboardModifier multiSelectModifier()
const {
return mMultiSelectModifier; }
3609 bool openGl()
const {
return mOpenGl; }
3612 void setViewport(
const QRect &rect);
3613 void setBufferDevicePixelRatio(
double ratio);
3614 void setBackground(
const QPixmap &pm);
3615 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
3616 void setBackground(
const QBrush &brush);
3617 void setBackgroundScaled(
bool scaled);
3618 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
3619 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
3621 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
3623 void setAutoAddPlottableToLegend(
bool on);
3624 void setInteractions(
const QCP::Interactions &interactions);
3625 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
3626 void setSelectionTolerance(
int pixels);
3627 void setNoAntialiasingOnDrag(
bool enabled);
3628 void setPlottingHints(
const QCP::PlottingHints &hints);
3630 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
3633 void setOpenGl(
bool enabled,
int multisampling=16);
3640 bool removePlottable(
int index);
3641 int clearPlottables();
3642 int plottableCount()
const;
3652 bool removeGraph(
int index);
3654 int graphCount()
const;
3661 bool removeItem(
int index);
3663 int itemCount()
const;
3672 bool setCurrentLayer(
const QString &name);
3673 bool setCurrentLayer(
QCPLayer *layer);
3674 int layerCount()
const;
3675 bool addLayer(
const QString &name,
QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove);
3677 bool moveLayer(
QCPLayer *layer,
QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
3680 int axisRectCount()
const;
3685 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
3689 Q_SLOT
void deselectAll();
3696 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
3697 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
3719 void selectionChangedByUser();
3720 void beforeReplot();
3726 double mBufferDevicePixelRatio;
3728 bool mAutoAddPlottableToLegend;
3733 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
3734 QCP::Interactions mInteractions;
3735 int mSelectionTolerance;
3736 bool mNoAntialiasingOnDrag;
3739 QPixmap mScaledBackgroundPixmap;
3740 bool mBackgroundScaled;
3741 Qt::AspectRatioMode mBackgroundScaledMode;
3743 QCP::PlottingHints mPlottingHints;
3744 Qt::KeyboardModifier mMultiSelectModifier;
3751 QPoint mMousePressPos;
3752 bool mMouseHasMoved;
3753 QPointer<QCPLayerable> mMouseEventLayerable;
3754 QVariant mMouseEventLayerableDetails;
3757 int mOpenGlMultisamples;
3758 QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup;
3759 bool mOpenGlCacheLabelsBackup;
3760 #ifdef QCP_OPENGL_FBO 3761 QSharedPointer<QOpenGLContext> mGlContext;
3762 QSharedPointer<QSurface> mGlSurface;
3763 QSharedPointer<QOpenGLPaintDevice> mGlPaintDevice;
3767 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
3768 virtual QSize sizeHint() const Q_DECL_OVERRIDE;
3769 virtual
void paintEvent(
QPaintEvent *event) Q_DECL_OVERRIDE;
3770 virtual
void resizeEvent(
QResizeEvent *event) Q_DECL_OVERRIDE;
3771 virtual
void mouseDoubleClickEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3772 virtual
void mousePressEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3773 virtual
void mouseMoveEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3774 virtual
void mouseReleaseEvent(
QMouseEvent *event) Q_DECL_OVERRIDE;
3775 virtual
void wheelEvent(
QWheelEvent *event) Q_DECL_OVERRIDE;
3779 virtual
void updateLayout();
3780 virtual
void axisRemoved(
QCPAxis *axis);
3781 virtual
void legendRemoved(
QCPLegend *legend);
3782 Q_SLOT virtual
void processRectSelection(QRect rect,
QMouseEvent *event);
3783 Q_SLOT virtual
void processRectZoom(QRect rect,
QMouseEvent *event);
3784 Q_SLOT virtual
void processPointSelection(
QMouseEvent *event);
3788 bool registerGraph(
QCPGraph *graph);
3790 void updateLayerIndices() const;
3794 void setupPaintBuffers();
3796 bool hasInvalidatedPaintBuffers();
3821 virtual int dataCount()
const = 0;
3822 virtual double dataMainKey(
int index)
const = 0;
3823 virtual double dataSortKey(
int index)
const = 0;
3824 virtual double dataMainValue(
int index)
const = 0;
3825 virtual QCPRange dataValueRange(
int index)
const = 0;
3826 virtual QPointF dataPixelPosition(
int index)
const = 0;
3827 virtual bool sortKeyIsMainKey()
const = 0;
3829 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const = 0;
3830 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const = 0;
3833 template <
class DataType>
3851 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const;
3852 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const;
3860 QSharedPointer<QCPDataContainer<DataType> > mDataContainer;
4061 template <
class DataType>
4068 template <
class DataType>
4076 template <
class DataType>
4079 return mDataContainer->size();
4085 template <
class DataType>
4088 if (index >= 0 && index < mDataContainer->size())
4090 return (mDataContainer->constBegin()+index)->mainKey();
4093 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4101 template <
class DataType>
4104 if (index >= 0 && index < mDataContainer->size())
4106 return (mDataContainer->constBegin()+index)->sortKey();
4109 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4117 template <
class DataType>
4120 if (index >= 0 && index < mDataContainer->size())
4122 return (mDataContainer->constBegin()+index)->mainValue();
4125 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4133 template <
class DataType>
4136 if (index >= 0 && index < mDataContainer->size())
4138 return (mDataContainer->constBegin()+index)->valueRange();
4141 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4149 template <
class DataType>
4152 if (index >= 0 && index < mDataContainer->size())
4154 const typename QCPDataContainer<DataType>::const_iterator it = mDataContainer->constBegin()+index;
4155 return coordsToPixels(it->mainKey(), it->mainValue());
4158 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4166 template <
class DataType>
4169 return DataType::sortKeyIsMainKey();
4179 template <
class DataType>
4183 if ((onlySelectable && mSelectable ==
QCP::stNone) || mDataContainer->isEmpty())
4185 if (!mKeyAxis || !mValueAxis)
4189 double key1, value1, key2, value2;
4190 pixelsToCoords(rect.topLeft(), key1, value1);
4191 pixelsToCoords(rect.bottomRight(), key2, value2);
4193 QCPRange valueRange(value1, value2);
4194 typename QCPDataContainer<DataType>::const_iterator begin = mDataContainer->constBegin();
4195 typename QCPDataContainer<DataType>::const_iterator end = mDataContainer->constEnd();
4196 if (DataType::sortKeyIsMainKey())
4198 begin = mDataContainer->
findBegin(keyRange.lower,
false);
4199 end = mDataContainer->
findEnd(keyRange.upper,
false);
4204 int currentSegmentBegin = -1;
4205 for (
typename QCPDataContainer<DataType>::const_iterator it=begin; it!=end; ++it)
4207 if (currentSegmentBegin == -1)
4209 if (valueRange.
contains(it->mainValue()) && keyRange.contains(it->mainKey()))
4210 currentSegmentBegin = it-mDataContainer->constBegin();
4211 }
else if (!valueRange.
contains(it->mainValue()) || !keyRange.contains(it->mainKey()))
4214 currentSegmentBegin = -1;
4218 if (currentSegmentBegin != -1)
4228 template <
class DataType>
4231 return mDataContainer->findBegin(sortKey, expandedRange)-mDataContainer->constBegin();
4237 template <
class DataType>
4240 return mDataContainer->findEnd(sortKey, expandedRange)-mDataContainer->constBegin();
4250 template <
class DataType>
4253 if ((onlySelectable && mSelectable ==
QCP::stNone) || mDataContainer->isEmpty())
4255 if (!mKeyAxis || !mValueAxis)
4259 double minDistSqr = std::numeric_limits<double>::max();
4260 int minDistIndex = mDataContainer->size();
4262 typename QCPDataContainer<DataType>::const_iterator begin = mDataContainer->constBegin();
4263 typename QCPDataContainer<DataType>::const_iterator end = mDataContainer->constEnd();
4264 if (DataType::sortKeyIsMainKey())
4267 double posKeyMin, posKeyMax, dummy;
4268 pixelsToCoords(pos-
QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMin, dummy);
4269 pixelsToCoords(pos+
QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMax, dummy);
4270 if (posKeyMin > posKeyMax)
4271 qSwap(posKeyMin, posKeyMax);
4272 begin = mDataContainer->
findBegin(posKeyMin,
true);
4273 end = mDataContainer->
findEnd(posKeyMax,
true);
4277 QCPRange keyRange(mKeyAxis->range());
4278 QCPRange valueRange(mValueAxis->range());
4279 for (
typename QCPDataContainer<DataType>::const_iterator it=begin; it!=end; ++it)
4281 const double mainKey = it->mainKey();
4282 const double mainValue = it->mainValue();
4283 if (keyRange.contains(mainKey) && valueRange.contains(mainValue))
4286 if (currentDistSqr < minDistSqr)
4288 minDistSqr = currentDistSqr;
4289 minDistIndex = it-mDataContainer->constBegin();
4293 if (minDistIndex != mDataContainer->size())
4298 details->setValue(selectionResult);
4299 return qSqrt(minDistSqr);
4312 template <
class DataType>
4315 selectedSegments.clear();
4316 unselectedSegments.clear();
4342 template <
class DataType>
4347 painter->pen().style() == Qt::SolidLine &&
4352 bool lastIsNan =
false;
4353 const int lineDataSize = lineData.size();
4354 while (i < lineDataSize && (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x())))
4357 while (i < lineDataSize)
4359 if (!qIsNaN(lineData.at(i).y()) && !qIsNaN(lineData.at(i).x()))
4362 painter->
drawLine(lineData.at(i-1), lineData.at(i));
4371 int segmentStart = 0;
4373 const int lineDataSize = lineData.size();
4374 while (i < lineDataSize)
4376 if (qIsNaN(lineData.at(i).y()) || qIsNaN(lineData.at(i).x()) || qIsInf(lineData.at(i).y()))
4378 painter->drawPolyline(lineData.constData()+segmentStart, i-segmentStart);
4384 painter->drawPolyline(lineData.constData()+segmentStart, lineDataSize-segmentStart);
4408 Q_ENUMS(ColorInterpolation)
4427 Q_ENUMS(GradientPreset)
4432 bool operator!=(
const QCPColorGradient &other)
const {
return !(*
this == other); }
4435 int levelCount()
const {
return mLevelCount; }
4437 ColorInterpolation colorInterpolation()
const {
return mColorInterpolation; }
4438 bool periodic()
const {
return mPeriodic; }
4441 void setLevelCount(
int n);
4443 void setColorStopAt(
double position,
const QColor &color);
4444 void setColorInterpolation(ColorInterpolation interpolation);
4445 void setPeriodic(
bool enabled);
4448 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
4449 void colorize(
const double *data,
const unsigned char *alpha,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
4450 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
4451 void loadPreset(GradientPreset preset);
4452 void clearColorStops();
4459 ColorInterpolation mColorInterpolation;
4464 bool mColorBufferInvalidated;
4467 bool stopsUseAlpha()
const;
4468 void updateColorBuffer();
4496 Q_ENUMS(BracketStyle)
4502 QPen bracketPen()
const {
return mBracketPen; }
4503 QBrush bracketBrush()
const {
return mBracketBrush; }
4504 int bracketWidth()
const {
return mBracketWidth; }
4505 int bracketHeight()
const {
return mBracketHeight; }
4506 BracketStyle bracketStyle()
const {
return mBracketStyle; }
4507 bool tangentToData()
const {
return mTangentToData; }
4508 int tangentAverage()
const {
return mTangentAverage; }
4511 void setBracketPen(
const QPen &pen);
4512 void setBracketBrush(
const QBrush &brush);
4513 void setBracketWidth(
int width);
4514 void setBracketHeight(
int height);
4515 void setBracketStyle(BracketStyle style);
4516 void setTangentToData(
bool enabled);
4517 void setTangentAverage(
int pointCount);
4520 virtual void drawBracket(
QCPPainter *painter,
int direction)
const;
4531 BracketStyle mBracketStyle;
4532 bool mTangentToData;
4533 int mTangentAverage;
4552 Q_PROPERTY(
QPixmap background READ background WRITE setBackground)
4553 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
4554 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
4555 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
4556 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
4563 QPixmap background()
const {
return mBackgroundPixmap; }
4564 QBrush backgroundBrush()
const {
return mBackgroundBrush; }
4565 bool backgroundScaled()
const {
return mBackgroundScaled; }
4566 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
4567 Qt::Orientations rangeDrag()
const {
return mRangeDrag; }
4568 Qt::Orientations rangeZoom()
const {
return mRangeZoom; }
4569 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
4570 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
4573 double rangeZoomFactor(Qt::Orientation orientation);
4576 void setBackground(
const QPixmap &pm);
4577 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
4578 void setBackground(
const QBrush &brush);
4579 void setBackgroundScaled(
bool scaled);
4580 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
4581 void setRangeDrag(Qt::Orientations orientations);
4582 void setRangeZoom(Qt::Orientations orientations);
4589 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
4590 void setRangeZoomFactor(
double factor);
4599 bool removeAxis(
QCPAxis *axis);
4602 void zoom(
const QRectF &pixelRect);
4604 void setupFullAxesBox(
bool connectRanges=
false);
4610 int left()
const {
return mRect.left(); }
4611 int right()
const {
return mRect.right(); }
4612 int top()
const {
return mRect.top(); }
4613 int bottom()
const {
return mRect.bottom(); }
4614 int width()
const {
return mRect.width(); }
4615 int height()
const {
return mRect.height(); }
4616 QSize
size()
const {
return mRect.size(); }
4617 QPoint
topLeft()
const {
return mRect.topLeft(); }
4621 QPoint
center()
const {
return mRect.center(); }
4624 virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
4631 QPixmap mScaledBackgroundPixmap;
4632 bool mBackgroundScaled;
4633 Qt::AspectRatioMode mBackgroundScaledMode;
4635 Qt::Orientations mRangeDrag, mRangeZoom;
4638 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
4642 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
4648 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
4649 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4650 virtual int calculateAutoMargin(
QCP::MarginSide side) Q_DECL_OVERRIDE;
4651 virtual void layoutChanged() Q_DECL_OVERRIDE;
4653 virtual
void mousePressEvent(
QMouseEvent *event, const
QVariant &details) Q_DECL_OVERRIDE;
4654 virtual
void mouseMoveEvent(
QMouseEvent *event, const
QPointF &startPos) Q_DECL_OVERRIDE;
4655 virtual
void mouseReleaseEvent(
QMouseEvent *event, const
QPointF &startPos) Q_DECL_OVERRIDE;
4656 virtual
void wheelEvent(
QWheelEvent *event) Q_DECL_OVERRIDE;
4660 void updateAxesOffset(
QCPAxis::AxisType type);
4679 Q_PROPERTY(
QCPLegend* parentLegend READ parentLegend)
4680 Q_PROPERTY(
QFont font READ font WRITE setFont)
4681 Q_PROPERTY(
QColor textColor READ textColor WRITE setTextColor)
4682 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
4683 Q_PROPERTY(
QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
4684 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged)
4685 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
4691 QCPLegend *parentLegend()
const {
return mParentLegend; }
4692 QFont font()
const {
return mFont; }
4693 QColor textColor()
const {
return mTextColor; }
4694 QFont selectedFont()
const {
return mSelectedFont; }
4695 QColor selectedTextColor()
const {
return mSelectedTextColor; }
4696 bool selectable()
const {
return mSelectable; }
4697 bool selected()
const {
return mSelected; }
4700 void setFont(
const QFont &font);
4701 void setTextColor(
const QColor &color);
4702 void setSelectedFont(
const QFont &font);
4703 void setSelectedTextColor(
const QColor &color);
4704 Q_SLOT
void setSelectable(
bool selectable);
4705 Q_SLOT
void setSelected(
bool selected);
4708 virtual double selectTest(
const QPointF &pos,
bool onlySelectable,
QVariant *details=0)
const Q_DECL_OVERRIDE;
4711 void selectionChanged(
bool selected);
4712 void selectableChanged(
bool selectable);
4719 QFont mSelectedFont;
4720 QColor mSelectedTextColor;
4721 bool mSelectable, mSelected;
4725 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
4726 virtual QRect clipRect()
const Q_DECL_OVERRIDE;
4727 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE = 0;
4729 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4730 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4753 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4757 QPen getIconBorderPen()
const;
4758 QColor getTextColor()
const;
4759 QFont getFont()
const;
4767 Q_PROPERTY(
QPen borderPen READ borderPen WRITE setBorderPen)
4768 Q_PROPERTY(
QBrush brush READ brush WRITE setBrush)
4769 Q_PROPERTY(
QFont font READ font WRITE setFont)
4770 Q_PROPERTY(
QColor textColor READ textColor WRITE setTextColor)
4771 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
4772 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
4773 Q_PROPERTY(
QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
4774 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged)
4775 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged)
4776 Q_PROPERTY(
QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
4777 Q_PROPERTY(
QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
4778 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
4779 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
4780 Q_PROPERTY(
QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
4789 ,spLegendBox = 0x001
4792 Q_ENUMS(SelectablePart)
4793 Q_FLAGS(SelectableParts)
4794 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
4800 QPen borderPen()
const {
return mBorderPen; }
4801 QBrush brush()
const {
return mBrush; }
4802 QFont font()
const {
return mFont; }
4803 QColor textColor()
const {
return mTextColor; }
4804 QSize iconSize()
const {
return mIconSize; }
4805 int iconTextPadding()
const {
return mIconTextPadding; }
4806 QPen iconBorderPen()
const {
return mIconBorderPen; }
4807 SelectableParts selectableParts()
const {
return mSelectableParts; }
4808 SelectableParts selectedParts()
const;
4809 QPen selectedBorderPen()
const {
return mSelectedBorderPen; }
4810 QPen selectedIconBorderPen()
const {
return mSelectedIconBorderPen; }
4811 QBrush selectedBrush()
const {
return mSelectedBrush; }
4812 QFont selectedFont()
const {
return mSelectedFont; }
4813 QColor selectedTextColor()
const {
return mSelectedTextColor; }
4816 void setBorderPen(
const QPen &pen);
4817 void setBrush(
const QBrush &brush);
4818 void setFont(
const QFont &font);
4819 void setTextColor(
const QColor &color);
4820 void setIconSize(
const QSize &size);
4821 void setIconSize(
int width,
int height);
4822 void setIconTextPadding(
int padding);
4823 void setIconBorderPen(
const QPen &pen);
4824 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
4825 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
4826 void setSelectedBorderPen(
const QPen &pen);
4827 void setSelectedIconBorderPen(
const QPen &pen);
4828 void setSelectedBrush(
const QBrush &brush);
4829 void setSelectedFont(
const QFont &font);
4830 void setSelectedTextColor(
const QColor &color);
4838 int itemCount() const;
4842 bool removeItem(
int index);
4848 void selectionChanged(
QCPLegend::SelectableParts parts);
4849 void selectableChanged(
QCPLegend::SelectableParts parts);
4853 QPen mBorderPen, mIconBorderPen;
4858 int mIconTextPadding;
4859 SelectableParts mSelectedParts, mSelectableParts;
4860 QPen mSelectedBorderPen, mSelectedIconBorderPen;
4862 QFont mSelectedFont;
4863 QColor mSelectedTextColor;
4866 virtual
void parentPlotInitialized(
QCustomPlot *parentPlot) Q_DECL_OVERRIDE;
4867 virtual
QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE;
4868 virtual
void applyDefaultAntialiasingHint(
QCPPainter *painter) const Q_DECL_OVERRIDE;
4869 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4871 virtual
void selectEvent(
QMouseEvent *event,
bool additive, const
QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4872 virtual
void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4875 QPen getBorderPen() const;
4884 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPLegend::SelectableParts)
4885 Q_DECLARE_METATYPE(
QCPLegend::SelectablePart)
4897 Q_PROPERTY(
QString text READ text WRITE setText)
4898 Q_PROPERTY(
QFont font READ font WRITE setFont)
4899 Q_PROPERTY(
QColor textColor READ textColor WRITE setTextColor)
4900 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
4901 Q_PROPERTY(
QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
4902 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
4903 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
4913 QString text()
const {
return mText; }
4914 int textFlags()
const {
return mTextFlags; }
4915 QFont font()
const {
return mFont; }
4916 QColor textColor()
const {
return mTextColor; }
4917 QFont selectedFont()
const {
return mSelectedFont; }
4918 QColor selectedTextColor()
const {
return mSelectedTextColor; }
4919 bool selectable()
const {
return mSelectable; }
4920 bool selected()
const {
return mSelected; }
4923 void setText(
const QString &text);
4924 void setTextFlags(
int flags);
4925 void setFont(
const QFont &font);
4926 void setTextColor(
const QColor &color);
4927 void setSelectedFont(
const QFont &font);
4928 void setSelectedTextColor(
const QColor &color);
4929 Q_SLOT
void setSelectable(
bool selectable);
4930 Q_SLOT
void setSelected(
bool selected);
4939 void selectionChanged(
bool selected);
4940 void selectableChanged(
bool selectable);
4950 QFont mSelectedFont;
4951 QColor mSelectedTextColor;
4952 QRect mTextBoundingRect;
4953 bool mSelectable, mSelected;
4956 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
4957 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
4961 virtual void selectEvent(
QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4962 virtual void deselectEvent(
bool *selectionStateChanged) Q_DECL_OVERRIDE;
4965 QFont mainFont()
const;
4966 QColor mainTextColor()
const;
4989 bool mGradientImageInvalidated;
4991 using QCPAxisRect::calculateAutoMargin;
4998 void updateGradientImage();
4999 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
5000 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
5010 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
5011 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
5012 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
5013 Q_PROPERTY(
QString label READ label WRITE setLabel)
5014 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
5015 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
5016 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
5025 QCPRange dataRange()
const {
return mDataRange; }
5029 int barWidth ()
const {
return mBarWidth; }
5030 bool rangeDrag()
const;
5031 bool rangeZoom()
const;
5035 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5038 void setLabel(
const QString &str);
5039 void setBarWidth(
int width);
5040 void setRangeDrag(
bool enabled);
5041 void setRangeZoom(
bool enabled);
5045 void rescaleDataRange(
bool onlyVisibleMaps);
5048 virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE;
5051 void dataRangeChanged(
const QCPRange &newRange);
5064 QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
5065 QPointer<QCPAxis> mColorAxis;
5068 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const Q_DECL_OVERRIDE;
5123 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5124 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
5125 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
5126 Q_PROPERTY(
QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
5127 Q_PROPERTY(
bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
5149 QSharedPointer<QCPGraphDataContainer>
data()
const {
return mDataContainer; }
5150 LineStyle lineStyle()
const {
return mLineStyle; }
5152 int scatterSkip()
const {
return mScatterSkip; }
5153 QCPGraph *channelFillGraph()
const {
return mChannelFillGraph.
data(); }
5154 bool adaptiveSampling()
const {
return mAdaptiveSampling; }
5157 void setData(QSharedPointer<QCPGraphDataContainer> data);
5159 void setLineStyle(LineStyle ls);
5161 void setScatterSkip(
int skip);
5162 void setChannelFillGraph(
QCPGraph *targetGraph);
5163 void setAdaptiveSampling(
bool enabled);
5167 void addData(
double key,
double value);
5171 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5172 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5176 LineStyle mLineStyle;
5179 QPointer<
QCPGraph> mChannelFillGraph;
5180 bool mAdaptiveSampling;
5183 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5184 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const Q_DECL_OVERRIDE;
5206 QPointF lowerFillBasePoint(
double lowerKey) const;
5207 QPointF upperFillBasePoint(
double upperKey) const;
5209 int findIndexBelowX(const
QVector<
QPointF> *data,
double x) const;
5210 int findIndexAboveX(const
QVector<
QPointF> *data,
double x) const;
5211 int findIndexBelowY(const
QVector<
QPointF> *data,
double y) const;
5212 int findIndexAboveY(const
QVector<
QPointF> *data,
double y) const;
5218 Q_DECLARE_METATYPE(
QCPGraph::LineStyle)
5241 double t, key, value;
5262 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
5263 Q_PROPERTY(
int scatterSkip READ scatterSkip WRITE setScatterSkip)
5264 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
5281 QSharedPointer<QCPCurveDataContainer>
data()
const {
return mDataContainer; }
5283 int scatterSkip()
const {
return mScatterSkip; }
5284 LineStyle lineStyle()
const {
return mLineStyle; }
5287 void setData(QSharedPointer<QCPCurveDataContainer> data);
5291 void setScatterSkip(
int skip);
5292 void setLineStyle(LineStyle style);
5297 void addData(
double t,
double key,
double value);
5298 void addData(
double key,
double value);
5302 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5303 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5309 LineStyle mLineStyle;
5312 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5313 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const Q_DECL_OVERRIDE;
5322 int getRegion(
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin) const;
5323 QPointF getOptimizedPoint(
int prevRegion,
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin) const;
5324 QVector<
QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin) const;
5325 bool mayTraverse(
int prevRegion,
int currentRegion) const;
5326 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
double keyMin,
double valueMax,
double keyMax,
double valueMin,
QPointF &crossA,
QPointF &crossB) const;
5327 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double keyMin,
double valueMax,
double keyMax,
double valueMin,
QVector<
QPointF> &beforeTraverse,
QVector<
QPointF> &afterTraverse) const;
5333 Q_DECLARE_METATYPE(
QCPCurve::LineStyle)
5345 Q_PROPERTY(
SpacingType spacingType READ spacingType WRITE setSpacingType)
5346 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
5359 Q_ENUMS(SpacingType)
5365 SpacingType spacingType()
const {
return mSpacingType; }
5366 double spacing()
const {
return mSpacing; }
5369 void setSpacingType(SpacingType spacingType);
5370 void setSpacing(
double spacing);
5374 QCPBars* bars(
int index)
const;
5375 int size()
const {
return mBars.size(); }
5380 void insert(
int i,
QCPBars *bars);
5386 SpacingType mSpacingType;
5391 void registerBars(
QCPBars *bars);
5392 void unregisterBars(
QCPBars *bars);
5395 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
5396 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
5423 Q_DECLARE_TYPEINFO(
QCPBarsData, Q_PRIMITIVE_TYPE);
5441 Q_PROPERTY(
double width READ width WRITE setWidth)
5442 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
5443 Q_PROPERTY(
QCPBarsGroup* barsGroup READ barsGroup WRITE setBarsGroup)
5444 Q_PROPERTY(
double baseValue READ baseValue WRITE setBaseValue)
5445 Q_PROPERTY(
double stackingGap READ stackingGap WRITE setStackingGap)
5446 Q_PROPERTY(
QCPBars* barBelow READ barBelow)
5447 Q_PROPERTY(
QCPBars* barAbove READ barAbove)
5466 double width()
const {
return mWidth; }
5467 WidthType widthType()
const {
return mWidthType; }
5469 double baseValue()
const {
return mBaseValue; }
5470 double stackingGap()
const {
return mStackingGap; }
5473 QSharedPointer<QCPBarsDataContainer>
data()
const {
return mDataContainer; }
5476 void setData(QSharedPointer<QCPBarsDataContainer> data);
5478 void setWidth(
double width);
5479 void setWidthType(WidthType widthType);
5481 void setBaseValue(
double baseValue);
5482 void setStackingGap(
double pixels);
5486 void addData(
double key,
double value);
5487 void moveBelow(
QCPBars *bars);
5488 void moveAbove(
QCPBars *bars);
5493 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5494 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5495 virtual
QPointF dataPixelPosition(
int index) const Q_DECL_OVERRIDE;
5500 WidthType mWidthType;
5503 double mStackingGap;
5504 QPointer<
QCPBars> mBarBelow, mBarAbove;
5507 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5508 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const Q_DECL_OVERRIDE;
5512 QRectF getBarRect(
double key,
double value) const;
5513 void getPixelWidth(
double key,
double &lower,
double &upper) const;
5514 double getStackedBaseValue(
double key,
bool positive) const;
5521 Q_DECLARE_METATYPE(
QCPBars::WidthType)
5550 double key, minimum, lowerQuartile, median, upperQuartile, maximum;
5572 Q_PROPERTY(
double width READ width WRITE setWidth)
5573 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
5574 Q_PROPERTY(
QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
5575 Q_PROPERTY(
QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
5576 Q_PROPERTY(
bool whiskerAntialiased READ whiskerAntialiased WRITE setWhiskerAntialiased)
5577 Q_PROPERTY(
QPen medianPen READ medianPen WRITE setMedianPen)
5578 Q_PROPERTY(
QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
5584 QSharedPointer<QCPStatisticalBoxDataContainer>
data()
const {
return mDataContainer; }
5585 double width()
const {
return mWidth; }
5586 double whiskerWidth()
const {
return mWhiskerWidth; }
5587 QPen whiskerPen()
const {
return mWhiskerPen; }
5588 QPen whiskerBarPen()
const {
return mWhiskerBarPen; }
5589 bool whiskerAntialiased()
const {
return mWhiskerAntialiased; }
5590 QPen medianPen()
const {
return mMedianPen; }
5594 void setData(QSharedPointer<QCPStatisticalBoxDataContainer> data);
5596 void setWidth(
double width);
5597 void setWhiskerWidth(
double width);
5598 void setWhiskerPen(
const QPen &pen);
5599 void setWhiskerBarPen(
const QPen &pen);
5600 void setWhiskerAntialiased(
bool enabled);
5601 void setMedianPen(
const QPen &pen);
5606 void addData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum,
const QVector<double> &outliers=
QVector<double>());
5611 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5612 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5617 double mWhiskerWidth;
5618 QPen mWhiskerPen, mWhiskerBarPen;
5619 bool mWhiskerAntialiased;
5624 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5625 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const Q_DECL_OVERRIDE;
5655 int keySize()
const {
return mKeySize; }
5656 int valueSize()
const {
return mValueSize; }
5657 QCPRange keyRange()
const {
return mKeyRange; }
5658 QCPRange valueRange()
const {
return mValueRange; }
5659 QCPRange dataBounds()
const {
return mDataBounds; }
5660 double data(
double key,
double value);
5661 double cell(
int keyIndex,
int valueIndex);
5662 unsigned char alpha(
int keyIndex,
int valueIndex);
5665 void setSize(
int keySize,
int valueSize);
5666 void setKeySize(
int keySize);
5667 void setValueSize(
int valueSize);
5669 void setKeyRange(
const QCPRange &keyRange);
5670 void setValueRange(
const QCPRange &valueRange);
5671 void setData(
double key,
double value,
double z);
5672 void setCell(
int keyIndex,
int valueIndex,
double z);
5673 void setAlpha(
int keyIndex,
int valueIndex,
unsigned char alpha);
5676 void recalculateDataBounds();
5679 void fill(
double z);
5680 void fillAlpha(
unsigned char alpha);
5682 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
5683 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
5687 int mKeySize, mValueSize;
5693 unsigned char *mAlpha;
5697 bool createAlpha(
bool initializeOpaque=
true);
5707 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
5708 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
5709 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
5710 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
5711 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
5712 Q_PROPERTY(
QCPColorScale* colorScale READ colorScale WRITE setColorScale)
5720 QCPRange dataRange()
const {
return mDataRange; }
5722 bool interpolate()
const {
return mInterpolate; }
5723 bool tightBoundary()
const {
return mTightBoundary; }
5725 QCPColorScale *colorScale()
const {
return mColorScale.data(); }
5729 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
5732 void setInterpolate(
bool enabled);
5733 void setTightBoundary(
bool enabled);
5737 void rescaleDataRange(
bool recalculateDataBounds=
false);
5738 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
5742 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5743 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5746 void dataRangeChanged(const
QCPRange &newRange);
5747 void dataScaleTypeChanged(
QCPAxis::ScaleType scaleType);
5753 QCPAxis::ScaleType mDataScaleType;
5757 bool mTightBoundary;
5761 QImage mMapImage, mUndersampledMapImage;
5763 bool mMapImageInvalidated;
5766 virtual
void updateMapImage();
5769 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5770 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const Q_DECL_OVERRIDE;
5786 QCPFinancialData(
double key,
double open,
double high,
double low,
double close);
5797 double key, open, high, low, close;
5817 Q_PROPERTY(
ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
5818 Q_PROPERTY(
double width READ width WRITE setWidth)
5819 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
5820 Q_PROPERTY(
bool twoColored READ twoColored WRITE setTwoColored)
5821 Q_PROPERTY(
QBrush brushPositive READ brushPositive WRITE setBrushPositive)
5822 Q_PROPERTY(
QBrush brushNegative READ brushNegative WRITE setBrushNegative)
5823 Q_PROPERTY(
QPen penPositive READ penPositive WRITE setPenPositive)
5824 Q_PROPERTY(
QPen penNegative READ penNegative WRITE setPenNegative)
5853 QSharedPointer<QCPFinancialDataContainer>
data()
const {
return mDataContainer; }
5854 ChartStyle chartStyle()
const {
return mChartStyle; }
5855 double width()
const {
return mWidth; }
5856 WidthType widthType()
const {
return mWidthType; }
5857 bool twoColored()
const {
return mTwoColored; }
5858 QBrush brushPositive()
const {
return mBrushPositive; }
5859 QBrush brushNegative()
const {
return mBrushNegative; }
5860 QPen penPositive()
const {
return mPenPositive; }
5861 QPen penNegative()
const {
return mPenNegative; }
5864 void setData(QSharedPointer<QCPFinancialDataContainer> data);
5866 void setChartStyle(ChartStyle style);
5867 void setWidth(
double width);
5868 void setWidthType(WidthType widthType);
5869 void setTwoColored(
bool twoColored);
5870 void setBrushPositive(
const QBrush &brush);
5871 void setBrushNegative(
const QBrush &brush);
5872 void setPenPositive(
const QPen &pen);
5873 void setPenNegative(
const QPen &pen);
5877 void addData(
double key,
double open,
double high,
double low,
double close);
5882 virtual
QCPRange getKeyRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth) const Q_DECL_OVERRIDE;
5883 virtual
QCPRange getValueRange(
bool &foundRange,
QCP::SignDomain inSignDomain=
QCP::sdBoth, const
QCPRange &inKeyRange=
QCPRange()) const Q_DECL_OVERRIDE;
5890 ChartStyle mChartStyle;
5892 WidthType mWidthType;
5894 QBrush mBrushPositive, mBrushNegative;
5895 QPen mPenPositive, mPenNegative;
5898 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
5899 virtual
void drawLegendIcon(
QCPPainter *painter, const
QRectF &rect) const Q_DECL_OVERRIDE;
5904 double getPixelWidth(
double key,
double keyPixel) const;
5928 double errorMinus, errorPlus;
5954 Q_PROPERTY(QSharedPointer<QCPErrorBarsDataContainer> data READ data WRITE setData)
5956 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
5957 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
5958 Q_PROPERTY(
double symbolGap READ symbolGap WRITE setSymbolGap)
5976 QSharedPointer<QCPErrorBarsDataContainer>
data()
const {
return mDataContainer; }
5978 ErrorType errorType()
const {
return mErrorType; }
5979 double whiskerWidth()
const {
return mWhiskerWidth; }
5980 double symbolGap()
const {
return mSymbolGap; }
5983 void setData(QSharedPointer<QCPErrorBarsDataContainer> data);
5987 void setErrorType(ErrorType type);
5988 void setWhiskerWidth(
double pixels);
5989 void setSymbolGap(
double pixels);
5994 void addData(
double error);
5995 void addData(
double errorMinus,
double errorPlus);
6006 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const;
6007 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const;
6015 QSharedPointer<QCPErrorBarsDataContainer> mDataContainer;
6016 QPointer<QCPAbstractPlottable> mDataPlottable;
6017 ErrorType mErrorType;
6018 double mWhiskerWidth;
6022 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6023 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const Q_DECL_OVERRIDE;
6033 bool errorBarVisible(
int index) const;
6034 bool rectIntersectsLine(const
QRectF &pixelRect, const
QLineF &line) const;
6050 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6051 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6058 QPen pen()
const {
return mPen; }
6059 QPen selectedPen()
const {
return mSelectedPen; }
6063 void setSelectedPen(
const QPen &pen);
6073 QPen mPen, mSelectedPen;
6076 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6080 QPen mainPen()
const;
6093 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6094 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6103 QPen pen()
const {
return mPen; }
6104 QPen selectedPen()
const {
return mSelectedPen; }
6109 void setPen(
const QPen &pen);
6110 void setSelectedPen(
const QPen &pen);
6122 QPen mPen, mSelectedPen;
6126 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6130 QPen mainPen()
const;
6143 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6144 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6153 QPen pen()
const {
return mPen; }
6154 QPen selectedPen()
const {
return mSelectedPen; }
6159 void setPen(
const QPen &pen);
6160 void setSelectedPen(
const QPen &pen);
6174 QPen mPen, mSelectedPen;
6178 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6181 QPen mainPen()
const;
6194 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6195 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6196 Q_PROPERTY(
QBrush brush READ brush WRITE setBrush)
6197 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6204 QPen pen()
const {
return mPen; }
6205 QPen selectedPen()
const {
return mSelectedPen; }
6206 QBrush brush()
const {
return mBrush; }
6207 QBrush selectedBrush()
const {
return mSelectedBrush; }
6210 void setPen(
const QPen &pen);
6211 void setSelectedPen(
const QPen &pen);
6212 void setBrush(
const QBrush &brush);
6213 void setSelectedBrush(
const QBrush &brush);
6228 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
6231 QPen mPen, mSelectedPen;
6232 QBrush mBrush, mSelectedBrush;
6235 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6236 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6239 QPen mainPen()
const;
6240 QBrush mainBrush()
const;
6253 Q_PROPERTY(
QColor color READ color WRITE setColor)
6254 Q_PROPERTY(
QColor selectedColor READ selectedColor WRITE setSelectedColor)
6255 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6256 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6257 Q_PROPERTY(
QBrush brush READ brush WRITE setBrush)
6258 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6259 Q_PROPERTY(
QFont font READ font WRITE setFont)
6260 Q_PROPERTY(
QFont selectedFont READ selectedFont WRITE setSelectedFont)
6261 Q_PROPERTY(
QString text READ text WRITE setText)
6262 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
6263 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
6264 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
6265 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
6272 QColor color()
const {
return mColor; }
6273 QColor selectedColor()
const {
return mSelectedColor; }
6274 QPen pen()
const {
return mPen; }
6275 QPen selectedPen()
const {
return mSelectedPen; }
6276 QBrush brush()
const {
return mBrush; }
6277 QBrush selectedBrush()
const {
return mSelectedBrush; }
6278 QFont font()
const {
return mFont; }
6279 QFont selectedFont()
const {
return mSelectedFont; }
6280 QString text()
const {
return mText; }
6281 Qt::Alignment positionAlignment()
const {
return mPositionAlignment; }
6282 Qt::Alignment textAlignment()
const {
return mTextAlignment; }
6283 double rotation()
const {
return mRotation; }
6284 QMargins padding()
const {
return mPadding; }
6287 void setColor(
const QColor &color);
6288 void setSelectedColor(
const QColor &color);
6289 void setPen(
const QPen &pen);
6290 void setSelectedPen(
const QPen &pen);
6291 void setBrush(
const QBrush &brush);
6292 void setSelectedBrush(
const QBrush &brush);
6293 void setFont(
const QFont &font);
6294 void setSelectedFont(
const QFont &font);
6295 void setText(
const QString &text);
6296 void setPositionAlignment(Qt::Alignment alignment);
6297 void setTextAlignment(Qt::Alignment alignment);
6298 void setRotation(
double degrees);
6299 void setPadding(
const QMargins &padding);
6315 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
6318 QColor mColor, mSelectedColor;
6319 QPen mPen, mSelectedPen;
6320 QBrush mBrush, mSelectedBrush;
6321 QFont mFont, mSelectedFont;
6323 Qt::Alignment mPositionAlignment;
6324 Qt::Alignment mTextAlignment;
6329 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6330 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6333 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
6334 QFont mainFont()
const;
6335 QColor mainColor()
const;
6336 QPen mainPen()
const;
6337 QBrush mainBrush()
const;
6350 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6351 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6352 Q_PROPERTY(
QBrush brush READ brush WRITE setBrush)
6353 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6360 QPen pen()
const {
return mPen; }
6361 QPen selectedPen()
const {
return mSelectedPen; }
6362 QBrush brush()
const {
return mBrush; }
6363 QBrush selectedBrush()
const {
return mSelectedBrush; }
6366 void setPen(
const QPen &pen);
6367 void setSelectedPen(
const QPen &pen);
6368 void setBrush(
const QBrush &brush);
6369 void setSelectedBrush(
const QBrush &brush);
6387 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
6390 QPen mPen, mSelectedPen;
6391 QBrush mBrush, mSelectedBrush;
6394 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6395 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6398 QPen mainPen()
const;
6399 QBrush mainBrush()
const;
6412 Q_PROPERTY(
QPixmap pixmap READ pixmap WRITE setPixmap)
6413 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
6414 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
6415 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
6416 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6417 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6424 QPixmap pixmap()
const {
return mPixmap; }
6425 bool scaled()
const {
return mScaled; }
6426 Qt::AspectRatioMode aspectRatioMode()
const {
return mAspectRatioMode; }
6427 Qt::TransformationMode transformationMode()
const {
return mTransformationMode; }
6428 QPen pen()
const {
return mPen; }
6429 QPen selectedPen()
const {
return mSelectedPen; }
6432 void setPixmap(
const QPixmap &pixmap);
6433 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
6434 void setPen(
const QPen &pen);
6435 void setSelectedPen(
const QPen &pen);
6450 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
6456 bool mScaledPixmapInvalidated;
6457 Qt::AspectRatioMode mAspectRatioMode;
6458 Qt::TransformationMode mTransformationMode;
6459 QPen mPen, mSelectedPen;
6462 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6463 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6466 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
6467 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
6468 QPen mainPen()
const;
6481 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6482 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6483 Q_PROPERTY(
QBrush brush READ brush WRITE setBrush)
6484 Q_PROPERTY(
QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
6485 Q_PROPERTY(
double size READ size WRITE setSize)
6486 Q_PROPERTY(
TracerStyle style READ style WRITE setStyle)
6487 Q_PROPERTY(
QCPGraph* graph READ graph WRITE setGraph)
6488 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
6489 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
6503 Q_ENUMS(TracerStyle)
6509 QPen pen()
const {
return mPen; }
6510 QPen selectedPen()
const {
return mSelectedPen; }
6511 QBrush brush()
const {
return mBrush; }
6512 QBrush selectedBrush()
const {
return mSelectedBrush; }
6513 double size()
const {
return mSize; }
6514 TracerStyle style()
const {
return mStyle; }
6515 QCPGraph *graph()
const {
return mGraph; }
6516 double graphKey()
const {
return mGraphKey; }
6517 bool interpolating()
const {
return mInterpolating; }
6520 void setPen(
const QPen &pen);
6521 void setSelectedPen(
const QPen &pen);
6522 void setBrush(
const QBrush &brush);
6523 void setSelectedBrush(
const QBrush &brush);
6524 void setSize(
double size);
6525 void setStyle(TracerStyle style);
6527 void setGraphKey(
double key);
6528 void setInterpolating(
bool enabled);
6534 void updatePosition();
6540 QPen mPen, mSelectedPen;
6541 QBrush mBrush, mSelectedBrush;
6546 bool mInterpolating;
6549 virtual
void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6552 QPen mainPen() const;
6553 QBrush mainBrush() const;
6567 Q_PROPERTY(
QPen pen READ pen WRITE setPen)
6568 Q_PROPERTY(
QPen selectedPen READ selectedPen WRITE setSelectedPen)
6569 Q_PROPERTY(
double length READ length WRITE setLength)
6570 Q_PROPERTY(
BracketStyle style READ style WRITE setStyle)
6584 Q_ENUMS(BracketStyle)
6590 QPen pen()
const {
return mPen; }
6591 QPen selectedPen()
const {
return mSelectedPen; }
6592 double length()
const {
return mLength; }
6593 BracketStyle style()
const {
return mStyle; }
6596 void setPen(
const QPen &pen);
6597 void setSelectedPen(
const QPen &pen);
6598 void setLength(
double length);
6599 void setStyle(BracketStyle style);
6610 enum AnchorIndex {aiCenter};
6611 QPen mPen, mSelectedPen;
6613 BracketStyle mStyle;
6616 virtual void draw(
QCPPainter *painter) Q_DECL_OVERRIDE;
6617 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6620 QPen mainPen()
const;
6627 #endif // QCUSTOMPLOT_H 0x02 right margin
Definition: qcustomplot.h:194
ColorInterpolation
Definition: qcustomplot.h:4405
void setBrush(const QBrush &brush)
Definition: qcustomplot.cpp:10517
bool isEmpty() const
Definition: qcustomplot.h:5681
BracketStyle
Definition: qcustomplot.h:6579
const_iterator constBegin() const
Definition: qcustomplot.h:2404
virtual QCPItemPosition * toQCPItemPosition() Q_DECL_OVERRIDE
Definition: qcustomplot.h:3465
bool addToLegend()
Definition: qcustomplot.cpp:10854
The base class tick generator used by QCPAxis to create tick positions and tick labels.
Definition: qcustomplot.h:1511
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
Definition: qcustomplot.h:248
double mainValue() const
Definition: qcustomplot.h:5237
QCPRange valueRange() const
Definition: qcustomplot.h:5101
Manages the position of an item.
Definition: qcustomplot.h:3404
EndingStyle
Definition: qcustomplot.h:1462
QCPRange & operator/=(const double &value)
Definition: qcustomplot.h:783
A text label.
Definition: qcustomplot.h:6249
int size() const
Definition: qcustomplot.h:2383
Definition: qcustomplot.h:2232
QCPDataRange dataRange() const
Definition: qcustomplot.h:2413
double mainValue() const
Definition: qcustomplot.h:5099
0x0200 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:220
int top() const
Definition: qcustomplot.h:4612
void setName(const QString &name)
Definition: qcustomplot.cpp:10468
void setX(double x)
Definition: qcustomplot.h:394
int dataRangeCount() const
Definition: qcustomplot.h:946
bool isEmpty() const
Definition: qcustomplot.h:955
Any combination of data points/ranges can be selected.
Definition: qcustomplot.h:292
The abstract base class for layouts.
Definition: qcustomplot.h:1262
Resolution is given in dots per inch (DPI/PPI)
Definition: qcustomplot.h:164
bool realVisibility() const
Definition: qcustomplot.cpp:1432
void selectionChanged(bool selected)
Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi...
Definition: qcustomplot.h:1746
void setBegin(int begin)
Definition: qcustomplot.h:903
void setKeyAxis(QCPAxis *axis)
Definition: qcustomplot.cpp:10533
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:706
Cosmetic pens are converted to pens with pixel width 1 when exporting.
Definition: qcustomplot.h:172
A curved line from one point to another.
Definition: qcustomplot.h:6139
QList< QCPDataRange > dataRanges() const
Definition: qcustomplot.h:949
int length() const
Definition: qcustomplot.h:900
virtual double dataMainValue(int index) const =0
Controls how a plottable's data selection is drawn.
Definition: qcustomplot.h:3209
void remove(double sortKeyFrom, double sortKeyTo)
Definition: qcustomplot.h:2759
Represents the range an axis is encompassing.
Definition: qcustomplot.h:769
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:3388
An arbitrary pixmap.
Definition: qcustomplot.h:6408
LineStyle
Definition: qcustomplot.h:5135
LayerMode
Definition: qcustomplot.h:640
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:3437
A straight line that spans infinitely in both directions.
Definition: qcustomplot.h:6046
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
Definition: qcustomplot.cpp:1708
const_iterator at(int index) const
Definition: qcustomplot.h:2410
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5414
bool isActive() const
Definition: qcustomplot.h:1103
Definition: qcustomplot.h:136
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE=0
Holds the data of one single data point for QCPCurve.
Definition: qcustomplot.h:5226
virtual QCPRange dataValueRange(int index) const
Definition: qcustomplot.h:4134
int index() const
Definition: qcustomplot.h:651
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition: qcustomplot.h:237
bool contains(QCPBars *bars) const
Definition: qcustomplot.h:5378
virtual QSize minimumSizeHint() const
Definition: qcustomplot.cpp:3396
QCPRange & operator+=(const double &value)
Definition: qcustomplot.h:780
Holds the data of one single data point (one bar) for QCPBars.
Definition: qcustomplot.h:5406
InsetPlacement
Definition: qcustomplot.h:1398
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
Definition: qcustomplot.h:3045
Provides rect/rubber-band data selection and range zoom interaction.
Definition: qcustomplot.h:1091
0x0000 No elements
Definition: qcustomplot.h:223
ErrorType
Definition: qcustomplot.h:5968
int size() const
Definition: qcustomplot.h:899
QSharedPointer< QCPErrorBarsDataContainer > data() const
Definition: qcustomplot.h:5976
Definition: qcustomplot.h:4981
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.h:4251
virtual bool sortKeyIsMainKey() const
Definition: qcustomplot.h:4167
Represents the visual appearance of scatter points.
Definition: qcustomplot.h:2258
static QCPStatisticalBoxData fromSortKey(double sortKey)
Definition: qcustomplot.h:5536
QSharedPointer< QCPAxisTicker > ticker() const
Definition: qcustomplot.h:1989
void removeBefore(double sortKey)
Definition: qcustomplot.h:2727
double sortKey() const
Definition: qcustomplot.h:5535
virtual double dataMainKey(int index) const
Definition: qcustomplot.h:4086
void set(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:2602
Specialized axis ticker for calendar dates and times as axis ticks.
Definition: qcustomplot.h:1572
virtual double dataMainValue(int index) const
Definition: qcustomplot.h:4118
Defines an abstract interface for one-dimensional plottables.
Definition: qcustomplot.h:3817
ResolutionUnit
Definition: qcustomplot.h:162
Specialized axis ticker suited for logarithmic axes.
Definition: qcustomplot.h:1805
0x04 top margin
Definition: qcustomplot.h:195
A plottable representing a single statistical box in a plot.
Definition: qcustomplot.h:5568
SignDomain
Definition: qcustomplot.h:183
0x0020 Main lines of plottables
Definition: qcustomplot.h:216
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:16944
void simplify()
Definition: qcustomplot.cpp:2568
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:4600
A rectangle.
Definition: qcustomplot.h:6190
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5537
bool isEmpty() const
Definition: qcustomplot.h:908
QCPGrid * grid() const
Definition: qcustomplot.h:2026
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
Definition: qcustomplot.h:5584
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
Definition: qcustomplot.h:4343
When dragging the mouse, a selection rect becomes active. Upon releasing, the axes that are currently...
Definition: qcustomplot.h:265
RefreshPriority
Definition: qcustomplot.h:3582
QMap< double, QString > & ticks()
Definition: qcustomplot.h:1713
A layout element displaying a text.
Definition: qcustomplot.h:4893
Q_SLOT void setSelection(QCPDataSelection selection)
Definition: qcustomplot.cpp:10573
const_iterator constEnd() const
Definition: qcustomplot.h:2405
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17615
void setY(double y)
Definition: qcustomplot.h:395
A layer that may contain objects, to control the rendering order.
Definition: qcustomplot.h:620
QPoint bottomRight() const
Definition: qcustomplot.h:4620
0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixma...
Definition: qcustomplot.h:463
double lengthSquared() const
Definition: qcustomplot.h:399
double mainKey() const
Definition: qcustomplot.h:5539
Handles the different ending decorations for line-like items.
Definition: qcustomplot.h:1447
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:185
Responsible for drawing the grid of a QCPAxis.
Definition: qcustomplot.h:1838
double mainKey() const
Definition: qcustomplot.h:5236
TickStepStrategy
Definition: qcustomplot.h:1520
const_iterator findEnd(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:2895
Describes a data set by holding multiple QCPDataRange instances.
Definition: qcustomplot.h:924
void sort()
Definition: qcustomplot.h:2820
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition: qcustomplot.h:250
0xFF all margins
Definition: qcustomplot.h:197
void expand(const QCPRange &otherRange)
Definition: qcustomplot.cpp:1927
double length() const
Definition: qcustomplot.h:398
void layerChanged(QCPLayer *newLayer)
QCPRange valueRange() const
Definition: qcustomplot.h:5795
int rowCount() const
Definition: qcustomplot.h:1331
ExportPen
Definition: qcustomplot.h:172
QCPDataRange adjusted(int changeBegin, int changeEnd) const
Definition: qcustomplot.h:912
QSharedPointer< QCPBarsDataContainer > data() const
Definition: qcustomplot.h:5473
QPoint bottomLeft() const
Definition: qcustomplot.h:4619
Definition: qcustomplot.h:2186
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts) ...
Definition: qcustomplot.h:253
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
Q_SLOT bool setLayer(QCPLayer *layer)
Definition: qcustomplot.cpp:1384
Defines a color gradient for use with e.g. QCPColorMap.
Definition: qcustomplot.h:4396
QSharedPointer< QCPCurveDataContainer > data() const
Definition: qcustomplot.h:5281
ScatterShape
Definition: qcustomplot.h:2288
AntialiasedElement
Definition: qcustomplot.h:211
QList< QCPBars * > bars() const
Definition: qcustomplot.h:5373
Q_SLOT void setSelectable(QCP::SelectionType selectable)
Definition: qcustomplot.cpp:10620
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.cpp:1471
virtual bool sortKeyIsMainKey() const =0
bool qcpLessThanSortKey(const DataType &a, const DataType &b)
Definition: qcustomplot.h:2371
An ellipse.
Definition: qcustomplot.h:6346
Holds the data of one single data point for QCPStatisticalBox.
Definition: qcustomplot.h:5529
int left() const
Definition: qcustomplot.h:4610
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
double mainValue() const
Definition: qcustomplot.h:5417
QSize size() const
Definition: qcustomplot.h:4616
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:3551
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details)
Definition: qcustomplot.cpp:1776
One individual data point can be selected at a time.
Definition: qcustomplot.h:290
LabelSide
Definition: qcustomplot.h:1955
void removeAfter(double sortKey)
Definition: qcustomplot.h:2742
virtual QSize maximumSizeHint() const Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:4616
QCPVector2D perpendicular() const
Definition: qcustomplot.h:406
QCPBars * barAbove() const
Definition: qcustomplot.h:5472
0x0002 Grid lines
Definition: qcustomplot.h:212
void squeeze(bool preAllocation=true, bool postAllocation=true)
Definition: qcustomplot.h:2836
Represents two doubles as a mathematical 2D vector.
Definition: qcustomplot.h:379
QCPDataSelection inverse(const QCPDataRange &outerRange) const
Definition: qcustomplot.cpp:2706
QRect rect() const
Definition: qcustomplot.h:1204
SelectablePart
Definition: qcustomplot.h:1971
ScatterProperty
Definition: qcustomplot.h:2270
The generic data container for one-dimensional plottables.
Definition: qcustomplot.h:2374
BracketStyle
Definition: qcustomplot.h:4490
Manages a legend inside a QCustomPlot.
Definition: qcustomplot.h:4763
virtual int dataCount() const =0
QPointF toPointF() const
Definition: qcustomplot.h:401
QSharedPointer< QCPFinancialDataContainer > data() const
Definition: qcustomplot.h:5853
void setAntialiased(bool enabled)
Definition: qcustomplot.cpp:1417
double mainKey() const
Definition: qcustomplot.h:5792
QCPDataRange bounded(const QCPDataRange &other) const
Definition: qcustomplot.cpp:2251
QCPAxis * yAxis2
Definition: qcustomplot.h:3700
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17589
The selection rect is disabled, and all mouse events are forwarded to the underlying objects...
Definition: qcustomplot.h:264
void setValueAxis(QCPAxis *axis)
Definition: qcustomplot.cpp:10549
double center() const
Definition: qcustomplot.h:792
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17496
A layout that arranges child elements in a grid.
Definition: qcustomplot.h:1300
double sortKey() const
Definition: qcustomplot.h:5788
virtual QPointF dataPixelPosition(int index) const =0
static QCPGraphData fromSortKey(double sortKey)
Definition: qcustomplot.h:5095
QPainter subclass used internally.
Definition: qcustomplot.h:453
The abstract base class for all objects that form the layout system.
Definition: qcustomplot.h:1176
bool isNone() const
Definition: qcustomplot.h:2335
QCPItemPosition * position(const QString &name) const
Definition: qcustomplot.cpp:12052
Holds the data of one single data point for QCPGraph.
Definition: qcustomplot.h:5088
const_iterator findBegin(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:2868
0x000 No hints are set
Definition: qcustomplot.h:232
virtual QCPPlottableInterface1D * interface1D()
Definition: qcustomplot.h:3856
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
Definition: qcustomplot.cpp:1744
Multiple contiguous data points (a data range) can be selected.
Definition: qcustomplot.h:291
Holds multiple axes and arranges them in a rectangular shape.
Definition: qcustomplot.h:4548
void setPen(const QPen &pen)
Definition: qcustomplot.cpp:10503
void rescaleKeyAxis(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:10738
double mainValue() const
Definition: qcustomplot.h:5793
When dragging the mouse, a selection rect becomes active. It is the programmer's responsibility to co...
Definition: qcustomplot.h:267
Both sign domains, including zero, i.e. all numbers.
Definition: qcustomplot.h:184
0x00 no margin
Definition: qcustomplot.h:198
A color scale for use with color coding data such as QCPColorMap.
Definition: qcustomplot.h:5005
virtual int dataCount() const
Definition: qcustomplot.h:4077
void pixelsToCoords(double x, double y, double &key, double &value) const
Definition: qcustomplot.cpp:10688
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition: qcustomplot.h:252
Groups multiple QCPBars together so they appear side by side.
Definition: qcustomplot.h:5341
QCPBars * barBelow() const
Definition: qcustomplot.h:5471
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const =0
double sortKey() const
Definition: qcustomplot.h:5412
virtual QPointF pixelPosition() const
Definition: qcustomplot.cpp:11088
void rescaleValueAxis(bool onlyEnlarge=false, bool inKeyRange=false) const
Definition: qcustomplot.cpp:10780
bool removeFromLegend() const
Definition: qcustomplot.cpp:10892
void clear()
Definition: qcustomplot.h:2801
int columnCount() const
Definition: qcustomplot.h:1332
int pixelOrientation() const
Definition: qcustomplot.h:2079
0x0004 Sub grid lines
Definition: qcustomplot.h:213
A bracket for referencing/highlighting certain parts in the plot.
Definition: qcustomplot.h:6563
virtual QPointF dataPixelPosition(int index) const
Definition: qcustomplot.h:4150
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
LayerInsertMode
Definition: qcustomplot.h:3572
The abstract base class for all entries in a QCPLegend.
Definition: qcustomplot.h:4675
SelectionRectMode
Definition: qcustomplot.h:264
WidthType
Definition: qcustomplot.h:5833
int bottom() const
Definition: qcustomplot.h:4613
Describes a data range given by begin and end index.
Definition: qcustomplot.h:887
void normalize()
Definition: qcustomplot.h:793
UpdatePhase
Definition: qcustomplot.h:1193
static QCPCurveData fromSortKey(double sortKey)
Definition: qcustomplot.h:5233
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable) ...
Definition: qcustomplot.h:251
PositionType
Definition: qcustomplot.h:3414
The abstract base class for paint buffers, which define the rendering backend.
Definition: qcustomplot.h:512
static QCPFinancialData fromSortKey(double sortKey)
Definition: qcustomplot.h:5789
A plottable representing a parametric curve in a plot.
Definition: qcustomplot.h:5258
QCPLegend * legend
Definition: qcustomplot.h:3701
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
Definition: qcustomplot.cpp:2542
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5790
A legend item representing a plottable with an icon and the plottable name.
Definition: qcustomplot.h:4739
bool isPenDefined() const
Definition: qcustomplot.h:2336
virtual double dataSortKey(int index) const =0
QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
Definition: qcustomplot.cpp:1339
bool selected() const
Definition: qcustomplot.h:3284
QCPRange valueRange() const
Definition: qcustomplot.h:5419
bool contains(double value) const
Definition: qcustomplot.h:801
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const
Definition: qcustomplot.h:4180
QCPRange valueRange() const
Definition: qcustomplot.h:5542
0x0040 Main lines of items
Definition: qcustomplot.h:217
bool isEmpty() const
Definition: qcustomplot.h:2384
Manages a single axis inside a QCustomPlot.
Definition: qcustomplot.h:1889
void setAntialiasedFill(bool enabled)
Definition: qcustomplot.cpp:10479
Definition: qcustomplot.h:235
FractionStyle
Definition: qcustomplot.h:1755
TracerStyle
Definition: qcustomplot.h:6497
void rescaleAxes(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:10727
A template base class for plottables with one-dimensional data.
Definition: qcustomplot.h:3834
0x01 The pen property, see setPen
Definition: qcustomplot.h:2271
Item that sticks to QCPGraph data points.
Definition: qcustomplot.h:6477
Definition: qcustomplot.h:233
GradientPreset
Definition: qcustomplot.h:4414
int size() const
Definition: qcustomplot.h:5375
A margin group allows synchronization of margin sides if working with multiple layout elements...
Definition: qcustomplot.h:1145
QCPRange & operator-=(const double &value)
Definition: qcustomplot.h:781
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:17529
QList< QCPItemPosition * > positions() const
Definition: qcustomplot.h:3503
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
Definition: qcustomplot.h:2922
void setVisible(bool on)
Definition: qcustomplot.cpp:1370
0x08 bottom margin
Definition: qcustomplot.h:196
virtual int findEnd(double sortKey, bool expandedRange=true) const =0
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:652
An anchor of an item to which positions can be attached to.
Definition: qcustomplot.h:3366
double mainValue() const
Definition: qcustomplot.h:5540
0x0100 Borders of fills (e.g. under or between graphs)
Definition: qcustomplot.h:219
The abstract base class for all items in a plot.
Definition: qcustomplot.h:3474
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:3504
static const double minRange
Definition: qcustomplot.h:805
WidthType
Definition: qcustomplot.h:5456
Selection behaves like stMultipleDataRanges, but if there are any data points selected, the entire plottable is drawn as selected.
Definition: qcustomplot.h:289
virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE
Definition: qcustomplot.cpp:4601
QPoint toPoint() const
Definition: qcustomplot.h:400
QPoint topLeft() const
Definition: qcustomplot.h:4617
SelectionType
Definition: qcustomplot.h:288
QCPRange valueRange() const
Definition: qcustomplot.h:5239
Specialized axis ticker for time spans in units of milliseconds to days.
Definition: qcustomplot.h:1613
int width() const
Definition: qcustomplot.h:4614
A paint buffer based on QPixmap, using software raster rendering.
Definition: qcustomplot.h:547
double sortKey() const
Definition: qcustomplot.h:5232
ScaleStrategy
Definition: qcustomplot.h:1675
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5096
static QCPBarsData fromSortKey(double sortKey)
Definition: qcustomplot.h:5413
TimeUnit
Definition: qcustomplot.h:1622
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap) ...
Definition: qcustomplot.h:218
Specialized axis ticker which allows arbitrary labels at specified coordinates.
Definition: qcustomplot.h:1707
QCPSelectionRect * selectionRect() const
Definition: qcustomplot.h:3608
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition: qcustomplot.h:1391
virtual int findBegin(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:4229
double mainKey() const
Definition: qcustomplot.h:5098
0x080 All other objects are selectable (e.g. your own derived layerables, other layout elements...
Definition: qcustomplot.h:255
Whether to use immediate or queued refresh depends on whether the plotting hint QCP::phImmediateRefre...
Definition: qcustomplot.h:3584
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
Definition: qcustomplot.h:249
void coordsToPixels(double key, double value, double &x, double &y) const
Definition: qcustomplot.cpp:10646
virtual int findBegin(double sortKey, bool expandedRange=true) const =0
A plottable representing a bar chart in a plot.
Definition: qcustomplot.h:5437
bool isNull() const
Definition: qcustomplot.h:403
AxisType
Definition: qcustomplot.h:1942
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:3598
0x8000 Other elements that don't fit into any of the existing categories
Definition: qcustomplot.h:221
double size() const
Definition: qcustomplot.h:791
virtual double dataMainKey(int index) const =0
void add(const QCPDataContainer< DataType > &data)
Definition: qcustomplot.h:2634
iterator end()
Definition: qcustomplot.h:2407
A selection decorator which draws brackets around each selected data segment.
Definition: qcustomplot.h:4479
0x01 Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fix...
Definition: qcustomplot.h:462
Base class for all drawable objects.
Definition: qcustomplot.h:689
Specialized axis ticker with a fixed tick step.
Definition: qcustomplot.h:1665
0x0008 Legend box
Definition: qcustomplot.h:214
QCPDataSelection selection() const
Definition: qcustomplot.h:3285
static bool sortKeyIsMainKey()
Definition: qcustomplot.h:5234
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.h:4062
QCPAxis * axis() const
Definition: qcustomplot.h:5023
SelectablePart
Definition: qcustomplot.h:4788
QCPLayout * layout() const
Definition: qcustomplot.h:1203
virtual double dataSortKey(int index) const
Definition: qcustomplot.h:4102
The plottable is not selectable.
Definition: qcustomplot.h:288
Resolution is given in dots per centimeter (dpcm)
Definition: qcustomplot.h:163
QPoint topRight() const
Definition: qcustomplot.h:4618
ScaleType
Definition: qcustomplot.h:1963
bool isValid() const
Definition: qcustomplot.h:907
0xFFFF All elements
Definition: qcustomplot.h:222
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:1153
void setEnd(int end)
Definition: qcustomplot.h:904
A plottable representing a graph in a plot.
Definition: qcustomplot.h:5119
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
Definition: qcustomplot.cpp:10434
FillOrder
Definition: qcustomplot.h:1322
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:183
void selectableChanged(QCP::SelectionType selectable)
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem) ...
Definition: qcustomplot.h:254
Holds the two-dimensional data of a QCPColorMap plottable.
Definition: qcustomplot.h:5646
virtual void donePainting()
Definition: qcustomplot.h:530
int height() const
Definition: qcustomplot.h:4615
The abstract base class for all data representing objects in a plot.
Definition: qcustomplot.h:3256
SpacingType
Definition: qcustomplot.h:5355
QCPDataContainer()
Definition: qcustomplot.h:2569
QCPDataRange dataRange(int index=0) const
Definition: qcustomplot.cpp:2512
iterator begin()
Definition: qcustomplot.h:2406
void drawLine(const QLineF &line)
Definition: qcustomplot.cpp:360
ChartStyle
Definition: qcustomplot.h:5844
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:211
virtual int findEnd(double sortKey, bool expandedRange=true) const
Definition: qcustomplot.h:4238
void setAntialiasedScatters(bool enabled)
Definition: qcustomplot.cpp:10490
PainterMode
Definition: qcustomplot.h:461
static Qt::Orientation orientation(AxisType type)
Definition: qcustomplot.h:2093
void clear()
Definition: qcustomplot.cpp:3043
int right() const
Definition: qcustomplot.h:4611
QPoint center() const
Definition: qcustomplot.h:4621
PositionType type() const
Definition: qcustomplot.h:3429
Holds the data of one single error bar for QCPErrorBars.
Definition: qcustomplot.h:5921
Definition: qcustomplot.h:2227
PlottingHint
Definition: qcustomplot.h:232
Cosmetic pens are exported normally (e.g. in PDF exports, cosmetic pens always appear as 1 pixel on s...
Definition: qcustomplot.h:173
0x01 left margin
Definition: qcustomplot.h:193
double mainKey() const
Definition: qcustomplot.h:5416
MarginSide
Definition: qcustomplot.h:193
0x0010 Legend items
Definition: qcustomplot.h:215
A plottable representing a financial stock chart.
Definition: qcustomplot.h:5813
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
Definition: qcustomplot.h:4313
void setAutoSqueeze(bool enabled)
Definition: qcustomplot.h:2585
QCPSelectionDecorator * selectionDecorator() const
Definition: qcustomplot.h:3286
A plottable representing a two-dimensional color map in a plot.
Definition: qcustomplot.h:5703
double sortKey() const
Definition: qcustomplot.h:5094
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:3432
QCPRange & operator*=(const double &value)
Definition: qcustomplot.h:782
virtual QCPPlottableInterface1D * interface1D()
Definition: qcustomplot.h:3302
static const double maxRange
Definition: qcustomplot.h:806
LineStyle
Definition: qcustomplot.h:5272
A line from one point to another.
Definition: qcustomplot.h:6089
Holds the data of one single data point for QCPFinancial.
Definition: qcustomplot.h:5782
When dragging the mouse, a selection rect becomes active. Upon releasing, plottable data points that ...
Definition: qcustomplot.h:266
Resolution is given in dots per meter (dpm)
Definition: qcustomplot.h:162
virtual void update(UpdatePhase phase)
Definition: qcustomplot.cpp:3362
QSharedPointer< QCPGraphDataContainer > data() const
Definition: qcustomplot.h:5149
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
Definition: qcustomplot.h:3132
A plottable that adds a set of error bars to other plottables.
Definition: qcustomplot.h:5950
virtual void wheelEvent(QWheelEvent *event)
Definition: qcustomplot.cpp:1799
virtual QCPRange dataValueRange(int index) const =0
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
Definition: qcustomplot.cpp:1726
double dot(const QCPVector2D &vec) const
Definition: qcustomplot.h:407
Interaction
Definition: qcustomplot.h:248
void setSelectionDecorator(QCPSelectionDecorator *decorator)
Definition: qcustomplot.cpp:10593
bool isEmpty() const
Definition: qcustomplot.h:5376
QCPColorMapData * data() const
Definition: qcustomplot.h:5719