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)
303 return qIsNaN(value) || qIsInf(value);
328 case QCP::msTop: margins.setTop(value);
break;
330 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
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)
383 QCPVector2D(
double x,
double y);
384 QCPVector2D(
const QPoint &point);
385 QCPVector2D(
const QPointF &point);
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); }
401 QPointF
toPointF()
const {
return QPointF(mX, mY); }
403 bool isNull()
const {
return qIsNull(mX) && qIsNull(mY); }
405 QCPVector2D normalized()
const;
407 double dot(
const QCPVector2D &vec)
const {
return mX*vec.mX+mY*vec.mY; }
408 double distanceSquaredToLine(
const QCPVector2D &start,
const QCPVector2D &end)
const;
409 double distanceSquaredToLine(
const QLineF &line)
const;
410 double distanceToStraightLine(
const QCPVector2D &base,
const QCPVector2D &direction)
const;
412 QCPVector2D &operator*=(
double factor);
413 QCPVector2D &operator/=(
double divisor);
414 QCPVector2D &operator+=(
const QCPVector2D &vector);
415 QCPVector2D &operator-=(
const QCPVector2D &vector);
421 friend inline const QCPVector2D
operator*(
double factor,
const QCPVector2D &vec);
422 friend inline const QCPVector2D
operator*(
const QCPVector2D &vec,
double factor);
423 friend inline const QCPVector2D
operator/(
const QCPVector2D &vec,
double divisor);
424 friend inline const QCPVector2D
operator+(
const QCPVector2D &vec1,
const QCPVector2D &vec2);
425 friend inline const QCPVector2D
operator-(
const QCPVector2D &vec1,
const QCPVector2D &vec2);
426 friend inline const QCPVector2D
operator-(
const QCPVector2D &vec);
443 d.nospace() <<
"QCPVector2D(" << vec.
x() <<
", " << vec.
y() <<
")";
464 ,pmNonCosmetic = 0x04
467 Q_FLAGS(PainterModes)
471 explicit QCPPainter(QPaintDevice *device);
474 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
475 PainterModes
modes()
const {
return mModes; }
478 void setAntialiasing(
bool enabled);
480 void setModes(PainterModes modes);
483 bool begin(QPaintDevice *device);
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();
503 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
515 explicit QCPAbstractPaintBuffer(
const QSize &
size,
double devicePixelRatio);
516 virtual ~QCPAbstractPaintBuffer();
519 QSize
size()
const {
return mSize; }
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;
543 virtual void reallocateBuffer() = 0;
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();
581 QGLPixelBuffer *mGlPBuffer;
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();
605 QWeakPointer<QOpenGLContext> mGlContext;
606 QWeakPointer<QOpenGLPaintDevice> mGlPaintDevice;
607 QOpenGLFramebufferObject *mGlFrameBuffer;
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)
627 Q_PROPERTY(QList<QCPLayerable*> children READ children)
628 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
650 QString
name()
const {
return mName; }
651 int index()
const {
return mIndex; }
652 QList<QCPLayerable*>
children()
const {
return mChildren; }
657 void setVisible(
bool visible);
677 void drawToPaintBuffer();
693 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
694 Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
695 Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable)
696 Q_PROPERTY(
QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged)
697 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
700 QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0);
701 virtual ~QCPLayerable();
711 void setVisible(
bool on);
712 Q_SLOT
bool setLayer(
QCPLayer *layer);
713 bool setLayer(
const QString &layerName);
714 void setAntialiased(
bool enabled);
717 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
720 bool realVisibility()
const;
723 void layerChanged(
QCPLayer *newLayer);
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);
743 virtual void mousePressEvent(QMouseEvent *event,
const QVariant &details);
744 virtual void mouseMoveEvent(QMouseEvent *event,
const QPointF &startPos);
745 virtual void mouseReleaseEvent(QMouseEvent *event,
const QPointF &startPos);
746 virtual void mouseDoubleClickEvent(QMouseEvent *event,
const QVariant &details);
747 virtual void wheelEvent(QWheelEvent *event);
750 void initializeParentPlot(QCustomPlot *parentPlot);
751 void setParentLayerable(QCPLayerable* parentLayerable);
752 bool moveToLayer(
QCPLayer *layer,
bool prepend);
756 Q_DISABLE_COPY(QCPLayerable)
758 friend class QCustomPlot;
775 QCPRange(
double lower,
double upper);
778 bool operator!=(
const QCPRange& other)
const {
return !(*
this == other); }
780 QCPRange &
operator+=(
const double& value) { lower+=value; upper+=value;
return *
this; }
781 QCPRange &
operator-=(
const double& value) { lower-=value; upper-=value;
return *
this; }
782 QCPRange &
operator*=(
const double& value) { lower*=value; upper*=value;
return *
this; }
783 QCPRange &
operator/=(
const double& value) { lower/=value; upper/=value;
return *
this; }
784 friend inline const QCPRange
operator+(
const QCPRange&,
double);
785 friend inline const QCPRange
operator+(
double,
const QCPRange&);
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);
796 QCPRange expanded(
const QCPRange &otherRange)
const;
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);
815 inline QDebug operator<< (QDebug d,
const QCPRange &range)
817 d.nospace() <<
"QCPRange(" << range.
lower <<
", " << range.
upper <<
")";
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; }
947 int dataPointCount()
const;
949 QList<QCPDataRange>
dataRanges()
const {
return mDataRanges; }
953 void addDataRange(
const QCPDataRange &dataRange,
bool simplify=
true);
955 bool isEmpty()
const {
return mDataRanges.isEmpty(); }
965 QList<QCPDataRange> mDataRanges;
1062 d.nospace() <<
"[" << dataRange.
begin() <<
".." << dataRange.
end()-1 <<
"]";
1072 d.nospace() <<
"QCPDataSelection(";
1099 QRect
rect()
const {
return mRect; }
1101 QPen
pen()
const {
return mPen; }
1106 void setPen(
const QPen &pen);
1107 void setBrush(
const QBrush &brush);
1110 Q_SLOT
void cancel();
1113 void started(QMouseEvent *event);
1114 void changed(
const QRect &rect, QMouseEvent *event);
1115 void canceled(
const QRect &rect, QInputEvent *event);
1116 void accepted(
const QRect &rect, QMouseEvent *event);
1127 virtual void startSelection(QMouseEvent *event);
1128 virtual void moveSelection(QMouseEvent *event);
1129 virtual void endSelection(QMouseEvent *event);
1130 virtual void keyPressEvent(QKeyEvent *event);
1154 bool isEmpty()
const;
1160 QHash<QCP::MarginSide, QList<QCPLayoutElement*> >
mChildren;
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)
1199 explicit QCPLayoutElement(
QCustomPlot *parentPlot=0);
1200 virtual ~QCPLayoutElement();
1204 QRect
rect()
const {
return mRect; }
1212 QHash<QCP::MarginSide, QCPMarginGroup*>
marginGroups()
const {
return mMarginGroups; }
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);
1227 virtual QSize minimumSizeHint()
const;
1228 virtual QSize maximumSizeHint()
const;
1229 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
1232 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const Q_DECL_OVERRIDE;
1245 virtual void layoutChanged();
1253 Q_DISABLE_COPY(QCPLayoutElement)
1266 explicit QCPLayout();
1270 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const Q_DECL_OVERRIDE;
1273 virtual int elementCount()
const = 0;
1274 virtual QCPLayoutElement* elementAt(
int index)
const = 0;
1275 virtual QCPLayoutElement* takeAt(
int index) = 0;
1276 virtual bool take(QCPLayoutElement* element) = 0;
1277 virtual void simplify();
1280 bool removeAt(
int index);
1281 bool remove(QCPLayoutElement* element);
1286 virtual void updateLayout();
1289 void sizeConstraintsChanged()
const;
1290 void adoptElement(QCPLayoutElement *el);
1291 void releaseElement(QCPLayoutElement *el);
1292 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
const;
1295 Q_DISABLE_COPY(QCPLayout)
1296 friend class QCPLayoutElement;
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)
1328 virtual ~QCPLayoutGrid();
1331 int rowCount()
const {
return mElements.size(); }
1332 int columnCount()
const {
return mElements.size() > 0 ? mElements.first().size() : 0; }
1341 void setColumnStretchFactor(
int column,
double factor);
1342 void setColumnStretchFactors(
const QList<double> &factors);
1343 void setRowStretchFactor(
int row,
double factor);
1344 void setRowStretchFactors(
const QList<double> &factors);
1345 void setColumnSpacing(
int pixels);
1346 void setRowSpacing(
int pixels);
1347 void setWrap(
int count);
1348 void setFillOrder(
FillOrder order,
bool rearrange=
true);
1352 virtual int elementCount() const Q_DECL_OVERRIDE {
return rowCount()*columnCount(); }
1356 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const Q_DECL_OVERRIDE;
1362 QCPLayoutElement *element(
int row,
int column)
const;
1363 bool addElement(
int row,
int column, QCPLayoutElement *element);
1364 bool addElement(QCPLayoutElement *element);
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;
1382 void getMinimumRowColSizes(QVector<int> *minColWidths, QVector<int> *minRowHeights)
const;
1383 void getMaximumRowColSizes(QVector<int> *maxColWidths, QVector<int> *maxRowHeights)
const;
1404 virtual ~QCPLayoutInset();
1408 Qt::Alignment insetAlignment(
int index) const;
1409 QRectF insetRect(
int index) const;
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;
1476 QCPLineEnding(
EndingStyle style,
double width=8,
double length=10,
bool inverted=false);
1486 void setWidth(
double width);
1487 void setLength(
double length);
1488 void setInverted(
bool inverted);
1491 double boundingDistance()
const;
1492 double realLength()
const;
1528 virtual ~QCPAxisTicker();
1537 void setTickCount(
int count);
1538 void setTickOrigin(
double origin);
1541 virtual void generate(
const QCPRange &range,
const QLocale &locale, QChar formatChar,
int precision, QVector<double> &ticks, QVector<double> *subTicks, QVector<QString> *tickLabels);
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);
1553 virtual QVector<double> createTickVector(
double tickStep,
const QCPRange &range);
1554 virtual QVector<double> createSubTickVector(
int subTickCount,
const QVector<double> &ticks);
1555 virtual QVector<QString> createLabelVector(
const QVector<double> &ticks,
const QLocale &locale, QChar formatChar,
int precision);
1558 void trimTicks(
const QCPRange &range, QVector<double> &ticks,
bool keepOneOutlier)
const;
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;
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);
1603 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision)
Q_DECL_OVERRIDE;
1633 QString timeFormat()
const {
return mTimeFormat; }
1637 void setTimeFormat(
const QString &format);
1638 void setFieldWidth(
TimeUnit unit,
int width);
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;
1684 double tickStep()
const {
return mTickStep; }
1688 void setTickStep(
double step);
1713 QMap<double, QString> &
ticks() {
return mTicks; }
1717 void setTicks(
const QMap<double, QString> &ticks);
1718 void setTicks(
const QVector<double> &positions,
const QVector<QString> labels);
1719 void setSubTickCount(
int subTicks);
1723 void addTick(
double position, QString label);
1724 void addTicks(
const QMap<double, QString> &ticks);
1725 void addTicks(
const QVector<double> &positions,
const QVector<QString> &labels);
1735 virtual QString getTickLabel(
double tick,
const QLocale &locale, QChar formatChar,
int precision)
Q_DECL_OVERRIDE;
1764 QString piSymbol()
const {
return mPiSymbol; }
1770 void setPiSymbol(QString symbol);
1771 void setPiValue(
double pi);
1772 void setPeriodicity(
int multiplesOfPi);
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;
1815 void setLogBase(
double base);
1816 void setSubTickCount(
int subTicks);
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)
1856 QPen
pen()
const {
return mPen; }
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);
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)
1908 Q_PROPERTY(QVector<double> tickVector READ tickVector)
1909 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels)
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)
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
1977 Q_FLAGS(SelectableParts)
1989 QSharedPointer<QCPAxisTicker>
ticker()
const {
return mTicker; }
1992 int tickLabelPadding()
const;
1995 double tickLabelRotation()
const;
1997 QString numberFormat()
const;
2001 int tickLengthIn()
const;
2002 int tickLengthOut()
const;
2004 int subTickLengthIn()
const;
2005 int subTickLengthOut()
const;
2011 QString
label()
const {
return mLabel; }
2012 int labelPadding()
const;
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);
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;
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;
2088 QList<QCPAbstractPlottable*> plottables()
const;
2089 QList<QCPGraph*> graphs()
const;
2090 QList<QCPAbstractItem*> items()
const;
2093 static Qt::Orientation
orientation(
AxisType type) {
return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
2097 void rangeChanged(
const QCPRange &newRange);
2100 void selectionChanged(
const QCPAxis::SelectableParts &parts);
2101 void selectableChanged(
const QCPAxis::SelectableParts &parts);
2151 virtual int calculateMargin();
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)
2189 explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
2190 virtual ~QCPAxisPainterPrivate();
2193 virtual int size()
const;
2235 QRect baseBounds, expBounds, suffixBounds,
totalBounds, rotatedTotalBounds;
2243 virtual QByteArray generateLabelParameterHash()
const;
2245 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
2247 virtual TickLabelData getTickLabelData(
const QFont &font,
const QString &text)
const;
2248 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
2249 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
2278 Q_FLAGS(ScatterProperties)
2311 QCPScatterStyle(
ScatterShape shape, const QColor &color,
double size);
2312 QCPScatterStyle(
ScatterShape shape, const QColor &color, const QColor &fill,
double size);
2313 QCPScatterStyle(
ScatterShape shape, const QPen &pen, const QBrush &brush,
double size);
2314 QCPScatterStyle(const QPixmap &pixmap);
2315 QCPScatterStyle(const QPainterPath &customPath, const QPen &pen, const QBrush &brush=Qt::NoBrush,
double size=6);
2318 double size()
const {
return mSize; }
2320 QPen
pen()
const {
return mPen; }
2326 void setFromOther(
const QCPScatterStyle &other, ScatterProperties properties);
2327 void setSize(
double size);
2329 void setPen(
const QPen &pen);
2330 void setBrush(
const QBrush &brush);
2331 void setPixmap(
const QPixmap &pixmap);
2332 void setCustomPath(
const QPainterPath &customPath);
2335 bool isNone()
const {
return mShape == ssNone; }
2338 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
2339 void drawShape(
QCPPainter *painter,
const QPointF &pos)
const;
2340 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
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; }
2388 void setAutoSqueeze(
bool enabled);
2392 void set(
const QVector<DataType> &data,
bool alreadySorted=
false);
2394 void add(
const QVector<DataType> &data,
bool alreadySorted=
false);
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;
2426 void preallocateGrow(
int minimumPreallocSize);
2427 void performAutoSqueeze();
2568 template <
class DataType>
2572 mPreallocIteration(0)
2584 template <
class DataType>
2601 template <
class DataType>
2617 template <
class DataType>
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)))
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)))
2684 std::copy(data.constBegin(), data.constEnd(),
begin());
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()))
2717 mData.insert(insertionPoint, data);
2726 template <
class DataType>
2741 template <
class DataType>
2746 mData.erase(it, itEnd);
2758 template <
class DataType>
2761 if (sortKeyFrom >= sortKeyTo ||
isEmpty())
2766 mData.erase(it, itEnd);
2780 template <
class DataType>
2784 if (it !=
end() && it->sortKey() == sortKey)
2800 template <
class DataType>
2819 template <
class DataType>
2822 std::sort(
begin(),
end(), qcpLessThanSortKey<DataType>);
2835 template <
class DataType>
2867 template <
class DataType>
2894 template <
class DataType>
2901 if (expandedRange && it !=
constEnd())
2921 template <
class DataType>
2930 bool haveLower =
false;
2931 bool haveUpper =
false;
2938 if (DataType::sortKeyIsMainKey())
2942 if (!qIsNaN(it->mainValue()))
2944 range.
lower = it->mainKey();
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;
3059 if (DataType::sortKeyIsMainKey() && restrictKeyRange)
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))
3076 if ((current.
upper > range.
upper || !haveUpper) && !qIsNaN(current.
upper))
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))
3094 if ((current.
upper > range.
upper || !haveUpper) && current.
upper < 0 && !qIsNaN(current.
upper))
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))
3112 if ((current.
upper > range.
upper || !haveUpper) && current.
upper > 0 && !qIsNaN(current.
upper))
3120 foundRange = haveLower && haveUpper;
3131 template <
class DataType>
3135 iteratorRange = iteratorRange.
bounded(dataRange.
bounded(this->dataRange()));
3149 template <
class DataType>
3155 int newPreallocSize = minimumPreallocSize;
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;
3191 }
else if (totalAlloc > 1000)
3193 shrinkPostAllocation = postAllocSize > usedSize*5;
3197 if (shrinkPreAllocation || shrinkPostAllocation)
3198 squeeze(shrinkPreAllocation, shrinkPostAllocation);
3217 QPen
pen()
const {
return mPen; }
3223 void setPen(
const QPen &pen);
3224 void setBrush(
const QBrush &brush);
3226 void setUsedScatterProperties(
const QCPScatterStyle::ScatterProperties &properties);
3260 Q_PROPERTY(QString name READ name WRITE setName)
3261 Q_PROPERTY(
bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
3262 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters)
3263 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3264 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3265 Q_PROPERTY(
QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis)
3266 Q_PROPERTY(
QCPAxis* valueAxis READ valueAxis WRITE setValueAxis)
3267 Q_PROPERTY(
QCP::SelectionType selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
3268 Q_PROPERTY(
QCPDataSelection selection READ selection WRITE setSelection NOTIFY selectionChanged)
3269 Q_PROPERTY(
QCPSelectionDecorator* selectionDecorator READ selectionDecorator WRITE setSelectionDecorator)
3273 virtual ~QCPAbstractPlottable();
3276 QString
name()
const {
return mName; }
3279 QPen
pen()
const {
return mPen; }
3284 bool selected()
const {
return !mSelection.isEmpty(); }
3289 void setName(
const QString &name);
3290 void setAntialiasedFill(
bool enabled);
3291 void setAntialiasedScatters(
bool enabled);
3292 void setPen(
const QPen &pen);
3293 void setBrush(
const QBrush &brush);
3294 void setKeyAxis(
QCPAxis *axis);
3295 void setValueAxis(
QCPAxis *axis);
3301 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
3307 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
3308 const QPointF coordsToPixels(
double key,
double value)
const;
3309 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
3310 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
3311 void rescaleAxes(
bool onlyEnlarge=
false)
const;
3312 void rescaleKeyAxis(
bool onlyEnlarge=
false)
const;
3313 void rescaleValueAxis(
bool onlyEnlarge=
false,
bool inKeyRange=
false)
const;
3316 bool removeFromLegend(
QCPLegend *legend)
const;
3317 bool removeFromLegend()
const;
3320 void selectionChanged(
bool selected);
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;
3352 Q_DISABLE_COPY(QCPAbstractPlottable)
3370 QCPItemAnchor(QCustomPlot *parentPlot,
QCPAbstractItem *parentItem,
const QString &name,
int anchorId=-1);
3371 virtual ~QCPItemAnchor();
3374 QString
name()
const {
return mName; }
3375 virtual QPointF pixelPosition()
const;
3397 Q_DISABLE_COPY(QCPItemAnchor)
3425 QCPItemPosition(QCustomPlot *parentPlot,
QCPAbstractItem *parentItem, const QString &name);
3426 virtual ~QCPItemPosition();
3435 double key()
const {
return mKey; }
3437 QPointF
coords()
const {
return QPointF(mKey, mValue); }
3438 QCPAxis *
keyAxis()
const {
return mKeyAxis.data(); }
3441 virtual QPointF pixelPosition()
const;
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);
3452 void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
3454 void setPixelPosition(
const QPointF &pixelPosition);
3468 Q_DISABLE_COPY(QCPItemPosition)
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)
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;
3503 QList<QCPItemPosition*>
positions()
const {
return mPositions; }
3504 QList<QCPItemAnchor*>
anchors()
const {
return mAnchors; }
3507 bool hasAnchor(
const QString &name)
const;
3510 void selectionChanged(
bool selected);
3511 void selectableChanged(
bool selectable);
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;
3536 QCPItemAnchor *createAnchor(const QString &name,
int anchorId);
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)
3589 explicit QCustomPlot(QWidget *parent = 0);
3590 virtual ~QCustomPlot();
3593 QRect viewport()
const {
return mViewport; }
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);
3637 QCPAbstractPlottable *plottable(
int index);
3638 QCPAbstractPlottable *plottable();
3639 bool removePlottable(QCPAbstractPlottable *plottable);
3640 bool removePlottable(
int index);
3641 int clearPlottables();
3642 int plottableCount()
const;
3643 QList<QCPAbstractPlottable*> selectedPlottables()
const;
3644 QCPAbstractPlottable *plottableAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
3645 bool hasPlottable(QCPAbstractPlottable *plottable)
const;
3652 bool removeGraph(
int index);
3654 int graphCount()
const;
3655 QList<QCPGraph*> selectedGraphs()
const;
3661 bool removeItem(
int index);
3663 int itemCount()
const;
3664 QList<QCPAbstractItem*> selectedItems()
const;
3665 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
3669 QCPLayer *layer(
const QString &name)
const;
3672 bool setCurrentLayer(
const QString &name);
3673 bool setCurrentLayer(
QCPLayer *layer);
3674 int layerCount()
const;
3680 int axisRectCount()
const;
3682 QList<QCPAxisRect*> axisRects()
const;
3684 QCPAxisRect* axisRectAt(
const QPointF &pos)
const;
3685 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
3687 QList<QCPAxis*> selectedAxes()
const;
3688 QList<QCPLegend*> selectedLegends()
const;
3689 Q_SLOT
void deselectAll();
3691 bool savePdf(
const QString &fileName,
int width=0,
int height=0,
QCP::ExportPen exportPen=
QCP::epAllowCosmetic,
const QString &pdfCreator=QString(),
const QString &pdfTitle=QString());
3695 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1,
int resolution=96,
QCP::ResolutionUnit resolutionUnit=
QCP::ruDotsPerInch);
3696 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
3697 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
3704 void mouseDoubleClick(QMouseEvent *event);
3705 void mousePress(QMouseEvent *event);
3706 void mouseMove(QMouseEvent *event);
3707 void mouseRelease(QMouseEvent *event);
3708 void mouseWheel(QWheelEvent *event);
3710 void plottableClick(QCPAbstractPlottable *plottable,
int dataIndex, QMouseEvent *event);
3711 void plottableDoubleClick(QCPAbstractPlottable *plottable,
int dataIndex, QMouseEvent *event);
3719 void selectionChangedByUser();
3720 void beforeReplot();
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);
3787 bool registerPlottable(QCPAbstractPlottable *plottable);
3788 bool registerGraph(
QCPGraph *graph);
3790 void updateLayerIndices() const;
3791 QCPLayerable *layerableAt(const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=0) const;
3792 QList<QCPLayerable*> layerableListAt(const QPointF &pos,
bool onlySelectable, QList<QVariant> *selectionDetails=0) const;
3794 void setupPaintBuffers();
3796 bool hasInvalidatedPaintBuffers();
3804 friend class QCPAbstractPlottable;
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;
3828 virtual QCPDataSelection selectTestRect(
const QRectF &rect,
bool onlySelectable)
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>
3843 virtual int dataCount()
const;
3844 virtual double dataMainKey(
int index)
const;
3845 virtual double dataSortKey(
int index)
const;
3846 virtual double dataMainValue(
int index)
const;
3847 virtual QCPRange dataValueRange(
int index)
const;
3848 virtual QPointF dataPixelPosition(
int index)
const;
3849 virtual bool sortKeyIsMainKey()
const;
3850 virtual QCPDataSelection selectTestRect(
const QRectF &rect,
bool onlySelectable)
const;
3851 virtual int findBegin(
double sortKey,
bool expandedRange=
true)
const;
3852 virtual int findEnd(
double sortKey,
bool expandedRange=
true)
const;
3855 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3863 void getDataSegments(QList<QCPDataRange> &selectedSegments, QList<QCPDataRange> &unselectedSegments)
const;
3864 void drawPolyline(
QCPPainter *painter,
const QVector<QPointF> &lineData)
const;
4061 template <
class DataType>
4063 QCPAbstractPlottable(keyAxis, valueAxis),
4068 template <
class DataType>
4076 template <
class DataType>
4085 template <
class DataType>
4088 if (index >= 0 && index < mDataContainer->
size())
4093 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4101 template <
class DataType>
4104 if (index >= 0 && index < mDataContainer->
size())
4109 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4117 template <
class DataType>
4120 if (index >= 0 && index < mDataContainer->
size())
4125 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4133 template <
class DataType>
4136 if (index >= 0 && index < mDataContainer->
size())
4141 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4149 template <
class DataType>
4152 if (index >= 0 && index < mDataContainer->
size())
4158 qDebug() << Q_FUNC_INFO <<
"Index out of bounds" << index;
4166 template <
class DataType>
4169 return DataType::sortKeyIsMainKey();
4179 template <
class DataType>
4185 if (!mKeyAxis || !mValueAxis)
4189 double key1, value1, key2, value2;
4193 QCPRange valueRange(value1, value2);
4196 if (DataType::sortKeyIsMainKey())
4204 int currentSegmentBegin = -1;
4207 if (currentSegmentBegin == -1)
4209 if (valueRange.
contains(it->mainValue()) && keyRange.contains(it->mainKey()))
4211 }
else if (!valueRange.
contains(it->mainValue()) || !keyRange.contains(it->mainKey()))
4214 currentSegmentBegin = -1;
4218 if (currentSegmentBegin != -1)
4228 template <
class DataType>
4237 template <
class DataType>
4250 template <
class DataType>
4255 if (!mKeyAxis || !mValueAxis)
4259 double minDistSqr = std::numeric_limits<double>::max();
4264 if (DataType::sortKeyIsMainKey())
4267 double posKeyMin, posKeyMax, dummy;
4270 if (posKeyMin > posKeyMax)
4271 qSwap(posKeyMin, posKeyMax);
4277 QCPRange keyRange(mKeyAxis->range());
4278 QCPRange valueRange(mValueAxis->range());
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;
4298 details->setValue(selectionResult);
4299 return qSqrt(minDistSqr);
4312 template <
class DataType>
4315 selectedSegments.clear();
4316 unselectedSegments.clear();
4322 unselectedSegments << QCPDataRange(0,
dataCount());
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);
4431 bool operator==(const QCPColorGradient &other) const;
4432 bool operator!=(const QCPColorGradient &other)
const {
return !(*
this == other); }
4441 void setLevelCount(
int n);
4442 void setColorStops(
const QMap<double, QColor> &colorStops);
4443 void setColorStopAt(
double position,
const QColor &color);
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);
4452 void clearColorStops();
4467 bool stopsUseAlpha()
const;
4468 void updateColorBuffer();
4499 virtual ~QCPSelectionDecoratorBracket();
4502 QPen bracketPen()
const {
return mBracketPen; }
4511 void setBracketPen(
const QPen &pen);
4512 void setBracketBrush(
const QBrush &brush);
4513 void setBracketWidth(
int width);
4514 void setBracketHeight(
int height);
4516 void setTangentToData(
bool enabled);
4517 void setTangentAverage(
int pointCount);
4520 virtual void drawBracket(
QCPPainter *painter,
int direction)
const;
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)
4559 explicit QCPAxisRect(QCustomPlot *parentPlot,
bool setupDefaultAxes=
true);
4569 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
4570 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
4571 QList<QCPAxis*> rangeDragAxes(Qt::Orientation orientation);
4572 QList<QCPAxis*> rangeZoomAxes(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);
4584 void setRangeDragAxes(QList<QCPAxis*> axes);
4585 void setRangeDragAxes(QList<QCPAxis*> horizontal, QList<QCPAxis*> vertical);
4587 void setRangeZoomAxes(QList<QCPAxis*> axes);
4588 void setRangeZoomAxes(QList<QCPAxis*> horizontal, QList<QCPAxis*> vertical);
4589 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
4590 void setRangeZoomFactor(
double factor);
4595 QList<QCPAxis*> axes(QCPAxis::AxisTypes types)
const;
4596 QList<QCPAxis*> axes()
const;
4598 QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
4599 bool removeAxis(
QCPAxis *axis);
4602 void zoom(
const QRectF &pixelRect);
4603 void zoom(
const QRectF &pixelRect,
const QList<QCPAxis*> &affectedAxes);
4604 void setupFullAxesBox(
bool connectRanges=
false);
4605 QList<QCPAbstractPlottable*> plottables()
const;
4606 QList<QCPGraph*> graphs()
const;
4607 QList<QCPAbstractItem*> items()
const;
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(); }
4625 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const Q_DECL_OVERRIDE;
4645 QHash<QCPAxis::AxisType, QList<QCPAxis*> >
mAxes;
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);
4665 friend class QCustomPlot;
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)
4692 QFont
font()
const {
return mFont; }
4700 void setFont(
const QFont &font);
4701 void setTextColor(
const QColor &color);
4702 void setSelectedFont(
const QFont &font);
4703 void setSelectedTextColor(
const QColor &color);
4705 Q_SLOT
void setSelected(
bool selected);
4726 virtual QRect
clipRect() const Q_DECL_OVERRIDE;
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;
4754 virtual QSize minimumSizeHint() const 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
4793 Q_FLAGS(SelectableParts)
4796 explicit QCPLegend();
4797 virtual ~QCPLegend();
4800 QPen borderPen()
const {
return mBorderPen; }
4802 QFont
font()
const {
return mFont; }
4808 SelectableParts selectedParts()
const;
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);
4836 QCPAbstractLegendItem *item(
int index)
const;
4838 int itemCount()
const;
4839 bool hasItem(QCPAbstractLegendItem *item)
const;
4840 bool hasItemWithPlottable(
const QCPAbstractPlottable *plottable)
const;
4841 bool addItem(QCPAbstractLegendItem *item);
4842 bool removeItem(
int index);
4843 bool removeItem(QCPAbstractLegendItem *item);
4845 QList<QCPAbstractLegendItem*> selectedItems()
const;
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;
4876 QBrush getBrush() const;
4879 Q_DISABLE_COPY(QCPLegend)
4881 friend class QCustomPlot;
4882 friend class QCPAbstractLegendItem;
4884 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
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)
4908 QCPTextElement(QCustomPlot *parentPlot,
const QString &text,
double pointSize);
4909 QCPTextElement(QCustomPlot *parentPlot,
const QString &text,
const QString &fontFamily,
double pointSize);
4910 QCPTextElement(QCustomPlot *parentPlot,
const QString &text,
const QFont &font);
4913 QString
text()
const {
return mText; }
4915 QFont
font()
const {
return mFont; }
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);
4930 Q_SLOT
void setSelected(
bool selected);
4941 void clicked(QMouseEvent *event);
4942 void doubleClicked(QMouseEvent *event);
4958 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
4959 virtual QSize maximumSizeHint() const 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;
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)
5028 QString label()
const;
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);
5044 QList<QCPColorMap*> colorMaps()
const;
5045 void rescaleDataRange(
bool onlyVisibleMaps);
5051 void dataRangeChanged(
const QCPRange &newRange);
5092 QCPGraphData(
double key,
double value);
5095 inline static QCPGraphData
fromSortKey(
double sortKey) {
return QCPGraphData(sortKey, 0); }
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)
5157 void setData(QSharedPointer<QCPGraphDataContainer> data);
5158 void setData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5161 void setScatterSkip(
int skip);
5162 void setChannelFillGraph(
QCPGraph *targetGraph);
5163 void setAdaptiveSampling(
bool enabled);
5166 void addData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5167 void addData(
double key,
double value);
5187 virtual void drawFill(
QCPPainter *painter, QVector<QPointF> *lines)
const;
5188 virtual void drawScatterPlot(
QCPPainter *painter,
const QVector<QPointF> &scatters,
const QCPScatterStyle &style)
const;
5189 virtual void drawLinePlot(
QCPPainter *painter,
const QVector<QPointF> &lines)
const;
5190 virtual void drawImpulsePlot(
QCPPainter *painter,
const QVector<QPointF> &lines)
const;
5197 void getLines(QVector<QPointF> *lines,
const QCPDataRange &dataRange)
const;
5198 void getScatters(QVector<QPointF> *scatters,
const QCPDataRange &dataRange)
const;
5199 QVector<QPointF> dataToLines(
const QVector<QCPGraphData> &data)
const;
5200 QVector<QPointF> dataToStepLeftLines(
const QVector<QCPGraphData> &data)
const;
5201 QVector<QPointF> dataToStepRightLines(
const QVector<QCPGraphData> &data)
const;
5202 QVector<QPointF> dataToStepCenterLines(
const QVector<QCPGraphData> &data)
const;
5203 QVector<QPointF> dataToImpulseLines(
const QVector<QCPGraphData> &data)
const;
5204 void addFillBasePoints(QVector<QPointF> *lines)
const;
5205 void removeFillBasePoints(QVector<QPointF> *lines)
const;
5206 QPointF lowerFillBasePoint(
double lowerKey)
const;
5207 QPointF upperFillBasePoint(
double upperKey)
const;
5208 const QPolygonF getChannelFillPolygon(
const QVector<QPointF> *lines)
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;
5215 friend class QCustomPlot;
5216 friend class QCPLegend;
5230 QCPCurveData(
double t,
double key,
double value);
5233 inline static QCPCurveData
fromSortKey(
double sortKey) {
return QCPCurveData(sortKey, 0, 0); }
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)
5287 void setData(QSharedPointer<QCPCurveDataContainer> data);
5288 void setData(
const QVector<double> &t,
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5289 void setData(
const QVector<double> &keys,
const QVector<double> &values);
5291 void setScatterSkip(
int skip);
5295 void addData(
const QVector<double> &t,
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5296 void addData(
const QVector<double> &keys,
const QVector<double> &values);
5297 void addData(
double t,
double key,
double value);
5298 void addData(
double key,
double value);
5316 virtual void drawCurveLine(
QCPPainter *painter,
const QVector<QPointF> &lines)
const;
5320 void getCurveLines(QVector<QPointF> *lines,
const QCPDataRange &dataRange,
double penWidth)
const;
5321 void getScatters(QVector<QPointF> *scatters,
const QCPDataRange &dataRange,
double scatterWidth)
const;
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;
5330 friend class QCustomPlot;
5331 friend class QCPLegend;
5345 Q_PROPERTY(
SpacingType spacingType READ spacingType WRITE setSpacingType)
5346 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
5370 void setSpacing(
double spacing);
5373 QList<QCPBars*>
bars()
const {
return mBars; }
5374 QCPBars* bars(
int index)
const;
5375 int size()
const {
return mBars.size(); }
5380 void insert(
int i,
QCPBars *bars);
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);
5410 QCPBarsData(
double key,
double value);
5413 inline static QCPBarsData
fromSortKey(
double sortKey) {
return QCPBarsData(sortKey, 0); }
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; }
5476 void setData(QSharedPointer<QCPBarsDataContainer> data);
5477 void setData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5478 void setWidth(
double width);
5481 void setBaseValue(
double baseValue);
5482 void setStackingGap(
double pixels);
5485 void addData(
const QVector<double> &keys,
const QVector<double> &values,
bool alreadySorted=
false);
5486 void addData(
double key,
double value);
5487 void moveBelow(
QCPBars *bars);
5488 void moveAbove(
QCPBars *bars);
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;
5517 friend class QCustomPlot;
5518 friend class QCPLegend;
5532 QCPStatisticalBoxData();
5533 QCPStatisticalBoxData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum,
const QVector<double>& outliers=QVector<double>());
5536 inline static QCPStatisticalBoxData
fromSortKey(
double sortKey) {
return QCPStatisticalBoxData(sortKey, 0, 0, 0, 0, 0); }
5545 for (QVector<double>::const_iterator it = outliers.constBegin(); it != outliers.constEnd(); ++it)
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)
5594 void setData(QSharedPointer<QCPStatisticalBoxDataContainer> data);
5595 void setData(
const QVector<double> &keys,
const QVector<double> &minimum,
const QVector<double> &lowerQuartile,
const QVector<double> &median,
const QVector<double> &upperQuartile,
const QVector<double> &maximum,
bool alreadySorted=
false);
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);
5605 void addData(
const QVector<double> &keys,
const QVector<double> &minimum,
const QVector<double> &lowerQuartile,
const QVector<double> &median,
const QVector<double> &upperQuartile,
const QVector<double> &maximum,
bool alreadySorted=
false);
5606 void addData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum,
const QVector<double> &outliers=QVector<double>());
5636 friend class QCustomPlot;
5637 friend class QCPLegend;
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;
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)
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));
5746 void dataRangeChanged(
const QCPRange &newRange);
5766 virtual void updateMapImage();
5772 friend class QCustomPlot;
5773 friend class QCPLegend;
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)
5864 void setData(QSharedPointer<QCPFinancialDataContainer> data);
5865 void setData(
const QVector<double> &keys,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close,
bool alreadySorted=
false);
5867 void setWidth(
double width);
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);
5876 void addData(
const QVector<double> &keys,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close,
bool alreadySorted=
false);
5877 void addData(
double key,
double open,
double high,
double low,
double close);
5886 static QCPFinancialDataContainer timeSeriesToOhlc(
const QVector<double> &time,
const QVector<double> &value,
double timeBinSize,
double timeBinOffset = 0);
5904 double getPixelWidth(
double key,
double keyPixel)
const;
5910 friend class QCustomPlot;
5911 friend class QCPLegend;
5925 explicit QCPErrorBarsData(
double error);
5926 QCPErrorBarsData(
double errorMinus,
double errorPlus);
5954 Q_PROPERTY(QSharedPointer<QCPErrorBarsDataContainer> data READ data WRITE setData)
5955 Q_PROPERTY(QCPAbstractPlottable* dataPlottable READ dataPlottable WRITE setDataPlottable)
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)
5983 void setData(QSharedPointer<QCPErrorBarsDataContainer> data);
5984 void setData(
const QVector<double> &error);
5985 void setData(
const QVector<double> &errorMinus,
const QVector<double> &errorPlus);
5986 void setDataPlottable(QCPAbstractPlottable* plottable);
5988 void setWhiskerWidth(
double pixels);
5989 void setSymbolGap(
double pixels);
5992 void addData(
const QVector<double> &error);
5993 void addData(
const QVector<double> &errorMinus,
const QVector<double> &errorPlus);
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;
6028 void getErrorBarLines(QCPErrorBarsDataContainer::const_iterator it, QVector<QLineF> &backbones, QVector<QLineF> &whiskers) const;
6029 void getVisibleDataBounds(QCPErrorBarsDataContainer::const_iterator &begin, QCPErrorBarsDataContainer::const_iterator &end, const
QCPDataRange &rangeRestriction) const;
6030 double pointDistance(const QPointF &pixelPoint, QCPErrorBarsDataContainer::const_iterator &closestData) const;
6033 bool errorBarVisible(
int index) const;
6034 bool rectIntersectsLine(const QRectF &pixelRect, const QLineF &line) const;
6036 friend class QCustomPlot;
6037 friend class QCPLegend;
6050 Q_PROPERTY(QPen pen READ pen WRITE setPen)
6051 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
6062 void setPen(
const QPen &pen);
6063 void setSelectedPen(
const QPen &pen);
6079 QLineF getRectClippedStraightLine(
const QCPVector2D &point1,
const QCPVector2D &vec,
const QRect &rect)
const;
6080 QPen mainPen()
const;
6093 Q_PROPERTY(QPen pen READ pen WRITE setPen)
6094 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
6109 void setPen(
const QPen &pen);
6110 void setSelectedPen(
const QPen &pen);
6130 QPen mainPen()
const;
6143 Q_PROPERTY(QPen pen READ pen WRITE setPen)
6144 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
6159 void setPen(
const QPen &pen);
6160 void setSelectedPen(
const QPen &pen);
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)
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};
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)
6278 QFont
font()
const {
return mFont; }
6280 QString
text()
const {
return mText; }
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};
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)
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};
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)
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};
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)
6513 double size()
const {
return mSize; }
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);
6527 void setGraphKey(
double key);
6528 void setInterpolating(
bool enabled);
6534 void updatePosition();
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)
6596 void setPen(
const QPen &pen);
6597 void setSelectedPen(
const QPen &pen);
6598 void setLength(
double length);
6617 virtual QPointF anchorPixelPosition(
int anchorId)
const Q_DECL_OVERRIDE;
6620 QPen mainPen()
const;
6627 #endif // QCUSTOMPLOT_H
double devicePixelRatio() const
QList< QList< QCPLayoutElement * > > mElements
QCP::AntialiasedElements mNotAADragBackup
QCPLayoutGrid * plotLayout() const
A bracket for referencing/highlighting certain parts in the plot.
QList< QSharedPointer< QCPAbstractPaintBuffer > > mPaintBuffers
QCustomPlot * mParentPlot
A margin group allows synchronization of margin sides if working with multiple layout elements...
One individual data point can be selected at a time.
QList< QCPGraph * > mGraphs
Holds the data of one single error bar for QCPErrorBars.
bool operator==(const QCPRange &other) const
virtual double dataMainKey(int index) const
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
double bufferDevicePixelRatio() const
static const double maxRange
bool isInvalidData(double value)
ErrorType errorType() const
const_iterator findBegin(double sortKey, bool expandedRange=true) const
QSharedPointer< QCPDataContainer< DataType > > mDataContainer
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE=0
QCPColorGradient gradient() const
const_iterator findEnd(double sortKey, bool expandedRange=true) const
bool clipToAxisRect() const
QPen whiskerBarPen() const
QBrush brushNegative() const
QCPItemPosition *const end
QCPColorMapData * mMapData
bool subGridVisible() const
QCPLayout * mParentLayout
virtual int calculateAutoMargin(QCP::MarginSide side) Q_DECL_OVERRIDE
void drawLine(const QPointF &p1, const QPointF &p2)
The base class tick generator used by QCPAxis to create tick positions and tick labels.
virtual QCPDataSelection selectTestRect(const QRectF &rect, bool onlySelectable) const
PainterModes modes() const
QCPRange dataRange() const
static QCPStatisticalBoxData fromSortKey(double sortKey)
The abstract base class for paint buffers, which define the rendering backend.
QCPDataContainer< QCPStatisticalBoxData > QCPStatisticalBoxDataContainer
QCP::AntialiasedElements antialiasedElements() const
QCPDataSelection selection() const
void set(const QCPDataContainer< DataType > &data)
Holds the data of one single data point for QCPCurve.
QCPRange keyRange() const
QList< QCPDataRange > dataRanges() const
QCPLineEnding tail() const
bool mNumberBeautifulPowers
QCPItemAnchor *const center
A selection decorator which draws brackets around each selected data segment.
QCPRange valueRange() const
A legend item representing a plottable with an icon and the plottable name.
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
QBrush selectedBrush() const
QCPItemPosition *const start
int numberPrecision() const
bool tangentToData() const
QByteArray mLabelParameterHash
0x01 Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fix...
QCPAbstractPlottable * plottable()
bool contains(double value) const
PositionType typeX() const
virtual void wheelEvent(QWheelEvent *event)
Controls how a plottable's data selection is drawn.
QCPItemPosition *const topLeft
SelectableParts mSelectedParts
bool operator!=(const QCPDataRange &other) const
QPen selectedBorderPen() const
The abstract base class for all entries in a QCPLegend.
QCPItemAnchor *const topRight
const QCPVector2D operator-(const QCPVector2D &vec1, const QCPVector2D &vec2)
virtual QCPRange dataValueRange(int index) const
bool mAntialiasedZeroLine
void setAutoSqueeze(bool enabled)
QColor mSelectedTextColor
double dot(const QCPVector2D &vec) const
0x0001 Axis base line and tick marks
QPainterPath customPath() const
QCP::SelectionType selectable() const
Responsible for drawing the grid of a QCPAxis.
Qt::Alignment positionAlignment() const
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
QCPItemAnchor * parentAnchor() const
QVector< QString > tickLabels
Qt::AspectRatioMode backgroundScaledMode() const
virtual QCP::Interaction selectionCategory() const Q_DECL_OVERRIDE
QSize maximumSize() const
QCPDataRange dataRange() const
const QCPRange range() const
Specialized axis ticker which allows arbitrary labels at specified coordinates.
QCPColorGradient mGradient
Defines an abstract interface for one-dimensional plottables.
QSharedPointer< QCPStatisticalBoxDataContainer > data() const
The selection rect is disabled, and all mouse events are forwarded to the underlying objects...
QCPColorMapData * data() const
bool noAntialiasingOnDrag() const
QRect axisSelectionBox() const
const_iterator constEnd() const
Provides rect/rubber-band data selection and range zoom interaction.
QList< QCPItemPosition * > mPositions
QCP::PlottingHints plottingHints() const
QCustomPlot * mParentPlot
QColor labelColor() const
An anchor of an item to which positions can be attached to.
ScaleStrategy mScaleStrategy
Qt::Orientations mRangeZoom
void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
QCPItemAnchor *const bottomLeftRim
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
QCPScatterStyle mScatterStyle
QBrush selectedBrush() const
QCPAxis * keyAxis() const
QCache< QString, CachedLabel > mLabelCache
virtual int findBegin(double sortKey, bool expandedRange=true) const
QString dateTimeFormat() const
QCPItemPosition *const right
QCP::MarginSides autoMargins() const
QVector< double > subTickPositions
QCPRange valueRange() const
const_iterator constBegin() const
QCPLineEnding head() const
QCPRange & operator*=(const double &value)
virtual QCPItemPosition * toQCPItemPosition() Q_DECL_OVERRIDE
Base class for all drawable objects.
static bool sortKeyIsMainKey()
QPixmap mBackgroundPixmap
QPen selectedBasePen() const
QSharedPointer< QCPAxisTicker > ticker() const
QCPRange valueRange() const
bool mGradientImageInvalidated
Specialized axis ticker suited for logarithmic axes.
QCPAxis::ScaleType dataScaleType() const
QBrush brushPositive() const
A plottable representing a bar chart in a plot.
const QCP::Interactions interactions() const
virtual QCPPlottableInterface1D * interface1D()
QCPRange & operator+=(const double &value)
QVector< double > mTickVector
0x080 All other objects are selectable (e.g. your own derived layerables, other layout elements...
A curved line from one point to another.
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap) ...
bool operator!=(const QCPRange &other) const
QFont selectedTickLabelFont() const
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos)
QColor mSelectedTextColor
bool mScaledPixmapInvalidated
virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE
QPointer< QCPBars > mBarBelow
QCustomPlot * mParentPlot
QList< QCPLayerable * > children() const
QCPScatterStyle mScatterStyle
0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixma...
A layout that arranges child elements in a grid.
int tangentAverage() const
QVector< DataType >::iterator iterator
int pixelOrientation() const
QCPRange valueRange() const
QPointer< QCPAbstractPlottable > mDataPlottable
double mBufferDevicePixelRatio
QPoint bottomLeft() const
QCPScatterStyle mOutlierStyle
Multiple contiguous data points (a data range) can be selected.
QList< QCPLayer * > mLayers
QCP::AntialiasedElements mNotAntialiasedElements
QCPItemAnchor *const bottom
0x0040 Main lines of items
QImage mUndersampledMapImage
Represents two doubles as a mathematical 2D vector.
QCPVector2D perpendicular() const
Holds the data of one single data point for QCPGraph.
QCP::MarginSides mAutoMargins
The abstract base class for all data representing objects in a plot.
FractionStyle mFractionStyle
QCPScatterStyle outlierStyle() const
QVector< QString > tickVectorLabels() const
A plottable representing a single statistical box in a plot.
QColor tickLabelColor() const
Qt::Alignment textAlignment() const
bool autoAddPlottableToLegend() const
BracketStyle bracketStyle() const
QCPItemAnchor *const left
QPointer< QCPAxis > mValueAxis
QList< QCPBars * > bars() const
QList< QPointer< QCPAxis > > mRangeDragVertAxis
QCPDataRange adjusted(int changeBegin, int changeEnd) const
QPen selectedTickPen() const
QPointer< QCPAxis > mColorAxis
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable) ...
Q_SLOT void setSelectable(QCP::SelectionType selectable)
QCPItemAnchor * parentAnchorY() const
virtual QPointF dataPixelPosition(int index) const
QColor selectedColor() const
QCPItemPosition *const endDir
bool antialiasedSubGrid() const
QCPDataContainer< QCPCurveData > QCPCurveDataContainer
QVector< QCPErrorBarsData > QCPErrorBarsDataContainer
QCPItemPosition *const bottomRight
virtual int findEnd(double sortKey, bool expandedRange=true) const
QColor selectedTextColor() const
QCPColorGradient mGradient
Q_DECLARE_TYPEINFO(QCPVector2D, Q_MOVABLE_TYPE)
bool antialiasedFill() const
QList< QPointer< QCPAxis > > mRangeZoomVertAxis
Qt::AspectRatioMode aspectRatioMode() const
QCustomPlot * mParentPlot
QCPColorScale * colorScale() const
A plottable representing a graph in a plot.
QCPAbstractPlottable * mPlottable
QCPItemPosition *const start
int iconTextPadding() const
The abstract base class for all items in a plot.
QList< QRectF > mInsetRect
QCPLayoutInset * mInsetLayout
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
QRect tickLabelsSelectionBox() const
Item that sticks to QCPGraph data points.
static QCPFinancialData fromSortKey(double sortKey)
double whiskerWidth() const
A layout element displaying a text.
QCPLegend * mParentLegend
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const =0
QRect mTickLabelsSelectionBox
const QCPVector2D operator*(double factor, const QCPVector2D &vec)
QCPItemAnchor *const right
bool mNoAntialiasingOnDrag
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem) ...
int columnSpacing() const
bool backgroundScaled() const
TickStepStrategy mTickStepStrategy
Manages a single axis inside a QCustomPlot.
QCPLineEnding tail() const
QList< QCPItemAnchor * > anchors() const
QCPAxis::AxisType type() const
QCPBarsGroup * barsGroup() const
bool isPenDefined() const
virtual QCPPlottableInterface1D * interface1D() Q_DECL_OVERRIDE
void drawLine(const QLineF &line)
QCPScatterStyle scatterStyle() const
double tickOrigin() const
static QCPBarsData fromSortKey(double sortKey)
QHash< TimeUnit, QString > mFormatPattern
QCPItemAnchor *const topRight
QCPColorScale * mParentColorScale
QCPItemAnchor *const topLeftRim
Represents the visual appearance of scatter points.
Manages a legend inside a QCustomPlot.
QList< QCPItemPosition * > positions() const
QList< QCPLayerable * > mChildren
QSet< QCPItemPosition * > mChildrenY
QSharedPointer< QCPGraphDataContainer > data() const
PositionType mPositionTypeY
QCPLayerable * parentLayerable() const
QPointer< QCPColorScaleAxisRectPrivate > mAxisRect
QCPSelectionRect * mSelectionRect
Cosmetic pens are converted to pens with pixel width 1 when exporting.
Qt::AspectRatioMode mBackgroundScaledMode
When dragging the mouse, a selection rect becomes active. Upon releasing, the axes that are currently...
bool abbreviateDecimalPowers
0x0100 Borders of fills (e.g. under or between graphs)
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
QList< double > rowStretchFactors() const
QCPItemAnchor *const bottomRight
QCPItemAnchor *const bottomLeft
virtual void update(UpdatePhase phase) Q_DECL_OVERRIDE
QPointer< QCPAxis > mValueAxis
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const =0
The plottable is not selectable.
QCPRange valueRange() const
QVector< double > mSubTickVector
QCPDataRange dataRange(int index=0) const
QPointer< QCPLayerable > mMouseEventLayerable
int dataRangeCount() const
QCPItemAnchor *const topRightRim
A layer that may contain objects, to control the rendering order.
Qt::Orientation orientation() const
QCPItemPosition *const position
Selection behaves like stMultipleDataRanges, but if there are any data points selected, the entire plottable is drawn as selected.
bool interpolating() const
The abstract base class for all objects that form the layout system.
const QCPVector2D operator/(const QCPVector2D &vec, double divisor)
QVector< DataType > mData
QCPAxis * keyAxis() const
QList< InsetPlacement > mInsetPlacement
QCPColorGradient gradient() const
void setPen(const QPen &pen)
QCPLineEnding upperEnding
QMap< double, QString > & ticks()
virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE
Qt::AspectRatioMode mAspectRatioMode
Cosmetic pens are exported normally (e.g. in PDF exports, cosmetic pens always appear as 1 pixel on s...
static QCPCurveData fromSortKey(double sortKey)
QPen selectedIconBorderPen() const
bool operator!=(const QCPDataSelection &other) const
Describes a data set by holding multiple QCPDataRange instances.
QCPItemAnchor * parentAnchorX() const
virtual void donePainting()
A straight line that spans infinitely in both directions.
QCPBarsGroup * mBarsGroup
QCPItemAnchor *const left
bool operator==(const QCPDataRange &other) const
QFont tickLabelFont() const
void preallocateGrow(int minimumPreallocSize)
Specialized axis ticker for calendar dates and times as axis ticks.
QCPSelectionDecorator * selectionDecorator() const
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const Q_DECL_OVERRIDE
const QMetaObject staticMetaObject
A layout that places child elements aligned to the border or arbitrarily positioned.
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts) ...
void remove(double sortKeyFrom, double sortKeyTo)
Handles the different ending decorations for line-like items.
A color scale for use with color coding data such as QCPColorMap.
QCP::PlottingHints mPlottingHints
QCPAxis * valueAxis() const
QCPAbstractPlottable * dataPlottable() const
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
virtual QCPItemPosition * toQCPItemPosition()
QPointer< QCPAxisRect > mClipAxisRect
bool mAntialiasedScatters
QVector< QString > mTickVectorLabels
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
Both sign domains, including zero, i.e. all numbers.
QList< QCPAbstractPlottable * > mPlottables
QPainter subclass used internally.
Qt::TransformationMode transformationMode() const
Qt::KeyboardModifier multiSelectModifier() const
QMap< double, QString > mTicks
QCPScatterStyle scatterStyle() const
WidthType widthType() const
const QCPVector2D operator+(const QCPVector2D &vec1, const QCPVector2D &vec2)
void coordsToPixels(double key, double value, double &x, double &y) const
QFont selectedLabelFont() const
static bool sortKeyIsMainKey()
Holds the data of one single data point (one bar) for QCPBars.
QCPItemAnchor *const bottom
virtual bool sortKeyIsMainKey() const
QCPSelectionDecorator * mSelectionDecorator
QCPScatterStyle::ScatterProperties usedScatterProperties() const
QCPLineEnding head() const
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
SelectableParts mSelectedParts
virtual QCPPlottableInterface1D * interface1D()
QVector< QRgb > mColorBuffer
QCPAxisRect * axisRect() const
QCPAbstractItem * mParentItem
double lengthSquared() const
QCP::SelectionRectMode mSelectionRectMode
int selectionTolerance() const
LineStyle lineStyle() const
QMargins minimumMargins() const
When dragging the mouse, a selection rect becomes active. It is the programmer's responsibility to co...
Qt::TimeSpec mDateTimeSpec
QCPRange & operator/=(const double &value)
Qt::Orientation mOrientation
0x01 The pen property, see setPen
QRect labelSelectionBox() const
static const double minRange
int bracketHeight() const
bool backgroundScaled() const
QCPDataContainer< QCPBarsData > QCPBarsDataContainer
QCPRange valueRange() const
QCPItemAnchor *const bottom
0x0020 Main lines of plottables
QBrush bracketBrush() const
QBrush selectedBrush() const
Qt::Orientations rangeZoom() const
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
QFont selectedFont() const
QVector< DataType >::const_iterator const_iterator
QCPBars * barBelow() const
bool rangeReversed() const
QColor selectedTextColor() const
QCPItemAnchor *const center
static QCPGraphData fromSortKey(double sortKey)
QBrush backgroundBrush() const
A plottable representing a parametric curve in a plot.
QCPItemPosition *const topLeft
QCPItemAnchor *const bottom
bool mAutoAddPlottableToLegend
QList< Qt::Alignment > mInsetAlignment
QSharedPointer< QCPBarsDataContainer > data() const
QCustomPlot * parentPlot() const
Specialized axis ticker to display ticks in units of an arbitrary constant, for example pi...
QVector< double > tickVector() const
const_iterator at(int index) const
QList< double > mColumnStretchFactors
bool mMapImageInvalidated
BracketStyle style() const
QCPItemAnchor *const bottomRightRim
SelectableParts selectedParts() const
QCPRange keyRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth)
QPointer< QCPColorScale > mColorScale
QCPScatterStyle scatterStyle() const
virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
QCPLayoutInset * insetLayout() const
QCPAbstractPlottable1D(QCPAxis *keyAxis, QCPAxis *valueAxis)
static bool sortKeyIsMainKey()
QCPLegend * parentLegend() const
QColor selectedTickLabelColor() const
QMap< double, QColor > mColorStops
QStack< bool > mAntialiasingStack
FillOrder fillOrder() const
QCPItemPosition *const point1
QCPAxis::ScaleType mDataScaleType
Describes a data range given by begin and end index.
QCP::SelectionType mSelectable
QCPAxis::ScaleType mDataScaleType
QCPItemAnchor *const bottomLeft
LineStyle lineStyle() const
QWeakPointer< QCPAbstractPaintBuffer > mPaintBuffer
QBrush selectedBrush() const
QSharedPointer< QCPErrorBarsDataContainer > mDataContainer
QHash< QCPAxis::AxisType, QList< QCPAxis * > > mAxes
QCPItemAnchor *const right
QPen selectedSubTickPen() const
ChartStyle chartStyle() const
int fieldWidth(TimeUnit unit) const
QCPDataSelection mSelection
QCPItemPosition *const startDir
virtual QRect clipRect() const Q_DECL_OVERRIDE
QCPSelectionRect * selectionRect() const
The generic data container for one-dimensional plottables.
void add(const QCPDataContainer< DataType > &data)
QCPRange valueRange(bool &foundRange, QCP::SignDomain signDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange())
QColor selectedLabelColor() const
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
Holds the two-dimensional data of a QCPColorMap plottable.
QList< QCPAbstractItem * > mItems
PositionType typeY() const
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
void addDataRange(const QCPDataRange &dataRange, bool simplify=true)
double mRangeZoomFactorVert
A plottable representing a financial stock chart.
FractionStyle fractionStyle() const
void squeeze(bool preAllocation=true, bool postAllocation=true)
TracerStyle style() const
QBrush selectedBrush() const
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
void drawPolyline(QCPPainter *painter, const QVector< QPointF > &lineData) const
QCPAxisPainterPrivate * mAxisPainter
The abstract base class for layouts.
Holds the data of one single data point for QCPFinancial.
QPen mSelectedIconBorderPen
QCPItemPosition *const bottomRight
Any combination of data points/ranges can be selected.
void setBrush(const QBrush &brush)
Resolution is given in dots per centimeter (dpcm)
bool mOpenGlCacheLabelsBackup
virtual int elementCount() const Q_DECL_OVERRIDE
QCPItemAnchor *const left
QCPAbstractPlottable * mPlottable
virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
ColorInterpolation mColorInterpolation
void removeAfter(double sortKey)
void performAutoSqueeze()
QCPBars * barAbove() const
QCPItemAnchor *const bottomLeft
A plottable representing a two-dimensional color map in a plot.
void removeBefore(double sortKey)
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
QCPAxis * valueAxis() const
QCPItemPosition *const position
double stackingGap() const
virtual void mousePressEvent(QMouseEvent *event, const QVariant &details)
virtual ~QCPAbstractPlottable1D()
QCPAxis::LabelSide tickLabelSide
The positive sign domain, i.e. numbers greater than zero.
static bool sortKeyIsMainKey()
QPointer< QCPLayerable > mParentLayerable
QCPItemAnchor *const topLeft
QCPItemAnchor *const right
WidthType widthType() const
QList< double > mRowStretchFactors
QPixmap mScaledBackgroundPixmap
When dragging the mouse, a selection rect becomes active. Upon releasing, plottable data points that ...
The negative sign domain, i.e. numbers smaller than zero.
virtual void mouseDoubleClickEvent(QMouseEvent *event, const QVariant &details)
QPoint bottomRight() const
QPointer< QCPAxisRect > mAxisRect
QList< QCPLayoutElement * > mElements
Qt::TransformationMode mTransformationMode
Qt::TimeSpec dateTimeSpec() const
QVector< double > tickPositions
static bool sortKeyIsMainKey()
void selectionChanged(bool selected)
QHash< TimeUnit, int > mFieldWidth
QFont selectedFont() const
QCPDataSelection inverse(const QCPDataRange &outerRange) const
void expand(const QCPRange &otherRange)
QCPRange dataBounds() const
A line from one point to another.
Holds the data of one single data point for QCPStatisticalBox.
A paint buffer based on QPixmap, using software raster rendering.
QColor mSelectedTextColor
bool contains(QCPBars *bars) const
bool whiskerAntialiased() const
SelectableParts selectableParts() const
QCPItemPosition *const point2
QVariant mMouseEventLayerableDetails
QCPItemAnchor * mParentAnchorY
double whiskerWidth() const
0x0200 Zero-lines, see QCPGrid::setZeroLinePen
void limitIteratorsToDataRange(const_iterator &begin, const_iterator &end, const QCPDataRange &dataRange) const
bool antialiasedScatters() const
Manages the position of an item.
QList< QCPRange > mDragStartVertRange
QPen iconBorderPen() const
QCPItemPosition *const end
BracketStyle mBracketStyle
QCPAxis::ScaleType dataScaleType() const
bool tightBoundary() const
void getDataSegments(QList< QCPDataRange > &selectedSegments, QList< QCPDataRange > &unselectedSegments) const
QCPDataContainer< QCPFinancialData > QCPFinancialDataContainer
QPixmap mBackgroundPixmap
Defines a color gradient for use with e.g. QCPColorMap.
QPixmap background() const
QList< double > columnStretchFactors() const
Resolution is given in dots per inch (DPI/PPI)
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
static Qt::Orientation orientation(AxisType type)
QPixmap mScaledBackgroundPixmap
QMap< double, QColor > colorStops() const
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
Represents the range an axis is encompassing.
0x8000 Other elements that don't fit into any of the existing categories
QCPRange dataRange() const
QCPLayoutGrid * mPlotLayout
QList< QCPItemAnchor * > mAnchors
QCPScatterStyle mScatterStyle
Groups multiple QCPBars together so they appear side by side.
QPixmap background() const
ColorInterpolation colorInterpolation() const
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
bool adaptiveSampling() const
QSize minimumSize() const
Qt::Orientations rangeDrag() const
virtual int dataCount() const
A template base class for plottables with one-dimensional data.
ScaleType scaleType() const
Resolution is given in dots per meter (dpm)
void pixelsToCoords(double x, double y, double &key, double &value) const
QCPItemPosition *const topLeft
SelectableParts selectableParts() const
bool antialiasedZeroLine() const
friend class QCPPlottableLegendItem
virtual double dataMainValue(int index) const
QCP::SelectionRectMode selectionRectMode() const
Qt::Alignment mPositionAlignment
Holds multiple axes and arranges them in a rectangular shape.
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
Qt::AspectRatioMode backgroundScaledMode() const
QCPDataRange bounded(const QCPDataRange &other) const
QCPItemAnchor *const left
Whether to use immediate or queued refresh depends on whether the plotting hint QCP::phImmediateRefre...
Specialized axis ticker with a fixed tick step.
A plottable that adds a set of error bars to other plottables.
Specialized axis ticker for time spans in units of milliseconds to days.
QCPScatterStyle::ScatterProperties mUsedScatterProperties
Qt::KeyboardModifier mMultiSelectModifier
QFont selectedFont() const
QCP::AntialiasedElements notAntialiasedElements() const
QVector< double > outliers
QCPRange & operator-=(const double &value)
QCP::Interactions mInteractions
QCPItemAnchor *const topRight
Qt::Alignment mTextAlignment
QCPDataContainer< QCPGraphData > QCPGraphDataContainer
QLatin1Char mNumberFormatChar
QCP::AntialiasedElements mOpenGlAntialiasedElementsBackup
QFont selectedFont() const
QCPItemPosition *const left
bool mColorBufferInvalidated
QCustomPlot * mParentPlot
QSharedPointer< QCPAxisTicker > mTicker
QPointer< QCPGraph > mChannelFillGraph
void selectableChanged(QCP::SelectionType selectable)
QCustomPlot * mParentPlot
ScatterShape shape() const
virtual double dataSortKey(int index) const
QCPItemPosition *const bottomRight
QCPItemAnchor *const right
QCPGraph * channelFillGraph() const
Qt::AspectRatioMode mBackgroundScaledMode
ScaleStrategy scaleStrategy() const
QColor selectedTextColor() const
QColor mSelectedLabelColor