33 #include <QPaintEvent>
34 #include <QMouseEvent>
48 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
49 # include <qnumeric.h>
53 # include <QtPrintSupport>
77 #if defined(QCUSTOMPLOT_COMPILE_LIBRARY)
78 # define QCP_LIB_DECL Q_DECL_EXPORT
79 #elif defined(QCUSTOMPLOT_USE_LIBRARY)
80 # define QCP_LIB_DECL Q_DECL_IMPORT
167 inline
bool isInvalidData(
double value)
169 return qIsNaN(value) || qIsInf(value);
177 inline bool isInvalidData(
double value1,
double value2)
179 return isInvalidData(value1) || isInvalidData(value2);
188 inline void setMarginValue(QMargins &margins,
QCP::MarginSide side,
int value)
194 case QCP::msTop: margins.setTop(value);
break;
196 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
208 inline int getMarginValue(
const QMargins &margins,
QCP::MarginSide side)
223 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
224 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCP::PlottingHints)
225 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCP::MarginSides)
226 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCP::Interactions)
264 QCPScatterStyle(ScatterShape shape,
const QColor &color,
const QColor &fill,
double size);
265 QCPScatterStyle(ScatterShape shape,
const QPen &pen,
const QBrush &brush,
double size);
267 QCPScatterStyle(
const QPainterPath &customPath,
const QPen &pen,
const QBrush &brush=Qt::NoBrush,
double size=6);
270 double size()
const {
return mSize; }
271 ScatterShape shape()
const {
return mShape; }
272 QPen pen()
const {
return mPen; }
273 QBrush brush()
const {
return mBrush; }
274 QPixmap pixmap()
const {
return mPixmap; }
275 QPainterPath customPath()
const {
return mCustomPath; }
278 void setSize(
double size);
279 void setShape(ScatterShape shape);
280 void setPen(
const QPen &pen);
281 void setBrush(
const QBrush &brush);
282 void setPixmap(
const QPixmap &pixmap);
283 void setCustomPath(
const QPainterPath &customPath);
286 bool isNone()
const {
return mShape == ssNone; }
288 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
289 void drawShape(
QCPPainter *painter, QPointF pos)
const;
290 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
299 QPainterPath mCustomPath;
318 ,pmNonCosmetic = 0x04
320 Q_FLAGS(PainterMode PainterModes)
321 Q_DECLARE_FLAGS(PainterModes, PainterMode)
324 QCPPainter(QPaintDevice *device);
328 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
329 PainterModes modes()
const {
return mModes; }
332 void setAntialiasing(
bool enabled);
333 void setMode(PainterMode mode,
bool enabled=
true);
334 void setModes(PainterModes modes);
337 bool begin(QPaintDevice *device);
338 void setPen(
const QPen &pen);
339 void setPen(
const QColor &color);
340 void setPen(Qt::PenStyle penStyle);
341 void drawLine(
const QLineF &line);
342 void drawLine(
const QPointF &p1,
const QPointF &p2) {drawLine(QLineF(p1, p2));}
347 void makeNonCosmetic();
352 bool mIsAntialiasing;
355 QStack<bool> mAntialiasingStack;
357 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
364 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
365 Q_PROPERTY(QString name READ name)
366 Q_PROPERTY(
int index READ index)
367 Q_PROPERTY(QList<QCPLayerable*> children READ children)
374 QCustomPlot *parentPlot()
const {
return mParentPlot; }
375 QString name()
const {
return mName; }
376 int index()
const {
return mIndex; }
377 QList<QCPLayerable*>
children()
const {
return mChildren; }
384 QList<QCPLayerable*> mChildren;
397 class QCP_LIB_DECL QCPLayerable : public QObject
401 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
402 Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
403 Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable)
404 Q_PROPERTY(
QCPLayer* layer READ layer WRITE setLayer)
405 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
408 QCPLayerable(QCustomPlot *plot, QString targetLayer=
"", QCPLayerable *parentLayerable=0);
412 bool visible()
const {
return mVisible; }
413 QCustomPlot *parentPlot()
const {
return mParentPlot; }
415 QCPLayer *layer()
const {
return mLayer; }
416 bool antialiased()
const {
return mAntialiased; }
419 void setVisible(
bool on);
421 bool setLayer(
const QString &layerName);
422 void setAntialiased(
bool enabled);
425 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
428 bool realVisibility()
const;
433 QCustomPlot *mParentPlot;
434 QPointer<QCPLayerable> mParentLayerable;
439 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
441 virtual QRect clipRect()
const;
442 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
445 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
446 virtual void deselectEvent(
bool *selectionStateChanged);
449 void initializeParentPlot(QCustomPlot *parentPlot);
450 void setParentLayerable(QCPLayerable* parentLayerable);
451 bool moveToLayer(
QCPLayer *layer,
bool prepend);
455 Q_DISABLE_COPY(QCPLayerable)
457 friend class QCustomPlot;
468 QCPRange(
double lower,
double upper);
471 double center()
const;
473 void expand(
const QCPRange &otherRange);
474 QCPRange expanded(
const QCPRange &otherRange)
const;
475 QCPRange sanitizedForLogScale()
const;
476 QCPRange sanitizedForLinScale()
const;
477 bool contains(
double value)
const;
479 static bool validRange(
double lower,
double upper);
480 static bool validRange(
const QCPRange &range);
484 Q_DECLARE_TYPEINFO(
QCPRange, Q_MOVABLE_TYPE);
496 bool isEmpty()
const;
501 QCustomPlot *mParentPlot;
502 QHash<QCP::MarginSide, QList<QCPLayoutElement*> > mChildren;
516 class QCP_LIB_DECL QCPLayoutElement : public QCPLayerable
520 Q_PROPERTY(
QCPLayout* layout READ layout)
521 Q_PROPERTY(QRect rect READ rect)
522 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
523 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
524 Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
525 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
526 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
529 explicit QCPLayoutElement(QCustomPlot *parentPlot=0);
530 virtual ~QCPLayoutElement();
534 QRect
rect()
const {
return mRect; }
535 QRect outerRect()
const {
return mOuterRect; }
536 QMargins margins()
const {
return mMargins; }
537 QMargins minimumMargins()
const {
return mMinimumMargins; }
538 QCP::MarginSides autoMargins()
const {
return mAutoMargins; }
539 QSize minimumSize()
const {
return mMinimumSize; }
540 QSize maximumSize()
const {
return mMaximumSize; }
542 QHash<QCP::MarginSide, QCPMarginGroup*> marginGroups()
const {
return mMarginGroups; }
545 void setOuterRect(
const QRect &rect);
546 void setMargins(
const QMargins &margins);
547 void setMinimumMargins(
const QMargins &margins);
548 void setAutoMargins(QCP::MarginSides sides);
549 void setMinimumSize(
const QSize &size);
550 void setMinimumSize(
int width,
int height);
551 void setMaximumSize(
const QSize &size);
552 void setMaximumSize(
int width,
int height);
553 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
556 virtual void update();
557 virtual QSize minimumSizeHint()
const;
558 virtual QSize maximumSizeHint()
const;
559 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
562 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
567 QSize mMinimumSize, mMaximumSize;
568 QRect mRect, mOuterRect;
569 QMargins mMargins, mMinimumMargins;
570 QCP::MarginSides mAutoMargins;
571 QHash<QCP::MarginSide, QCPMarginGroup*> mMarginGroups;
580 virtual void wheelEvent(QWheelEvent *event) {Q_UNUSED(event)}
583 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const { Q_UNUSED(painter) }
584 virtual void draw(
QCPPainter *painter) { Q_UNUSED(painter) }
585 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
588 Q_DISABLE_COPY(QCPLayoutElement)
590 friend class QCustomPlot;
596 class QCP_LIB_DECL QCPLayout : public QCPLayoutElement
600 explicit QCPLayout();
603 virtual void update();
604 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
607 virtual int elementCount()
const = 0;
608 virtual QCPLayoutElement* elementAt(
int index)
const = 0;
609 virtual QCPLayoutElement* takeAt(
int index) = 0;
610 virtual bool take(QCPLayoutElement* element) = 0;
611 virtual void simplify();
614 bool removeAt(
int index);
615 bool remove(QCPLayoutElement* element);
620 virtual void updateLayout();
623 void sizeConstraintsChanged()
const;
624 void adoptElement(QCPLayoutElement *el);
625 void releaseElement(QCPLayoutElement *el);
626 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
const;
629 Q_DISABLE_COPY(QCPLayout)
630 friend class QCPLayoutElement;
638 Q_PROPERTY(
int rowCount READ rowCount)
639 Q_PROPERTY(
int columnCount READ columnCount)
640 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
641 Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
642 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
643 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
650 int rowCount()
const;
651 int columnCount()
const;
652 QList<double> columnStretchFactors()
const {
return mColumnStretchFactors; }
653 QList<double> rowStretchFactors()
const {
return mRowStretchFactors; }
654 int columnSpacing()
const {
return mColumnSpacing; }
655 int rowSpacing()
const {
return mRowSpacing; }
658 void setColumnStretchFactor(
int column,
double factor);
659 void setColumnStretchFactors(
const QList<double> &factors);
660 void setRowStretchFactor(
int row,
double factor);
661 void setRowStretchFactors(
const QList<double> &factors);
662 void setColumnSpacing(
int pixels);
663 void setRowSpacing(
int pixels);
666 virtual void updateLayout();
668 virtual QCPLayoutElement*
elementAt(
int index)
const;
669 virtual QCPLayoutElement*
takeAt(
int index);
670 virtual bool take(QCPLayoutElement* element);
671 virtual QList<QCPLayoutElement*>
elements(
bool recursive)
const;
677 QCPLayoutElement *element(
int row,
int column)
const;
678 bool addElement(
int row,
int column, QCPLayoutElement *element);
679 bool hasElement(
int row,
int column);
680 void expandTo(
int newRowCount,
int newColumnCount);
681 void insertRow(
int newIndex);
682 void insertColumn(
int newIndex);
686 QList<QList<QCPLayoutElement*> > mElements;
687 QList<double> mColumnStretchFactors;
688 QList<double> mRowStretchFactors;
689 int mColumnSpacing, mRowSpacing;
692 void getMinimumRowColSizes(QVector<int> *minColWidths, QVector<int> *minRowHeights)
const;
693 void getMaximumRowColSizes(QVector<int> *maxColWidths, QVector<int> *maxRowHeights)
const;
715 InsetPlacement insetPlacement(
int index)
const;
716 Qt::Alignment insetAlignment(
int index)
const;
717 QRectF insetRect(
int index)
const;
720 void setInsetPlacement(
int index, InsetPlacement placement);
721 void setInsetAlignment(
int index, Qt::Alignment alignment);
722 void setInsetRect(
int index,
const QRectF &rect);
725 virtual void updateLayout();
727 virtual QCPLayoutElement*
elementAt(
int index)
const;
728 virtual QCPLayoutElement*
takeAt(
int index);
729 virtual bool take(QCPLayoutElement* element);
731 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
734 void addElement(QCPLayoutElement *element, Qt::Alignment alignment);
735 void addElement(QCPLayoutElement *element,
const QRectF &rect);
739 QList<QCPLayoutElement*> mElements;
740 QList<InsetPlacement> mInsetPlacement;
741 QList<Qt::Alignment> mInsetAlignment;
742 QList<QRectF> mInsetRect;
778 QCPLineEnding(EndingStyle style,
double width=8,
double length=10,
bool inverted=
false);
781 EndingStyle style()
const {
return mStyle; }
782 double width()
const {
return mWidth; }
783 double length()
const {
return mLength; }
784 bool inverted()
const {
return mInverted; }
787 void setStyle(EndingStyle style);
788 void setWidth(
double width);
789 void setLength(
double length);
790 void setInverted(
bool inverted);
793 double boundingDistance()
const;
794 double realLength()
const;
795 void draw(
QCPPainter *painter,
const QVector2D &pos,
const QVector2D &dir)
const;
796 void draw(
QCPPainter *painter,
const QVector2D &pos,
double angle)
const;
801 double mWidth, mLength;
807 class QCP_LIB_DECL
QCPGrid :
public QCPLayerable
811 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
812 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
813 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
814 Q_PROPERTY(QPen pen READ pen WRITE setPen)
815 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
816 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
822 bool subGridVisible()
const {
return mSubGridVisible; }
823 bool antialiasedSubGrid()
const {
return mAntialiasedSubGrid; }
824 bool antialiasedZeroLine()
const {
return mAntialiasedZeroLine; }
825 QPen pen()
const {
return mPen; }
826 QPen subGridPen()
const {
return mSubGridPen; }
827 QPen zeroLinePen()
const {
return mZeroLinePen; }
830 void setSubGridVisible(
bool visible);
831 void setAntialiasedSubGrid(
bool enabled);
832 void setAntialiasedZeroLine(
bool enabled);
833 void setPen(
const QPen &pen);
834 void setSubGridPen(
const QPen &pen);
835 void setZeroLinePen(
const QPen &pen);
839 bool mSubGridVisible;
840 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
841 QPen mPen, mSubGridPen, mZeroLinePen;
846 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
850 void drawGridLines(
QCPPainter *painter)
const;
851 void drawSubGridLines(
QCPPainter *painter)
const;
857 class QCP_LIB_DECL
QCPAxis :
public QCPLayerable
861 Q_PROPERTY(
AxisType axisType READ axisType)
863 Q_PROPERTY(
ScaleType scaleType READ scaleType WRITE setScaleType)
864 Q_PROPERTY(
double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
865 Q_PROPERTY(
QCPRange range READ range WRITE setRange)
866 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
867 Q_PROPERTY(
bool autoTicks READ autoTicks WRITE setAutoTicks)
868 Q_PROPERTY(
int autoTickCount READ autoTickCount WRITE setAutoTickCount)
869 Q_PROPERTY(
bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
870 Q_PROPERTY(
bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
871 Q_PROPERTY(
bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
872 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
873 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
874 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
875 Q_PROPERTY(
LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
876 Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
877 Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
878 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
879 Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
880 Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
881 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
882 Q_PROPERTY(
double tickStep READ tickStep WRITE setTickStep)
883 Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
884 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels)
885 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
886 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
887 Q_PROPERTY(
int subTickCount READ subTickCount WRITE setSubTickCount)
888 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
889 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
890 Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
891 Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
892 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
893 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
894 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
895 Q_PROPERTY(QString label READ label WRITE setLabel)
896 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
897 Q_PROPERTY(
int padding READ padding WRITE setPadding)
898 Q_PROPERTY(
int offset READ offset WRITE setOffset)
899 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts)
900 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts)
901 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
902 Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
903 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
904 Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
905 Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
906 Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
907 Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
908 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
909 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
910 Q_PROPERTY(
QCPGrid* grid READ grid)
922 Q_FLAGS(AxisType AxisTypes)
923 Q_DECLARE_FLAGS(AxisTypes, AxisType)
948 ,spTickLabels = 0x002
951 Q_FLAGS(SelectablePart SelectableParts)
952 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
957 AxisType axisType()
const {
return mAxisType; }
958 QCPAxisRect *axisRect()
const {
return mAxisRect; }
959 ScaleType scaleType()
const {
return mScaleType; }
960 double scaleLogBase()
const {
return mScaleLogBase; }
961 const QCPRange range()
const {
return mRange; }
962 bool rangeReversed()
const {
return mRangeReversed; }
963 bool autoTicks()
const {
return mAutoTicks; }
964 int autoTickCount()
const {
return mAutoTickCount; }
965 bool autoTickLabels()
const {
return mAutoTickLabels; }
966 bool autoTickStep()
const {
return mAutoTickStep; }
967 bool autoSubTicks()
const {
return mAutoSubTicks; }
968 bool ticks()
const {
return mTicks; }
969 bool tickLabels()
const {
return mTickLabels; }
970 int tickLabelPadding()
const {
return mTickLabelPadding; }
971 LabelType tickLabelType()
const {
return mTickLabelType; }
972 QFont tickLabelFont()
const {
return mTickLabelFont; }
973 QColor tickLabelColor()
const {
return mTickLabelColor; }
974 double tickLabelRotation()
const {
return mTickLabelRotation; }
975 QString dateTimeFormat()
const {
return mDateTimeFormat; }
976 Qt::TimeSpec dateTimeSpec()
const {
return mDateTimeSpec; }
977 QString numberFormat()
const;
978 int numberPrecision()
const {
return mNumberPrecision; }
979 double tickStep()
const {
return mTickStep; }
980 QVector<double> tickVector()
const {
return mTickVector; }
981 QVector<QString> tickVectorLabels()
const {
return mTickVectorLabels; }
982 int tickLengthIn()
const {
return mTickLengthIn; }
983 int tickLengthOut()
const {
return mTickLengthOut; }
984 int subTickCount()
const {
return mSubTickCount; }
985 int subTickLengthIn()
const {
return mSubTickLengthIn; }
986 int subTickLengthOut()
const {
return mSubTickLengthOut; }
987 QPen basePen()
const {
return mBasePen; }
988 QPen tickPen()
const {
return mTickPen; }
989 QPen subTickPen()
const {
return mSubTickPen; }
990 QFont labelFont()
const {
return mLabelFont; }
991 QColor labelColor()
const {
return mLabelColor; }
992 QString label()
const {
return mLabel; }
993 int labelPadding()
const {
return mLabelPadding; }
994 int padding()
const {
return mPadding; }
995 int offset()
const {
return mOffset; }
996 SelectableParts selectedParts()
const {
return mSelectedParts; }
997 SelectableParts selectableParts()
const {
return mSelectableParts; }
998 QFont selectedTickLabelFont()
const {
return mSelectedTickLabelFont; }
999 QFont selectedLabelFont()
const {
return mSelectedLabelFont; }
1000 QColor selectedTickLabelColor()
const {
return mSelectedTickLabelColor; }
1001 QColor selectedLabelColor()
const {
return mSelectedLabelColor; }
1002 QPen selectedBasePen()
const {
return mSelectedBasePen; }
1003 QPen selectedTickPen()
const {
return mSelectedTickPen; }
1004 QPen selectedSubTickPen()
const {
return mSelectedSubTickPen; }
1010 void setScaleType(ScaleType type);
1011 void setScaleLogBase(
double base);
1012 Q_SLOT
void setRange(
const QCPRange &range);
1013 void setRange(
double lower,
double upper);
1014 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
1015 void setRangeLower(
double lower);
1016 void setRangeUpper(
double upper);
1017 void setRangeReversed(
bool reversed);
1018 void setAutoTicks(
bool on);
1019 void setAutoTickCount(
int approximateCount);
1020 void setAutoTickLabels(
bool on);
1021 void setAutoTickStep(
bool on);
1022 void setAutoSubTicks(
bool on);
1023 void setTicks(
bool show);
1024 void setTickLabels(
bool show);
1025 void setTickLabelPadding(
int padding);
1026 void setTickLabelType(LabelType type);
1027 void setTickLabelFont(
const QFont &font);
1028 void setTickLabelColor(
const QColor &color);
1029 void setTickLabelRotation(
double degrees);
1030 void setDateTimeFormat(
const QString &format);
1031 void setDateTimeSpec(
const Qt::TimeSpec &timeSpec);
1032 void setNumberFormat(
const QString &formatCode);
1033 void setNumberPrecision(
int precision);
1034 void setTickStep(
double step);
1035 void setTickVector(
const QVector<double> &vec);
1036 void setTickVectorLabels(
const QVector<QString> &vec);
1037 void setTickLength(
int inside,
int outside=0);
1038 void setTickLengthIn(
int inside);
1039 void setTickLengthOut(
int outside);
1040 void setSubTickCount(
int count);
1041 void setSubTickLength(
int inside,
int outside=0);
1042 void setSubTickLengthIn(
int inside);
1043 void setSubTickLengthOut(
int outside);
1044 void setBasePen(
const QPen &pen);
1045 void setTickPen(
const QPen &pen);
1046 void setSubTickPen(
const QPen &pen);
1047 void setLabelFont(
const QFont &font);
1048 void setLabelColor(
const QColor &color);
1049 void setLabel(
const QString &str);
1050 void setLabelPadding(
int padding);
1051 void setPadding(
int padding);
1052 void setOffset(
int offset);
1053 void setSelectedTickLabelFont(
const QFont &font);
1054 void setSelectedLabelFont(
const QFont &font);
1055 void setSelectedTickLabelColor(
const QColor &color);
1056 void setSelectedLabelColor(
const QColor &color);
1057 void setSelectedBasePen(
const QPen &pen);
1058 void setSelectedTickPen(
const QPen &pen);
1059 void setSelectedSubTickPen(
const QPen &pen);
1060 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
1061 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
1066 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
1070 void moveRange(
double diff);
1071 void scaleRange(
double factor,
double center);
1072 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
1073 void rescale(
bool onlyVisiblePlottables=
false);
1074 double pixelToCoord(
double value)
const;
1075 double coordToPixel(
double value)
const;
1076 SelectablePart getPartAt(
const QPointF &pos)
const;
1077 QList<QCPAbstractPlottable*> plottables()
const;
1078 QList<QCPGraph*> graphs()
const;
1079 QList<QCPAbstractItem*> items()
const;
1084 void ticksRequest();
1085 void rangeChanged(
const QCPRange &newRange);
1087 void selectionChanged(
const QCPAxis::SelectableParts &parts);
1097 QString basePart, expPart;
1098 QRect baseBounds, expBounds, totalBounds, rotatedTotalBounds;
1099 QFont baseFont, expFont;
1106 int mOffset, mPadding;
1107 Qt::Orientation mOrientation;
1108 SelectableParts mSelectableParts, mSelectedParts;
1109 QPen mBasePen, mSelectedBasePen;
1114 QFont mLabelFont, mSelectedLabelFont;
1115 QColor mLabelColor, mSelectedLabelColor;
1117 int mTickLabelPadding;
1118 bool mTickLabels, mAutoTickLabels;
1119 double mTickLabelRotation;
1121 QFont mTickLabelFont, mSelectedTickLabelFont;
1122 QColor mTickLabelColor, mSelectedTickLabelColor;
1123 QString mDateTimeFormat;
1124 Qt::TimeSpec mDateTimeSpec;
1125 int mNumberPrecision;
1126 char mNumberFormatChar;
1127 bool mNumberBeautifulPowers;
1128 bool mNumberMultiplyCross;
1132 int mSubTickCount, mAutoTickCount;
1133 bool mAutoTicks, mAutoTickStep, mAutoSubTicks;
1134 int mTickLengthIn, mTickLengthOut, mSubTickLengthIn, mSubTickLengthOut;
1135 QPen mTickPen, mSelectedTickPen;
1136 QPen mSubTickPen, mSelectedSubTickPen;
1139 bool mRangeReversed;
1141 double mScaleLogBase, mScaleLogBaseLogInv;
1145 QCache<QString, CachedLabel> mLabelCache;
1146 int mLowestVisibleTick, mHighestVisibleTick;
1147 QChar mExponentialChar, mPositiveSignChar;
1148 QVector<double> mTickVector;
1149 QVector<QString> mTickVectorLabels;
1150 QVector<double> mSubTickVector;
1151 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
1152 bool mCachedMarginValid;
1156 virtual void setupTickVectors();
1157 virtual void generateAutoTicks();
1158 virtual int calculateAutoSubTickCount(
double tickStep)
const;
1159 virtual int calculateMargin();
1161 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
1163 virtual TickLabelData getTickLabelData(
const QFont &font,
const QString &text)
const;
1164 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
1165 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
1168 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1172 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1173 virtual void deselectEvent(
bool *selectionStateChanged);
1176 void visibleTickBounds(
int &lowIndex,
int &highIndex)
const;
1177 double baseLog(
double value)
const;
1178 double basePow(
double value)
const;
1179 QPen getBasePen()
const;
1180 QPen getTickPen()
const;
1181 QPen getSubTickPen()
const;
1182 QFont getTickLabelFont()
const;
1183 QFont getLabelFont()
const;
1184 QColor getTickLabelColor()
const;
1185 QColor getLabelColor()
const;
1190 friend class QCustomPlot;
1194 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::SelectableParts)
1195 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::AxisTypes)
1203 Q_PROPERTY(QString name READ name WRITE setName)
1204 Q_PROPERTY(
bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
1205 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters)
1206 Q_PROPERTY(
bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars)
1207 Q_PROPERTY(QPen pen READ pen WRITE setPen)
1208 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
1209 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
1210 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
1211 Q_PROPERTY(
QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis)
1212 Q_PROPERTY(
QCPAxis* valueAxis READ valueAxis WRITE setValueAxis)
1213 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable)
1214 Q_PROPERTY(
bool selected READ selected WRITE setSelected)
1220 QString name()
const {
return mName; }
1221 bool antialiasedFill()
const {
return mAntialiasedFill; }
1222 bool antialiasedScatters()
const {
return mAntialiasedScatters; }
1223 bool antialiasedErrorBars()
const {
return mAntialiasedErrorBars; }
1224 QPen pen()
const {
return mPen; }
1225 QPen selectedPen()
const {
return mSelectedPen; }
1226 QBrush brush()
const {
return mBrush; }
1227 QBrush selectedBrush()
const {
return mSelectedBrush; }
1228 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
1229 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
1230 bool selectable()
const {
return mSelectable; }
1231 bool selected()
const {
return mSelected; }
1234 void setName(
const QString &name);
1235 void setAntialiasedFill(
bool enabled);
1236 void setAntialiasedScatters(
bool enabled);
1237 void setAntialiasedErrorBars(
bool enabled);
1238 void setPen(
const QPen &pen);
1239 void setSelectedPen(
const QPen &pen);
1240 void setBrush(
const QBrush &brush);
1241 void setSelectedBrush(
const QBrush &brush);
1242 void setKeyAxis(
QCPAxis *axis);
1243 void setValueAxis(
QCPAxis *axis);
1244 Q_SLOT
void setSelectable(
bool selectable);
1245 Q_SLOT
void setSelected(
bool selected);
1248 virtual void clearData() = 0;
1249 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1250 virtual bool addToLegend();
1251 virtual bool removeFromLegend()
const;
1254 void rescaleAxes(
bool onlyEnlarge=
false)
const;
1255 void rescaleKeyAxis(
bool onlyEnlarge=
false)
const;
1256 void rescaleValueAxis(
bool onlyEnlarge=
false)
const;
1259 void selectionChanged(
bool selected);
1272 bool mAntialiasedFill, mAntialiasedScatters, mAntialiasedErrorBars;
1273 QPen mPen, mSelectedPen;
1274 QBrush mBrush, mSelectedBrush;
1275 QPointer<QCPAxis> mKeyAxis, mValueAxis;
1276 bool mSelectable, mSelected;
1279 virtual QRect clipRect()
const;
1282 void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1284 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1285 virtual void deselectEvent(
bool *selectionStateChanged);
1288 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const = 0;
1289 virtual QCPRange getKeyRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const = 0;
1290 virtual QCPRange getValueRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const = 0;
1293 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
1294 const QPointF coordsToPixels(
double key,
double value)
const;
1295 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
1296 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
1297 QPen mainPen()
const;
1298 QBrush mainBrush()
const;
1299 void applyFillAntialiasingHint(
QCPPainter *painter)
const;
1300 void applyScattersAntialiasingHint(
QCPPainter *painter)
const;
1301 void applyErrorBarsAntialiasingHint(
QCPPainter *painter)
const;
1302 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1307 friend class QCustomPlot;
1316 QCPItemAnchor(QCustomPlot *parentPlot,
QCPAbstractItem *parentItem,
const QString name,
int anchorId=-1);
1317 virtual ~QCPItemAnchor();
1320 QString name()
const {
return mName; }
1321 virtual QPointF pixelPoint()
const;
1328 QCustomPlot *mParentPlot;
1331 QSet<QCPItemPosition*> mChildren;
1341 Q_DISABLE_COPY(QCPItemAnchor)
1348 class QCP_LIB_DECL QCPItemPosition : public QCPItemAnchor
1363 QCPItemPosition(QCustomPlot *parentPlot,
QCPAbstractItem *parentItem,
const QString name);
1364 virtual ~QCPItemPosition();
1367 PositionType type()
const {
return mPositionType; }
1368 QCPItemAnchor *parentAnchor()
const {
return mParentAnchor; }
1369 double key()
const {
return mKey; }
1370 double value()
const {
return mValue; }
1371 QPointF coords()
const {
return QPointF(mKey, mValue); }
1372 QCPAxis *keyAxis()
const {
return mKeyAxis.data(); }
1373 QCPAxis *valueAxis()
const {
return mValueAxis.data(); }
1374 QCPAxisRect *axisRect()
const;
1375 virtual QPointF pixelPoint()
const;
1378 void setType(PositionType type);
1379 bool setParentAnchor(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1380 void setCoords(
double key,
double value);
1381 void setCoords(
const QPointF &coords);
1382 void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
1383 void setAxisRect(QCPAxisRect *axisRect);
1384 void setPixelPoint(
const QPointF &pixelPoint);
1388 PositionType mPositionType;
1389 QPointer<QCPAxis> mKeyAxis, mValueAxis;
1390 QPointer<QCPAxisRect> mAxisRect;
1391 double mKey, mValue;
1392 QCPItemAnchor *mParentAnchor;
1398 Q_DISABLE_COPY(QCPItemPosition)
1407 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
1408 Q_PROPERTY(QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
1409 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable)
1410 Q_PROPERTY(
bool selected READ selected WRITE setSelected)
1417 bool clipToAxisRect()
const {
return mClipToAxisRect; }
1418 QCPAxisRect *clipAxisRect()
const;
1419 bool selectable()
const {
return mSelectable; }
1420 bool selected()
const {
return mSelected; }
1423 void setClipToAxisRect(
bool clip);
1424 void setClipAxisRect(QCPAxisRect *rect);
1425 void setSelectable(
bool selectable);
1426 void setSelected(
bool selected);
1429 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1432 QList<QCPItemPosition*>
positions()
const {
return mPositions; }
1433 QList<QCPItemAnchor*>
anchors()
const {
return mAnchors; }
1434 QCPItemPosition *position(
const QString &name)
const;
1435 QCPItemAnchor *anchor(
const QString &name)
const;
1436 bool hasAnchor(
const QString &name)
const;
1439 void selectionChanged(
bool selected);
1443 bool mClipToAxisRect;
1444 QPointer<QCPAxisRect> mClipAxisRect;
1445 QList<QCPItemPosition*> mPositions;
1446 QList<QCPItemAnchor*> mAnchors;
1447 bool mSelectable, mSelected;
1451 virtual QRect clipRect()
const;
1452 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1455 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1456 virtual void deselectEvent(
bool *selectionStateChanged);
1459 virtual QPointF anchorPixelPoint(
int anchorId)
const;
1462 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1463 double rectSelectTest(
const QRectF &rect,
const QPointF &pos,
bool filledRect)
const;
1464 QCPItemPosition *createPosition(
const QString &name);
1465 QCPItemAnchor *createAnchor(
const QString &name,
int anchorId);
1470 friend class QCustomPlot;
1471 friend class QCPItemAnchor;
1475 class QCP_LIB_DECL QCustomPlot : public QWidget
1479 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
1480 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1481 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1482 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1484 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
1485 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
1486 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
1487 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
1498 Q_ENUMS(LayerInsertMode)
1500 explicit QCustomPlot(QWidget *parent = 0);
1501 virtual ~QCustomPlot();
1504 QRect viewport()
const {
return mViewport; }
1505 QPixmap background()
const {
return mBackgroundPixmap; }
1506 bool backgroundScaled()
const {
return mBackgroundScaled; }
1507 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
1509 QCP::AntialiasedElements antialiasedElements()
const {
return mAntialiasedElements; }
1510 QCP::AntialiasedElements notAntialiasedElements()
const {
return mNotAntialiasedElements; }
1511 bool autoAddPlottableToLegend()
const {
return mAutoAddPlottableToLegend; }
1512 const QCP::Interactions interactions()
const {
return mInteractions; }
1513 int selectionTolerance()
const {
return mSelectionTolerance; }
1514 bool noAntialiasingOnDrag()
const {
return mNoAntialiasingOnDrag; }
1515 QCP::PlottingHints plottingHints()
const {
return mPlottingHints; }
1516 Qt::KeyboardModifier multiSelectModifier()
const {
return mMultiSelectModifier; }
1519 void setViewport(
const QRect &rect);
1520 void setBackground(
const QPixmap &pm);
1521 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1522 void setBackground(
const QBrush &brush);
1523 void setBackgroundScaled(
bool scaled);
1524 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1525 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
1527 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
1529 void setAutoAddPlottableToLegend(
bool on);
1530 void setInteractions(
const QCP::Interactions &interactions);
1531 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
1532 void setSelectionTolerance(
int pixels);
1533 void setNoAntialiasingOnDrag(
bool enabled);
1534 void setPlottingHints(
const QCP::PlottingHints &hints);
1536 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
1544 bool removePlottable(
int index);
1545 int clearPlottables();
1546 int plottableCount()
const;
1547 QList<QCPAbstractPlottable*> selectedPlottables()
const;
1554 QCPGraph *addGraph(QCPAxis *keyAxis=0, QCPAxis *valueAxis=0);
1556 bool removeGraph(
int index);
1558 int graphCount()
const;
1559 QList<QCPGraph*> selectedGraphs()
const;
1566 bool removeItem(
int index);
1568 int itemCount()
const;
1569 QList<QCPAbstractItem*> selectedItems()
const;
1570 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
1574 QCPLayer *layer(
const QString &name)
const;
1577 bool setCurrentLayer(
const QString &name);
1578 bool setCurrentLayer(
QCPLayer *layer);
1579 int layerCount()
const;
1580 bool addLayer(
const QString &name,
QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove);
1582 bool moveLayer(
QCPLayer *layer,
QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
1585 int axisRectCount()
const;
1586 QCPAxisRect* axisRect(
int index=0)
const;
1587 QList<QCPAxisRect*> axisRects()
const;
1588 QCPLayoutElement* layoutElementAt(
const QPointF &pos)
const;
1589 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
1591 QList<QCPAxis*> selectedAxes()
const;
1592 QList<QCPLegend*> selectedLegends()
const;
1593 Q_SLOT
void deselectAll();
1595 bool savePdf(
const QString &fileName,
bool noCosmeticPen=
false,
int width=0,
int height=0);
1596 bool savePng(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1597 bool saveJpg(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1598 bool saveBmp(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0);
1599 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1);
1600 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
1601 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
1602 Q_SLOT
void replot();
1604 QCPAxis *xAxis, *yAxis, *xAxis2, *yAxis2;
1608 void mouseDoubleClick(QMouseEvent *event);
1609 void mousePress(QMouseEvent *event);
1610 void mouseMove(QMouseEvent *event);
1611 void mouseRelease(QMouseEvent *event);
1612 void mouseWheel(QWheelEvent *event);
1622 void titleClick(QMouseEvent *event,
QCPPlotTitle *title);
1623 void titleDoubleClick(QMouseEvent *event,
QCPPlotTitle *title);
1625 void selectionChangedByUser();
1626 void beforeReplot();
1633 bool mAutoAddPlottableToLegend;
1634 QList<QCPAbstractPlottable*> mPlottables;
1635 QList<QCPGraph*> mGraphs;
1636 QList<QCPAbstractItem*> mItems;
1637 QList<QCPLayer*> mLayers;
1638 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
1639 QCP::Interactions mInteractions;
1640 int mSelectionTolerance;
1641 bool mNoAntialiasingOnDrag;
1642 QBrush mBackgroundBrush;
1643 QPixmap mBackgroundPixmap;
1644 QPixmap mScaledBackgroundPixmap;
1645 bool mBackgroundScaled;
1646 Qt::AspectRatioMode mBackgroundScaledMode;
1648 QCP::PlottingHints mPlottingHints;
1649 Qt::KeyboardModifier mMultiSelectModifier;
1652 QPixmap mPaintBuffer;
1653 QPoint mMousePressPos;
1654 QCPLayoutElement *mMouseEventElement;
1658 virtual QSize minimumSizeHint()
const;
1659 virtual QSize sizeHint()
const;
1660 virtual void paintEvent(QPaintEvent *event);
1661 virtual void resizeEvent(QResizeEvent *event);
1662 virtual void mouseDoubleClickEvent(QMouseEvent *event);
1663 virtual void mousePressEvent(QMouseEvent *event);
1664 virtual void mouseMoveEvent(QMouseEvent *event);
1665 virtual void mouseReleaseEvent(QMouseEvent *event);
1666 virtual void wheelEvent(QWheelEvent *event);
1670 virtual void axisRemoved(QCPAxis *axis);
1671 virtual void legendRemoved(
QCPLegend *legend);
1674 void updateLayerIndices()
const;
1675 QCPLayerable *layerableAt(
const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=0)
const;
1679 friend class QCPAxis;
1681 friend class QCPAxisRect;
1693 QCPData(
double key,
double value);
1695 double keyErrorPlus, keyErrorMinus;
1696 double valueErrorPlus, valueErrorMinus;
1698 Q_DECLARE_TYPEINFO(
QCPData, Q_MOVABLE_TYPE);
1708 typedef QMapIterator<double, QCPData> QCPDataMapIterator;
1709 typedef QMutableMapIterator<double, QCPData> QCPDataMutableMapIterator;
1716 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
1717 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
1718 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
1719 Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen)
1720 Q_PROPERTY(
double errorBarSize READ errorBarSize WRITE setErrorBarSize)
1721 Q_PROPERTY(
bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol)
1722 Q_PROPERTY(
QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
1749 explicit
QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis);
1753 const QCPDataMap *data()
const {
return mData; }
1754 LineStyle lineStyle()
const {
return mLineStyle; }
1756 ErrorType errorType()
const {
return mErrorType; }
1757 QPen errorPen()
const {
return mErrorPen; }
1758 double errorBarSize()
const {
return mErrorBarSize; }
1759 bool errorBarSkipSymbol()
const {
return mErrorBarSkipSymbol; }
1760 QCPGraph *channelFillGraph()
const {
return mChannelFillGraph.data(); }
1763 void setData(QCPDataMap *data,
bool copy=
false);
1764 void setData(
const QVector<double> &key,
const QVector<double> &value);
1765 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError);
1766 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyErrorMinus,
const QVector<double> &keyErrorPlus);
1767 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueError);
1768 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueErrorMinus,
const QVector<double> &valueErrorPlus);
1769 void setDataBothError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError,
const QVector<double> &valueError);
1770 void setDataBothError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyErrorMinus,
const QVector<double> &keyErrorPlus,
const QVector<double> &valueErrorMinus,
const QVector<double> &valueErrorPlus);
1771 void setLineStyle(LineStyle ls);
1773 void setErrorType(ErrorType errorType);
1774 void setErrorPen(
const QPen &pen);
1775 void setErrorBarSize(
double size);
1776 void setErrorBarSkipSymbol(
bool enabled);
1777 void setChannelFillGraph(
QCPGraph *targetGraph);
1780 void addData(
const QCPDataMap &dataMap);
1781 void addData(
const QCPData &data);
1782 void addData(
double key,
double value);
1783 void addData(
const QVector<double> &keys,
const QVector<double> &values);
1784 void removeDataBefore(
double key);
1785 void removeDataAfter(
double key);
1786 void removeData(
double fromKey,
double toKey);
1787 void removeData(
double key);
1791 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
1795 void rescaleAxes(
bool onlyEnlarge,
bool includeErrorBars)
const;
1796 void rescaleKeyAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
1803 LineStyle mLineStyle;
1805 ErrorType mErrorType;
1806 double mErrorBarSize;
1807 bool mErrorBarSkipSymbol;
1808 QPointer<QCPGraph> mChannelFillGraph;
1812 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
1813 virtual QCPRange getKeyRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const;
1814 virtual QCPRange getValueRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const;
1815 virtual QCPRange getKeyRange(
bool &validRange, SignDomain inSignDomain,
bool includeErrors)
const;
1816 virtual QCPRange getValueRange(
bool &validRange, SignDomain inSignDomain,
bool includeErrors)
const;
1819 virtual void drawFill(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
1820 virtual void drawScatterPlot(
QCPPainter *painter, QVector<QCPData> *pointData)
const;
1821 virtual void drawLinePlot(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
1822 virtual void drawImpulsePlot(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
1825 void getPlotData(QVector<QPointF> *lineData, QVector<QCPData> *pointData)
const;
1826 void getScatterPlotData(QVector<QCPData> *pointData)
const;
1827 void getLinePlotData(QVector<QPointF> *lineData, QVector<QCPData> *pointData)
const;
1828 void getStepLeftPlotData(QVector<QPointF> *lineData, QVector<QCPData> *pointData)
const;
1829 void getStepRightPlotData(QVector<QPointF> *lineData, QVector<QCPData> *pointData)
const;
1830 void getStepCenterPlotData(QVector<QPointF> *lineData, QVector<QCPData> *pointData)
const;
1831 void getImpulsePlotData(QVector<QPointF> *lineData, QVector<QCPData> *pointData)
const;
1832 void drawError(
QCPPainter *painter,
double x,
double y,
const QCPData &data)
const;
1833 void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper,
int &count)
const;
1834 void addFillBasePoints(QVector<QPointF> *lineData)
const;
1835 void removeFillBasePoints(QVector<QPointF> *lineData)
const;
1836 QPointF lowerFillBasePoint(
double lowerKey)
const;
1837 QPointF upperFillBasePoint(
double upperKey)
const;
1838 const QPolygonF getChannelFillPolygon(
const QVector<QPointF> *lineData)
const;
1839 int findIndexBelowX(
const QVector<QPointF> *data,
double x)
const;
1840 int findIndexAboveX(
const QVector<QPointF> *data,
double x)
const;
1841 int findIndexBelowY(
const QVector<QPointF> *data,
double y)
const;
1842 int findIndexAboveY(
const QVector<QPointF> *data,
double y)
const;
1843 double pointDistance(
const QPointF &pixelPoint)
const;
1845 friend class QCustomPlot;
1859 double t, key, value;
1872 typedef QMapIterator<double, QCPCurveData> QCPCurveDataMapIterator;
1873 typedef QMutableMapIterator<double, QCPCurveData> QCPCurveDataMutableMapIterator;
1880 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
1881 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
1892 explicit QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis);
1896 QCPCurveDataMap *data()
const {
return mData; }
1898 LineStyle lineStyle()
const {
return mLineStyle; }
1901 void setData(QCPCurveDataMap *data,
bool copy=
false);
1902 void setData(
const QVector<double> &t,
const QVector<double> &key,
const QVector<double> &value);
1903 void setData(
const QVector<double> &key,
const QVector<double> &value);
1905 void setLineStyle(LineStyle style);
1908 void addData(
const QCPCurveDataMap &dataMap);
1910 void addData(
double t,
double key,
double value);
1911 void addData(
double key,
double value);
1912 void addData(
const QVector<double> &ts,
const QVector<double> &keys,
const QVector<double> &values);
1913 void removeDataBefore(
double t);
1914 void removeDataAfter(
double t);
1915 void removeData(
double fromt,
double tot);
1916 void removeData(
double t);
1920 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
1924 QCPCurveDataMap *mData;
1926 LineStyle mLineStyle;
1930 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
1931 virtual QCPRange getKeyRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const;
1932 virtual QCPRange getValueRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const;
1935 virtual void drawScatterPlot(
QCPPainter *painter,
const QVector<QPointF> *pointData)
const;
1938 void getCurveData(QVector<QPointF> *lineData)
const;
1939 double pointDistance(
const QPointF &pixelPoint)
const;
1940 QPointF outsideCoordsToPixels(
double key,
double value,
int region, QRect axisRect)
const;
1942 friend class QCustomPlot;
1958 Q_DECLARE_TYPEINFO(
QCPBarData, Q_MOVABLE_TYPE);
1968 typedef QMapIterator<double, QCPBarData> QCPBarDataMapIterator;
1969 typedef QMutableMapIterator<double, QCPBarData> QCPBarDataMutableMapIterator;
1976 Q_PROPERTY(
double width READ width WRITE setWidth)
1977 Q_PROPERTY(
QCPBars* barBelow READ barBelow)
1978 Q_PROPERTY(
QCPBars* barAbove READ barAbove)
1981 explicit QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis);
1985 double width()
const {
return mWidth; }
1988 QCPBarDataMap *data()
const {
return mData; }
1991 void setWidth(
double width);
1992 void setData(QCPBarDataMap *data,
bool copy=
false);
1993 void setData(
const QVector<double> &key,
const QVector<double> &value);
1996 void moveBelow(
QCPBars *bars);
1997 void moveAbove(
QCPBars *bars);
1998 void addData(
const QCPBarDataMap &dataMap);
2000 void addData(
double key,
double value);
2001 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2002 void removeDataBefore(
double key);
2003 void removeDataAfter(
double key);
2004 void removeData(
double fromKey,
double toKey);
2005 void removeData(
double key);
2009 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2013 QCPBarDataMap *mData;
2015 QPointer<QCPBars> mBarBelow, mBarAbove;
2019 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2020 virtual QCPRange getKeyRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const;
2021 virtual QCPRange getValueRange(
bool &validRange, SignDomain inSignDomain=sdBoth)
const;
2024 QPolygonF getBarPolygon(
double key,
double value)
const;
2025 double getBaseValue(
double key,
bool positive)
const;
2028 friend class QCustomPlot;
2041 Q_PROPERTY(
double key READ key WRITE setKey)
2042 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum)
2043 Q_PROPERTY(
double lowerQuartile READ lowerQuartile WRITE setLowerQuartile)
2044 Q_PROPERTY(
double median READ median WRITE setMedian)
2045 Q_PROPERTY(
double upperQuartile READ upperQuartile WRITE setUpperQuartile)
2046 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum)
2047 Q_PROPERTY(QVector<double> outliers READ outliers WRITE setOutliers)
2048 Q_PROPERTY(
double width READ width WRITE setWidth)
2049 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
2050 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
2051 Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
2052 Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
2053 Q_PROPERTY(
QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
2059 double key()
const {
return mKey; }
2060 double minimum()
const {
return mMinimum; }
2061 double lowerQuartile()
const {
return mLowerQuartile; }
2062 double median()
const {
return mMedian; }
2063 double upperQuartile()
const {
return mUpperQuartile; }
2064 double maximum()
const {
return mMaximum; }
2065 QVector<double> outliers()
const {
return mOutliers; }
2066 double width()
const {
return mWidth; }
2067 double whiskerWidth()
const {
return mWhiskerWidth; }
2068 QPen whiskerPen()
const {
return mWhiskerPen; }
2069 QPen whiskerBarPen()
const {
return mWhiskerBarPen; }
2070 QPen medianPen()
const {
return mMedianPen; }
2074 void setKey(
double key);
2075 void setMinimum(
double value);
2076 void setLowerQuartile(
double value);
2077 void setMedian(
double value);
2078 void setUpperQuartile(
double value);
2079 void setMaximum(
double value);
2080 void setOutliers(
const QVector<double> &values);
2081 void setData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum);
2082 void setWidth(
double width);
2083 void setWhiskerWidth(
double width);
2084 void setWhiskerPen(
const QPen &pen);
2085 void setWhiskerBarPen(
const QPen &pen);
2086 void setMedianPen(
const QPen &pen);
2091 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2095 QVector<double> mOutliers;
2096 double mKey, mMinimum, mLowerQuartile, mMedian, mUpperQuartile, mMaximum;
2098 double mWhiskerWidth;
2099 QPen mWhiskerPen, mWhiskerBarPen, mMedianPen;
2104 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2105 virtual QCPRange getKeyRange(
bool &validRange,
SignDomain inSignDomain=sdBoth)
const;
2106 virtual QCPRange getValueRange(
bool &validRange,
SignDomain inSignDomain=sdBoth)
const;
2109 virtual void drawQuartileBox(
QCPPainter *painter, QRectF *quartileBox=0)
const;
2110 virtual void drawMedian(
QCPPainter *painter)
const;
2111 virtual void drawWhiskers(
QCPPainter *painter)
const;
2112 virtual void drawOutliers(
QCPPainter *painter)
const;
2114 friend class QCustomPlot;
2123 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2124 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2131 QPen pen()
const {
return mPen; }
2132 QPen selectedPen()
const {
return mSelectedPen; }
2135 void setPen(
const QPen &pen);
2136 void setSelectedPen(
const QPen &pen);
2139 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2141 QCPItemPosition *
const point1;
2142 QCPItemPosition *
const point2;
2146 QPen mPen, mSelectedPen;
2152 double distToStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QVector2D &point)
const;
2153 QLineF getRectClippedStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QRect &rect)
const;
2154 QPen mainPen()
const;
2162 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2163 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2172 QPen pen()
const {
return mPen; }
2173 QPen selectedPen()
const {
return mSelectedPen; }
2178 void setPen(
const QPen &pen);
2179 void setSelectedPen(
const QPen &pen);
2184 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2186 QCPItemPosition *
const start;
2187 QCPItemPosition *
const end;
2191 QPen mPen, mSelectedPen;
2198 QLineF getRectClippedLine(
const QVector2D &start,
const QVector2D &end,
const QRect &rect)
const;
2199 QPen mainPen()
const;
2207 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2208 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2217 QPen pen()
const {
return mPen; }
2218 QPen selectedPen()
const {
return mSelectedPen; }
2223 void setPen(
const QPen &pen);
2224 void setSelectedPen(
const QPen &pen);
2229 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2231 QCPItemPosition *
const start;
2232 QCPItemPosition *
const startDir;
2233 QCPItemPosition *
const endDir;
2234 QCPItemPosition *
const end;
2238 QPen mPen, mSelectedPen;
2245 QPen mainPen()
const;
2253 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2254 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2255 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2256 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2263 QPen pen()
const {
return mPen; }
2264 QPen selectedPen()
const {
return mSelectedPen; }
2265 QBrush brush()
const {
return mBrush; }
2266 QBrush selectedBrush()
const {
return mSelectedBrush; }
2269 void setPen(
const QPen &pen);
2270 void setSelectedPen(
const QPen &pen);
2271 void setBrush(
const QBrush &brush);
2272 void setSelectedBrush(
const QBrush &brush);
2275 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2277 QCPItemPosition *
const topLeft;
2278 QCPItemPosition *
const bottomRight;
2279 QCPItemAnchor *
const top;
2280 QCPItemAnchor *
const topRight;
2281 QCPItemAnchor *
const right;
2282 QCPItemAnchor *
const bottom;
2283 QCPItemAnchor *
const bottomLeft;
2284 QCPItemAnchor *
const left;
2287 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
2290 QPen mPen, mSelectedPen;
2291 QBrush mBrush, mSelectedBrush;
2295 virtual QPointF anchorPixelPoint(
int anchorId)
const;
2298 QPen mainPen()
const;
2299 QBrush mainBrush()
const;
2307 Q_PROPERTY(QColor color READ color WRITE setColor)
2308 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
2309 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2310 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2311 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2312 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2313 Q_PROPERTY(QFont font READ font WRITE setFont)
2314 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2315 Q_PROPERTY(QString text READ text WRITE setText)
2316 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
2317 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
2318 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
2319 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
2326 QColor color()
const {
return mColor; }
2327 QColor selectedColor()
const {
return mSelectedColor; }
2328 QPen pen()
const {
return mPen; }
2329 QPen selectedPen()
const {
return mSelectedPen; }
2330 QBrush brush()
const {
return mBrush; }
2331 QBrush selectedBrush()
const {
return mSelectedBrush; }
2332 QFont font()
const {
return mFont; }
2333 QFont selectedFont()
const {
return mSelectedFont; }
2334 QString text()
const {
return mText; }
2335 Qt::Alignment positionAlignment()
const {
return mPositionAlignment; }
2336 Qt::Alignment textAlignment()
const {
return mTextAlignment; }
2337 double rotation()
const {
return mRotation; }
2338 QMargins padding()
const {
return mPadding; }
2341 void setColor(
const QColor &color);
2342 void setSelectedColor(
const QColor &color);
2343 void setPen(
const QPen &pen);
2344 void setSelectedPen(
const QPen &pen);
2345 void setBrush(
const QBrush &brush);
2346 void setSelectedBrush(
const QBrush &brush);
2347 void setFont(
const QFont &font);
2348 void setSelectedFont(
const QFont &font);
2349 void setText(
const QString &text);
2350 void setPositionAlignment(Qt::Alignment alignment);
2351 void setTextAlignment(Qt::Alignment alignment);
2352 void setRotation(
double degrees);
2353 void setPadding(
const QMargins &padding);
2356 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2359 QCPItemAnchor *
const topLeft;
2360 QCPItemAnchor *
const top;
2361 QCPItemAnchor *
const topRight;
2362 QCPItemAnchor *
const right;
2363 QCPItemAnchor *
const bottomRight;
2364 QCPItemAnchor *
const bottom;
2365 QCPItemAnchor *
const bottomLeft;
2366 QCPItemAnchor *
const left;
2369 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
2372 QColor mColor, mSelectedColor;
2373 QPen mPen, mSelectedPen;
2374 QBrush mBrush, mSelectedBrush;
2375 QFont mFont, mSelectedFont;
2377 Qt::Alignment mPositionAlignment;
2378 Qt::Alignment mTextAlignment;
2384 virtual QPointF anchorPixelPoint(
int anchorId)
const;
2387 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
2388 QFont mainFont()
const;
2389 QColor mainColor()
const;
2390 QPen mainPen()
const;
2391 QBrush mainBrush()
const;
2399 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2400 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2401 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2402 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2409 QPen pen()
const {
return mPen; }
2410 QPen selectedPen()
const {
return mSelectedPen; }
2411 QBrush brush()
const {
return mBrush; }
2412 QBrush selectedBrush()
const {
return mSelectedBrush; }
2415 void setPen(
const QPen &pen);
2416 void setSelectedPen(
const QPen &pen);
2417 void setBrush(
const QBrush &brush);
2418 void setSelectedBrush(
const QBrush &brush);
2421 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2423 QCPItemPosition *
const topLeft;
2424 QCPItemPosition *
const bottomRight;
2425 QCPItemAnchor *
const topLeftRim;
2426 QCPItemAnchor *
const top;
2427 QCPItemAnchor *
const topRightRim;
2428 QCPItemAnchor *
const right;
2429 QCPItemAnchor *
const bottomRightRim;
2430 QCPItemAnchor *
const bottom;
2431 QCPItemAnchor *
const bottomLeftRim;
2432 QCPItemAnchor *
const left;
2433 QCPItemAnchor *
const center;
2436 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
2439 QPen mPen, mSelectedPen;
2440 QBrush mBrush, mSelectedBrush;
2444 virtual QPointF anchorPixelPoint(
int anchorId)
const;
2447 QPen mainPen()
const;
2448 QBrush mainBrush()
const;
2456 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
2457 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
2458 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
2459 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2460 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2467 QPixmap pixmap()
const {
return mPixmap; }
2468 bool scaled()
const {
return mScaled; }
2469 Qt::AspectRatioMode aspectRatioMode()
const {
return mAspectRatioMode; }
2470 QPen pen()
const {
return mPen; }
2471 QPen selectedPen()
const {
return mSelectedPen; }
2474 void setPixmap(
const QPixmap &pixmap);
2475 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio);
2476 void setPen(
const QPen &pen);
2477 void setSelectedPen(
const QPen &pen);
2480 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2482 QCPItemPosition *
const topLeft;
2483 QCPItemPosition *
const bottomRight;
2484 QCPItemAnchor *
const top;
2485 QCPItemAnchor *
const topRight;
2486 QCPItemAnchor *
const right;
2487 QCPItemAnchor *
const bottom;
2488 QCPItemAnchor *
const bottomLeft;
2489 QCPItemAnchor *
const left;
2492 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
2496 QPixmap mScaledPixmap;
2498 Qt::AspectRatioMode mAspectRatioMode;
2499 QPen mPen, mSelectedPen;
2503 virtual QPointF anchorPixelPoint(
int anchorId)
const;
2506 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
2507 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
2508 QPen mainPen()
const;
2516 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2517 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2518 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2519 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2520 Q_PROPERTY(
double size READ size WRITE setSize)
2521 Q_PROPERTY(
TracerStyle style READ style WRITE setStyle)
2522 Q_PROPERTY(
QCPGraph* graph READ graph WRITE setGraph)
2523 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
2524 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
2538 Q_ENUMS(TracerStyle)
2544 QPen pen()
const {
return mPen; }
2545 QPen selectedPen()
const {
return mSelectedPen; }
2546 QBrush brush()
const {
return mBrush; }
2547 QBrush selectedBrush()
const {
return mSelectedBrush; }
2548 double size()
const {
return mSize; }
2549 TracerStyle style()
const {
return mStyle; }
2550 QCPGraph *graph()
const {
return mGraph; }
2551 double graphKey()
const {
return mGraphKey; }
2552 bool interpolating()
const {
return mInterpolating; }
2555 void setPen(
const QPen &pen);
2556 void setSelectedPen(
const QPen &pen);
2557 void setBrush(
const QBrush &brush);
2558 void setSelectedBrush(
const QBrush &brush);
2559 void setSize(
double size);
2560 void setStyle(TracerStyle style);
2562 void setGraphKey(
double key);
2563 void setInterpolating(
bool enabled);
2566 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2569 void updatePosition();
2575 QPen mPen, mSelectedPen;
2576 QBrush mBrush, mSelectedBrush;
2581 bool mInterpolating;
2587 QPen mainPen()
const;
2588 QBrush mainBrush()
const;
2596 Q_PROPERTY(QPen pen READ pen WRITE setPen)
2597 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
2598 Q_PROPERTY(
double length READ length WRITE setLength)
2599 Q_PROPERTY(
BracketStyle style READ style WRITE setStyle)
2612 QPen pen()
const {
return mPen; }
2613 QPen selectedPen()
const {
return mSelectedPen; }
2614 double length()
const {
return mLength; }
2615 BracketStyle style()
const {
return mStyle; }
2618 void setPen(
const QPen &pen);
2619 void setSelectedPen(
const QPen &pen);
2620 void setLength(
double length);
2621 void setStyle(BracketStyle style);
2624 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2626 QCPItemPosition *
const left;
2627 QCPItemPosition *
const right;
2628 QCPItemAnchor *
const center;
2632 enum AnchorIndex {aiCenter};
2633 QPen mPen, mSelectedPen;
2635 BracketStyle mStyle;
2639 virtual QPointF anchorPixelPoint(
int anchorId)
const;
2642 QPen mainPen()
const;
2646 class QCP_LIB_DECL QCPAxisRect :
public QCPLayoutElement
2650 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
2651 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
2652 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
2653 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
2654 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
2657 explicit QCPAxisRect(QCustomPlot *parentPlot,
bool setupDefaultAxes=
true);
2658 virtual ~QCPAxisRect();
2661 QPixmap background()
const {
return mBackgroundPixmap; }
2662 bool backgroundScaled()
const {
return mBackgroundScaled; }
2663 Qt::AspectRatioMode backgroundScaledMode()
const {
return mBackgroundScaledMode; }
2664 Qt::Orientations rangeDrag()
const {
return mRangeDrag; }
2665 Qt::Orientations rangeZoom()
const {
return mRangeZoom; }
2666 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
2667 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
2668 double rangeZoomFactor(Qt::Orientation orientation);
2671 void setBackground(
const QPixmap &pm);
2672 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
2673 void setBackground(
const QBrush &brush);
2674 void setBackgroundScaled(
bool scaled);
2675 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
2676 void setRangeDrag(Qt::Orientations orientations);
2677 void setRangeZoom(Qt::Orientations orientations);
2678 void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical);
2679 void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical);
2680 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
2681 void setRangeZoomFactor(
double factor);
2686 QList<QCPAxis*> axes(QCPAxis::AxisTypes types)
const;
2687 QList<QCPAxis*> axes()
const;
2689 QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
2690 bool removeAxis(QCPAxis *axis);
2693 void setupFullAxesBox(
bool connectRanges=
false);
2694 QList<QCPAbstractPlottable*> plottables()
const;
2695 QList<QCPGraph*> graphs()
const;
2696 QList<QCPAbstractItem*> items()
const;
2699 int left()
const {
return mRect.left(); }
2700 int right()
const {
return mRect.right(); }
2701 int top()
const {
return mRect.top(); }
2702 int bottom()
const {
return mRect.bottom(); }
2703 int width()
const {
return mRect.width(); }
2704 int height()
const {
return mRect.height(); }
2705 QSize
size()
const {
return mRect.size(); }
2706 QPoint
topLeft()
const {
return mRect.topLeft(); }
2710 QPoint
center()
const {
return mRect.center(); }
2714 virtual QList<QCPLayoutElement*>
elements(
bool recursive)
const;
2718 QBrush mBackgroundBrush;
2719 QPixmap mBackgroundPixmap;
2720 QPixmap mScaledBackgroundPixmap;
2721 bool mBackgroundScaled;
2722 Qt::AspectRatioMode mBackgroundScaledMode;
2724 Qt::Orientations mRangeDrag, mRangeZoom;
2725 QPointer<QCPAxis> mRangeDragHorzAxis, mRangeDragVertAxis, mRangeZoomHorzAxis, mRangeZoomVertAxis;
2726 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
2728 QCPRange mDragStartHorzRange, mDragStartVertRange;
2729 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2732 QHash<QCPAxis::AxisType, QList<QCPAxis*> > mAxes;
2735 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2749 Q_DISABLE_COPY(QCPAxisRect)
2751 friend class QCustomPlot;
2759 Q_PROPERTY(
QCPLegend* parentLegend READ parentLegend)
2760 Q_PROPERTY(QFont font READ font WRITE setFont)
2761 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2762 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2763 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2764 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable)
2765 Q_PROPERTY(
bool selected READ selected WRITE setSelected)
2771 QCPLegend *parentLegend()
const {
return mParentLegend; }
2772 QFont font()
const {
return mFont; }
2773 QColor textColor()
const {
return mTextColor; }
2774 QFont selectedFont()
const {
return mSelectedFont; }
2775 QColor selectedTextColor()
const {
return mSelectedTextColor; }
2776 bool selectable()
const {
return mSelectable; }
2777 bool selected()
const {
return mSelected; }
2780 void setFont(
const QFont &font);
2781 void setTextColor(
const QColor &color);
2782 void setSelectedFont(
const QFont &font);
2783 void setSelectedTextColor(
const QColor &color);
2784 void setSelectable(
bool selectable);
2785 void setSelected(
bool selected);
2788 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2791 void selectionChanged(
bool selected);
2798 QFont mSelectedFont;
2799 QColor mSelectedTextColor;
2800 bool mSelectable, mSelected;
2804 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2805 virtual QRect clipRect()
const;
2808 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2809 virtual void deselectEvent(
bool *selectionStateChanged);
2836 QPen getIconBorderPen()
const;
2837 QColor getTextColor()
const;
2838 QFont getFont()
const;
2846 Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
2847 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2848 Q_PROPERTY(QFont font READ font WRITE setFont)
2849 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2850 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
2851 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
2852 Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
2853 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts)
2854 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts)
2855 Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
2856 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
2857 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2858 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2859 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2868 ,spLegendBox = 0x001
2871 Q_FLAGS(SelectablePart SelectableParts)
2872 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2875 virtual ~QCPLegend();
2878 QPen borderPen()
const {
return mBorderPen; }
2879 QBrush brush()
const {
return mBrush; }
2880 QFont font()
const {
return mFont; }
2881 QColor textColor()
const {
return mTextColor; }
2882 QSize iconSize()
const {
return mIconSize; }
2883 int iconTextPadding()
const {
return mIconTextPadding; }
2884 QPen iconBorderPen()
const {
return mIconBorderPen; }
2885 SelectableParts selectableParts()
const {
return mSelectableParts; }
2886 SelectableParts selectedParts()
const;
2887 QPen selectedBorderPen()
const {
return mSelectedBorderPen; }
2888 QPen selectedIconBorderPen()
const {
return mSelectedIconBorderPen; }
2889 QBrush selectedBrush()
const {
return mSelectedBrush; }
2890 QFont selectedFont()
const {
return mSelectedFont; }
2891 QColor selectedTextColor()
const {
return mSelectedTextColor; }
2894 void setBorderPen(
const QPen &pen);
2895 void setBrush(
const QBrush &brush);
2896 void setFont(
const QFont &font);
2897 void setTextColor(
const QColor &color);
2898 void setIconSize(
const QSize &size);
2899 void setIconSize(
int width,
int height);
2900 void setIconTextPadding(
int padding);
2901 void setIconBorderPen(
const QPen &pen);
2902 void setSelectableParts(
const SelectableParts &selectableParts);
2903 void setSelectedParts(
const SelectableParts &selectedParts);
2904 void setSelectedBorderPen(
const QPen &pen);
2905 void setSelectedIconBorderPen(
const QPen &pen);
2906 void setSelectedBrush(
const QBrush &brush);
2907 void setSelectedFont(
const QFont &font);
2908 void setSelectedTextColor(
const QColor &color);
2911 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2916 int itemCount()
const;
2920 bool removeItem(
int index);
2923 QList<QCPAbstractLegendItem*> selectedItems()
const;
2926 void selectionChanged(QCPLegend::SelectableParts selection);
2930 QPen mBorderPen, mIconBorderPen;
2935 int mIconTextPadding;
2936 SelectableParts mSelectedParts, mSelectableParts;
2937 QPen mSelectedBorderPen, mSelectedIconBorderPen;
2938 QBrush mSelectedBrush;
2939 QFont mSelectedFont;
2940 QColor mSelectedTextColor;
2943 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
2945 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2948 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2949 virtual void deselectEvent(
bool *selectionStateChanged);
2952 QPen getBorderPen()
const;
2953 QBrush getBrush()
const;
2958 friend class QCustomPlot;
2961 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPLegend::SelectableParts)
2962 Q_DECLARE_METATYPE(
QCPLegend::SelectablePart)
2969 Q_PROPERTY(QString text READ text WRITE setText)
2970 Q_PROPERTY(QFont font READ font WRITE setFont)
2971 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2972 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2973 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2974 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable)
2975 Q_PROPERTY(
bool selected READ selected WRITE setSelected)
2979 explicit QCPPlotTitle(QCustomPlot *parentPlot,
const QString &text);
2982 QString text()
const {
return mText; }
2983 QFont font()
const {
return mFont; }
2984 QColor textColor()
const {
return mTextColor; }
2985 QFont selectedFont()
const {
return mSelectedFont; }
2986 QColor selectedTextColor()
const {
return mSelectedTextColor; }
2987 bool selectable()
const {
return mSelectable; }
2988 bool selected()
const {
return mSelected; }
2991 void setText(
const QString &text);
2992 void setFont(
const QFont &font);
2993 void setTextColor(
const QColor &color);
2994 void setSelectedFont(
const QFont &font);
2995 void setSelectedTextColor(
const QColor &color);
2996 void setSelectable(
bool selectable);
2997 void setSelected(
bool selected);
3000 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3003 void selectionChanged(
bool selected);
3010 QFont mSelectedFont;
3011 QColor mSelectedTextColor;
3012 QRect mTextBoundingRect;
3013 bool mSelectable, mSelected;
3016 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
3021 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
3022 virtual void deselectEvent(
bool *selectionStateChanged);
3025 QFont mainFont()
const;
3026 QColor mainTextColor()
const;
3032 #endif // QCUSTOMPLOT_H
AxisType
Definition: qcustomplot.h:917
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:1508
A bracket for referencing/highlighting certain parts in the plot.
Definition: qcustomplot.h:2592
QCPItemPosition * position(const QString &name) const
Definition: qcustomplot.cpp:7964
A margin group allows synchronization of margin sides if working with multiple layout elements...
Definition: qcustomplot.h:487
An arbitrary pixmap.
Definition: qcustomplot.h:2452
0xFFFF All elements
Definition: qcustomplot.h:124
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:495
LayerInsertMode
Definition: qcustomplot.h:1495
static const double maxRange
Definition: qcustomplot.h:482
0x08 bottom margin
Definition: qcustomplot.h:98
QMap< double, QCPData > QCPDataMap
Definition: qcustomplot.h:1707
Holds the data of one single data point for QCPCurve.
Definition: qcustomplot.h:1854
No line is drawn between data points (e.g. only scatters)
Definition: qcustomplot.h:1889
void rescaleKeyAxis(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:6798
A legend item representing a plottable with an icon and the plottable name.
Definition: qcustomplot.h:2818
ScaleType
Definition: qcustomplot.h:938
virtual QList< QCPLayoutElement * > elements(bool recursive) const
Definition: qcustomplot.cpp:2075
PainterMode
Definition: qcustomplot.h:315
Definition: qcustomplot.h:137
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: qcustomplot.h:577
int bottom() const
Definition: qcustomplot.h:2702
The abstract base class for all entries in a QCPLegend.
Definition: qcustomplot.h:2755
virtual int elementCount() const =0
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:113
0x0008 Legend box
Definition: qcustomplot.h:116
Responsible for drawing the grid of a QCPAxis.
Definition: qcustomplot.h:807
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
Definition: qcustomplot.h:150
EndingStyle
Definition: qcustomplot.h:765
0x00 no margin
Definition: qcustomplot.h:100
0x04 top margin
Definition: qcustomplot.h:97
An anchor of an item to which positions can be attached to.
Definition: qcustomplot.h:1313
0x0004 Sub grid lines
Definition: qcustomplot.h:115
virtual QList< QCPLayoutElement * > elements(bool recursive) const
Definition: qcustomplot.cpp:2246
0x0002 Grid lines
Definition: qcustomplot.h:114
0x01 left margin
Definition: qcustomplot.h:95
Base class for all drawable objects.
Definition: qcustomplot.h:397
TracerStyle
Definition: qcustomplot.h:2532
A plottable representing a bar chart in a plot.
Definition: qcustomplot.h:1972
0x080 All other objects are selectable (e.g. your own derived layerables, the plot title...
Definition: qcustomplot.h:157
A curved line from one point to another.
Definition: qcustomplot.h:2203
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap) ...
Definition: qcustomplot.h:120
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:377
A layout that arranges child elements in a grid.
Definition: qcustomplot.h:634
Definition: qcustomplot.h:1090
virtual QCPLayoutElement * takeAt(int index)=0
ErrorType
Definition: qcustomplot.h:1742
QPoint bottomLeft() const
Definition: qcustomplot.h:2708
virtual QSize minimumSizeHint() const
Definition: qcustomplot.cpp:3039
0x0040 Main lines of items
Definition: qcustomplot.h:119
The abstract base class for all data representing objects in a plot.
Definition: qcustomplot.h:1199
ScatterShape
Definition: qcustomplot.h:241
A plottable representing a single statistical box in a plot.
Definition: qcustomplot.h:2037
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable) ...
Definition: qcustomplot.h:153
virtual QSize minimumSizeHint() const
Definition: qcustomplot.cpp:2051
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
Definition: qcustomplot.h:135
virtual void update()
Definition: qcustomplot.cpp:2019
A plottable representing a graph in a plot.
Definition: qcustomplot.h:1712
The abstract base class for all items in a plot.
Definition: qcustomplot.h:1403
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition: qcustomplot.h:139
Item that sticks to QCPGraph data points.
Definition: qcustomplot.h:2512
virtual QSize maximumSizeHint() const
Definition: qcustomplot.cpp:2063
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:1475
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem) ...
Definition: qcustomplot.h:156
virtual void wheelEvent(QWheelEvent *event)
Definition: qcustomplot.h:580
Manages a single axis inside a QCustomPlot.
Definition: qcustomplot.h:857
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:1433
bool isPenDefined() const
Definition: qcustomplot.h:287
Represents the visual appearance of scatter points.
Definition: qcustomplot.h:229
int index() const
Definition: qcustomplot.h:376
Manages a legend inside a QCustomPlot.
Definition: qcustomplot.h:2842
QList< QCPItemPosition * > positions() const
Definition: qcustomplot.h:1432
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:414
virtual bool take(QCPLayoutElement *element)=0
0x0200 Borders of fills (e.g. under or between graphs)
Definition: qcustomplot.h:122
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition: qcustomplot.h:152
virtual void clearData()=0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.cpp:2092
int height() const
Definition: qcustomplot.h:2704
A layer that may contain objects, to control the rendering order.
Definition: qcustomplot.h:360
Qt::Orientation orientation() const
Definition: qcustomplot.h:1069
A rectangle.
Definition: qcustomplot.h:2249
The abstract base class for all objects that form the layout system.
Definition: qcustomplot.h:516
PlottingHint
Definition: qcustomplot.h:134
A straight line that spans infinitely in both directions.
Definition: qcustomplot.h:2119
QMap< double, QCPBarData > QCPBarDataMap
Definition: qcustomplot.h:1967
SelectablePart
Definition: qcustomplot.h:2867
A layout that places child elements aligned to the border or arbitrarily positioned.
Definition: qcustomplot.h:700
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts) ...
Definition: qcustomplot.h:155
Handles the different ending decorations for line-like items.
Definition: qcustomplot.h:749
QPoint center() const
Definition: qcustomplot.h:2710
Holds the data of one single data point for QCPGraph.
Definition: qcustomplot.h:1689
Definition: qcustomplot.h:1095
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:1334
QPainter subclass used internally.
Definition: qcustomplot.h:307
LineStyle
Definition: qcustomplot.h:1730
LineStyle
Definition: qcustomplot.h:1889
int left() const
Definition: qcustomplot.h:2699
0x0100 Error bars
Definition: qcustomplot.h:121
SignDomain
Definition: qcustomplot.h:1265
static const double minRange
Definition: qcustomplot.h:481
bool isNone() const
Definition: qcustomplot.h:286
BracketStyle
Definition: qcustomplot.h:2602
void rescaleAxes(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:6787
0x0020 Main lines of plottables (excluding error bars, see element aeErrorBars)
Definition: qcustomplot.h:118
Interaction
Definition: qcustomplot.h:150
QCPBars * barBelow() const
Definition: qcustomplot.h:1986
int top() const
Definition: qcustomplot.h:2701
0x000 No hints are set
Definition: qcustomplot.h:134
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:1395
A plottable representing a parametric curve in a plot.
Definition: qcustomplot.h:1876
virtual QCPLayoutElement * elementAt(int index) const =0
QCPLayout * layout() const
Definition: qcustomplot.h:533
0x0000 No elements
Definition: qcustomplot.h:125
void rescaleValueAxis(bool onlyEnlarge=false) const
Definition: qcustomplot.cpp:6825
A layout element displaying a plot title text.
Definition: qcustomplot.h:2965
0x02 right margin
Definition: qcustomplot.h:96
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:2691
An ellipse.
Definition: qcustomplot.h:2395
QPoint topLeft() const
Definition: qcustomplot.h:2706
virtual void simplify()
Definition: qcustomplot.cpp:2273
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Definition: qcustomplot.h:579
QRect rect() const
Definition: qcustomplot.h:534
SelectablePart
Definition: qcustomplot.h:946
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
Definition: qcustomplot.h:151
0x0010 Legend items
Definition: qcustomplot.h:117
The abstract base class for layouts.
Definition: qcustomplot.h:596
A text label.
Definition: qcustomplot.h:2303
QCPBars * barAbove() const
Definition: qcustomplot.h:1987
QSize size() const
Definition: qcustomplot.h:2705
virtual void mousePressEvent(QMouseEvent *event)
Definition: qcustomplot.h:576
PositionType
Definition: qcustomplot.h:1357
QPoint bottomRight() const
Definition: qcustomplot.h:2709
QPoint topRight() const
Definition: qcustomplot.h:2707
A line from one point to another.
Definition: qcustomplot.h:2158
Definition: qcustomplot.h:88
virtual QSize maximumSizeHint() const
Definition: qcustomplot.cpp:3054
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:123
Manages the position of an item.
Definition: qcustomplot.h:1348
QCPGrid * grid() const
Definition: qcustomplot.h:1007
Represents the range an axis is encompassing.
Definition: qcustomplot.h:462
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition: qcustomplot.h:154
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const
Definition: qcustomplot.cpp:1039
0xFF all margins
Definition: qcustomplot.h:99
Holds multiple axes and arranges them in a rectangular shape.
Definition: qcustomplot.h:2646
int width() const
Definition: qcustomplot.h:2703
InsetPlacement
Definition: qcustomplot.h:707
virtual void simplify()
Definition: qcustomplot.h:730
QMap< double, QCPCurveData > QCPCurveDataMap
Definition: qcustomplot.h:1871
MarginSide
Definition: qcustomplot.h:95
AntialiasedElement
Definition: qcustomplot.h:113
LabelType
Definition: qcustomplot.h:930
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: qcustomplot.h:578
int right() const
Definition: qcustomplot.h:2700
Holds the data of one single data point (one bar) for QCPBars.
Definition: qcustomplot.h:1951