33 #include <QPaintEvent> 34 #include <QMouseEvent> 48 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 49 # include <qnumeric.h> 51 # include <QPrintEngine> 54 # include <QtPrintSupport/QtPrintSupport> 82 #if defined(QCUSTOMPLOT_COMPILE_LIBRARY) 83 # define QCP_LIB_DECL Q_DECL_EXPORT 84 #elif defined(QCUSTOMPLOT_USE_LIBRARY) 85 # define QCP_LIB_DECL Q_DECL_IMPORT 174 return qIsNaN(value) || qIsInf(value);
199 case QCP::msTop: margins.setTop(value);
break;
201 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
228 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
229 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
230 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
231 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
245 Q_ENUMS(ScatterShape)
272 QCPScatterStyle(
const QPainterPath &customPath,
const QPen &pen,
const QBrush &brush=Qt::NoBrush,
double size=6);
275 double size()
const {
return mSize; }
277 QPen
pen()
const {
return mPen; }
278 QBrush
brush()
const {
return mBrush; }
279 QPixmap
pixmap()
const {
return mPixmap; }
283 void setSize(
double size);
285 void setPen(
const QPen &pen);
286 void setBrush(
const QBrush &brush);
287 void setPixmap(
const QPixmap &pixmap);
288 void setCustomPath(
const QPainterPath &customPath);
291 bool isNone()
const {
return mShape == ssNone; }
293 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
294 void drawShape(
QCPPainter *painter, QPointF pos)
const;
295 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
304 QPainterPath mCustomPath;
323 ,pmNonCosmetic = 0x04
329 QCPPainter(QPaintDevice *device);
333 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
334 PainterModes
modes()
const {
return mModes; }
337 void setAntialiasing(
bool enabled);
339 void setModes(PainterModes modes);
342 bool begin(QPaintDevice *device);
343 void setPen(
const QPen &pen);
344 void setPen(
const QColor &color);
345 void setPen(Qt::PenStyle penStyle);
346 void drawLine(
const QLineF &line);
352 void makeNonCosmetic();
357 bool mIsAntialiasing;
360 QStack<bool> mAntialiasingStack;
362 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
369 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
370 Q_PROPERTY(QString name READ name)
371 Q_PROPERTY(
int index READ index)
372 Q_PROPERTY(QList<QCPLayerable*> children READ children)
373 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
376 QCPLayer(
QCustomPlot* parentPlot,
const QString &layerName);
381 QString
name()
const {
return mName; }
382 int index()
const {
return mIndex; }
383 QList<QCPLayerable*>
children()
const {
return mChildren; }
387 void setVisible(
bool visible);
394 QList<QCPLayerable*> mChildren;
402 Q_DISABLE_COPY(QCPLayer)
412 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
413 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
414 Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable)
415 Q_PROPERTY(QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged)
416 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
419 QCPLayerable(
QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0);
426 QCPLayer *
layer()
const {
return mLayer; }
430 void setVisible(
bool on);
431 Q_SLOT
bool setLayer(QCPLayer *layer);
432 bool setLayer(
const QString &layerName);
433 void setAntialiased(
bool enabled);
436 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
439 bool realVisibility()
const;
442 void layerChanged(QCPLayer *newLayer);
448 QPointer<QCPLayerable> mParentLayerable;
453 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
455 virtual QRect clipRect()
const;
456 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const = 0;
457 virtual void draw(QCPPainter *painter) = 0;
459 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
460 virtual void deselectEvent(
bool *selectionStateChanged);
463 void initializeParentPlot(
QCustomPlot *parentPlot);
464 void setParentLayerable(QCPLayerable* parentLayerable);
465 bool moveToLayer(QCPLayer *layer,
bool prepend);
466 void applyAntialiasingHint(QCPPainter *painter,
bool localAntialiased,
QCP::AntialiasedElement overrideElement)
const;
469 Q_DISABLE_COPY(QCPLayerable)
482 QCPRange(
double lower,
double upper);
485 bool operator!=(
const QCPRange& other)
const {
return !(*
this == other); }
487 QCPRange &
operator+=(
const double& value) { lower+=value; upper+=value;
return *
this; }
488 QCPRange &
operator-=(
const double& value) { lower-=value; upper-=value;
return *
this; }
489 QCPRange &
operator*=(
const double& value) { lower*=value; upper*=value;
return *
this; }
490 QCPRange &
operator/=(
const double& value) { lower/=value; upper/=value;
return *
this; }
491 friend inline const QCPRange
operator+(
const QCPRange&,
double);
492 friend inline const QCPRange
operator+(
double,
const QCPRange&);
493 friend inline const QCPRange
operator-(
const QCPRange& range,
double value);
494 friend inline const QCPRange
operator*(
const QCPRange& range,
double value);
495 friend inline const QCPRange
operator*(
double value,
const QCPRange& range);
496 friend inline const QCPRange
operator/(
const QCPRange& range,
double value);
499 double center()
const;
501 void expand(
const QCPRange &otherRange);
502 QCPRange expanded(
const QCPRange &otherRange)
const;
503 QCPRange sanitizedForLogScale()
const;
504 QCPRange sanitizedForLinScale()
const;
505 bool contains(
double value)
const;
507 static bool validRange(
double lower,
double upper);
508 static bool validRange(
const QCPRange &range);
509 static const double minRange;
510 static const double maxRange;
542 inline const QCPRange
operator+(
const QCPRange& range,
double value)
544 QCPRange result(range);
552 inline const QCPRange
operator+(
double value,
const QCPRange& range)
554 QCPRange result(range);
562 inline const QCPRange
operator-(
const QCPRange& range,
double value)
564 QCPRange result(range);
572 inline const QCPRange
operator*(
const QCPRange& range,
double value)
574 QCPRange result(range);
582 inline const QCPRange
operator*(
double value,
const QCPRange& range)
584 QCPRange result(range);
592 inline const QCPRange
operator/(
const QCPRange& range,
double value)
594 QCPRange result(range);
609 bool isEmpty()
const;
615 QHash<QCP::MarginSide, QList<QCPLayoutElement*> > mChildren;
623 Q_DISABLE_COPY(QCPMarginGroup)
629 class QCP_LIB_DECL QCPLayoutElement :
public QCPLayerable
633 Q_PROPERTY(
QCPLayout* layout READ layout)
634 Q_PROPERTY(QRect rect READ rect)
635 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
636 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
637 Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
638 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
639 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
652 explicit QCPLayoutElement(
QCustomPlot *parentPlot=0);
653 virtual ~QCPLayoutElement();
657 QRect
rect()
const {
return mRect; }
665 QHash<QCP::MarginSide, QCPMarginGroup*>
marginGroups()
const {
return mMarginGroups; }
668 void setOuterRect(
const QRect &rect);
669 void setMargins(
const QMargins &margins);
670 void setMinimumMargins(
const QMargins &margins);
671 void setAutoMargins(QCP::MarginSides sides);
672 void setMinimumSize(
const QSize &size);
673 void setMinimumSize(
int width,
int height);
674 void setMaximumSize(
const QSize &size);
675 void setMaximumSize(
int width,
int height);
676 void setMarginGroup(QCP::MarginSides sides, QCPMarginGroup *group);
680 virtual QSize minimumSizeHint()
const;
681 virtual QSize maximumSizeHint()
const;
682 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
685 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
690 QSize mMinimumSize, mMaximumSize;
691 QRect mRect, mOuterRect;
692 QMargins mMargins, mMinimumMargins;
693 QCP::MarginSides mAutoMargins;
694 QHash<QCP::MarginSide, QCPMarginGroup*> mMarginGroups;
703 virtual void wheelEvent(QWheelEvent *event) {Q_UNUSED(event)}
707 virtual void draw(QCPPainter *painter) { Q_UNUSED(painter) }
708 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
711 Q_DISABLE_COPY(QCPLayoutElement)
715 friend class QCPMarginGroup;
723 explicit QCPLayout();
727 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
730 virtual int elementCount()
const = 0;
731 virtual QCPLayoutElement* elementAt(
int index)
const = 0;
732 virtual QCPLayoutElement* takeAt(
int index) = 0;
733 virtual bool take(QCPLayoutElement* element) = 0;
734 virtual void simplify();
737 bool removeAt(
int index);
738 bool remove(QCPLayoutElement* element);
743 virtual void updateLayout();
746 void sizeConstraintsChanged()
const;
747 void adoptElement(QCPLayoutElement *el);
748 void releaseElement(QCPLayoutElement *el);
749 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
const;
752 Q_DISABLE_COPY(QCPLayout)
753 friend class QCPLayoutElement;
761 Q_PROPERTY(
int rowCount READ rowCount)
762 Q_PROPERTY(
int columnCount READ columnCount)
763 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
764 Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
765 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
766 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
769 explicit QCPLayoutGrid();
770 virtual ~QCPLayoutGrid();
773 int rowCount()
const;
774 int columnCount()
const;
781 void setColumnStretchFactor(
int column,
double factor);
782 void setColumnStretchFactors(
const QList<double> &factors);
783 void setRowStretchFactor(
int row,
double factor);
784 void setRowStretchFactors(
const QList<double> &factors);
785 void setColumnSpacing(
int pixels);
786 void setRowSpacing(
int pixels);
789 virtual void updateLayout();
790 virtual int elementCount()
const;
791 virtual QCPLayoutElement* elementAt(
int index)
const;
792 virtual QCPLayoutElement* takeAt(
int index);
793 virtual bool take(QCPLayoutElement* element);
794 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
795 virtual void simplify();
796 virtual QSize minimumSizeHint()
const;
797 virtual QSize maximumSizeHint()
const;
800 QCPLayoutElement *element(
int row,
int column)
const;
801 bool addElement(
int row,
int column, QCPLayoutElement *element);
802 bool hasElement(
int row,
int column);
803 void expandTo(
int newRowCount,
int newColumnCount);
804 void insertRow(
int newIndex);
805 void insertColumn(
int newIndex);
809 QList<QList<QCPLayoutElement*> > mElements;
810 QList<double> mColumnStretchFactors;
811 QList<double> mRowStretchFactors;
812 int mColumnSpacing, mRowSpacing;
815 void getMinimumRowColSizes(QVector<int> *minColWidths, QVector<int> *minRowHeights)
const;
816 void getMaximumRowColSizes(QVector<int> *maxColWidths, QVector<int> *maxRowHeights)
const;
819 Q_DISABLE_COPY(QCPLayoutGrid)
834 explicit QCPLayoutInset();
835 virtual ~QCPLayoutInset();
839 Qt::Alignment insetAlignment(
int index)
const;
840 QRectF insetRect(
int index)
const;
844 void setInsetAlignment(
int index, Qt::Alignment alignment);
845 void setInsetRect(
int index,
const QRectF &rect);
848 virtual void updateLayout();
849 virtual int elementCount()
const;
850 virtual QCPLayoutElement* elementAt(
int index)
const;
851 virtual QCPLayoutElement* takeAt(
int index);
852 virtual bool take(QCPLayoutElement* element);
854 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
857 void addElement(QCPLayoutElement *element, Qt::Alignment alignment);
858 void addElement(QCPLayoutElement *element,
const QRectF &rect);
862 QList<QCPLayoutElement*> mElements;
863 QList<InsetPlacement> mInsetPlacement;
864 QList<Qt::Alignment> mInsetAlignment;
865 QList<QRectF> mInsetRect;
868 Q_DISABLE_COPY(QCPLayoutInset)
901 QCPLineEnding(
EndingStyle style,
double width=8,
double length=10,
bool inverted=
false);
905 double width()
const {
return mWidth; }
906 double length()
const {
return mLength; }
911 void setWidth(
double width);
912 void setLength(
double length);
913 void setInverted(
bool inverted);
916 double boundingDistance()
const;
917 double realLength()
const;
918 void draw(QCPPainter *painter,
const QVector2D &pos,
const QVector2D &dir)
const;
919 void draw(QCPPainter *painter,
const QVector2D &pos,
double angle)
const;
924 double mWidth, mLength;
934 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
935 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
936 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
937 Q_PROPERTY(QPen pen READ pen WRITE setPen)
938 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
939 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
948 QPen
pen()
const {
return mPen; }
953 void setSubGridVisible(
bool visible);
954 void setAntialiasedSubGrid(
bool enabled);
955 void setAntialiasedZeroLine(
bool enabled);
956 void setPen(
const QPen &pen);
957 void setSubGridPen(
const QPen &pen);
958 void setZeroLinePen(
const QPen &pen);
962 bool mSubGridVisible;
963 bool mAntialiasedSubGrid, mAntialiasedZeroLine;
964 QPen mPen, mSubGridPen, mZeroLinePen;
969 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
970 virtual void draw(QCPPainter *painter);
973 void drawGridLines(QCPPainter *painter)
const;
974 void drawSubGridLines(QCPPainter *painter)
const;
984 Q_PROPERTY(AxisType axisType READ axisType)
986 Q_PROPERTY(ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
987 Q_PROPERTY(
double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
988 Q_PROPERTY(QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
989 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
990 Q_PROPERTY(
bool autoTicks READ autoTicks WRITE setAutoTicks)
991 Q_PROPERTY(
int autoTickCount READ autoTickCount WRITE setAutoTickCount)
992 Q_PROPERTY(
bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
993 Q_PROPERTY(
bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
994 Q_PROPERTY(
bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
995 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
996 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
997 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
998 Q_PROPERTY(LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
999 Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
1000 Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1001 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
1002 Q_PROPERTY(LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
1003 Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
1004 Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec)
1005 Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
1006 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1007 Q_PROPERTY(
double tickStep READ tickStep WRITE setTickStep)
1008 Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
1009 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels)
1010 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1011 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1012 Q_PROPERTY(
int subTickCount READ subTickCount WRITE setSubTickCount)
1013 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1014 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1015 Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
1016 Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
1017 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
1018 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
1019 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
1020 Q_PROPERTY(QString label READ label WRITE setLabel)
1021 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
1022 Q_PROPERTY(
int padding READ padding WRITE setPadding)
1023 Q_PROPERTY(
int offset READ offset WRITE setOffset)
1024 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
1025 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
1026 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
1027 Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1028 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
1029 Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
1030 Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1031 Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1032 Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
1033 Q_PROPERTY(QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1034 Q_PROPERTY(QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1035 Q_PROPERTY(QCPGrid* grid READ grid)
1048 Q_DECLARE_FLAGS(AxisTypes,
AxisType)
1082 ,spTickLabels = 0x002
1083 ,spAxisLabel = 0x004
1096 const QCPRange
range()
const {
return mRange; }
1105 int tickLabelPadding()
const;
1109 double tickLabelRotation()
const;
1113 QString numberFormat()
const;
1118 int tickLengthIn()
const;
1119 int tickLengthOut()
const;
1121 int subTickLengthIn()
const;
1122 int subTickLengthOut()
const;
1128 QString
label()
const {
return mLabel; }
1129 int labelPadding()
const;
1141 QCPLineEnding lowerEnding()
const;
1142 QCPLineEnding upperEnding()
const;
1143 QCPGrid *
grid()
const {
return mGrid; }
1147 void setScaleLogBase(
double base);
1148 Q_SLOT
void setRange(
const QCPRange &range);
1149 void setRange(
double lower,
double upper);
1150 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
1151 void setRangeLower(
double lower);
1152 void setRangeUpper(
double upper);
1153 void setRangeReversed(
bool reversed);
1154 void setAutoTicks(
bool on);
1155 void setAutoTickCount(
int approximateCount);
1156 void setAutoTickLabels(
bool on);
1157 void setAutoTickStep(
bool on);
1158 void setAutoSubTicks(
bool on);
1159 void setTicks(
bool show);
1160 void setTickLabels(
bool show);
1161 void setTickLabelPadding(
int padding);
1163 void setTickLabelFont(
const QFont &font);
1164 void setTickLabelColor(
const QColor &color);
1165 void setTickLabelRotation(
double degrees);
1167 void setDateTimeFormat(
const QString &format);
1168 void setDateTimeSpec(
const Qt::TimeSpec &timeSpec);
1169 void setNumberFormat(
const QString &formatCode);
1170 void setNumberPrecision(
int precision);
1171 void setTickStep(
double step);
1172 void setTickVector(
const QVector<double> &vec);
1173 void setTickVectorLabels(
const QVector<QString> &vec);
1174 void setTickLength(
int inside,
int outside=0);
1175 void setTickLengthIn(
int inside);
1176 void setTickLengthOut(
int outside);
1177 void setSubTickCount(
int count);
1178 void setSubTickLength(
int inside,
int outside=0);
1179 void setSubTickLengthIn(
int inside);
1180 void setSubTickLengthOut(
int outside);
1181 void setBasePen(
const QPen &pen);
1182 void setTickPen(
const QPen &pen);
1183 void setSubTickPen(
const QPen &pen);
1184 void setLabelFont(
const QFont &font);
1185 void setLabelColor(
const QColor &color);
1186 void setLabel(
const QString &str);
1187 void setLabelPadding(
int padding);
1188 void setPadding(
int padding);
1189 void setOffset(
int offset);
1190 void setSelectedTickLabelFont(
const QFont &font);
1191 void setSelectedLabelFont(
const QFont &font);
1192 void setSelectedTickLabelColor(
const QColor &color);
1193 void setSelectedLabelColor(
const QColor &color);
1194 void setSelectedBasePen(
const QPen &pen);
1195 void setSelectedTickPen(
const QPen &pen);
1196 void setSelectedSubTickPen(
const QPen &pen);
1197 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
1198 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
1199 void setLowerEnding(
const QCPLineEnding &ending);
1200 void setUpperEnding(
const QCPLineEnding &ending);
1203 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
1207 void moveRange(
double diff);
1208 void scaleRange(
double factor,
double center);
1209 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
1210 void rescale(
bool onlyVisiblePlottables=
false);
1211 double pixelToCoord(
double value)
const;
1212 double coordToPixel(
double value)
const;
1214 QList<QCPAbstractPlottable*> plottables()
const;
1215 QList<QCPGraph*> graphs()
const;
1216 QList<QCPAbstractItem*> items()
const;
1219 static Qt::Orientation
orientation(
AxisType type) {
return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
1223 void ticksRequest();
1224 void rangeChanged(
const QCPRange &newRange);
1225 void rangeChanged(
const QCPRange &newRange,
const QCPRange &oldRange);
1227 void selectionChanged(
const QCPAxis::SelectableParts &parts);
1228 void selectableChanged(
const QCPAxis::SelectableParts &parts);
1237 Qt::Orientation mOrientation;
1238 SelectableParts mSelectableParts, mSelectedParts;
1239 QPen mBasePen, mSelectedBasePen;
1244 QFont mLabelFont, mSelectedLabelFont;
1245 QColor mLabelColor, mSelectedLabelColor;
1248 bool mTickLabels, mAutoTickLabels;
1251 QFont mTickLabelFont, mSelectedTickLabelFont;
1252 QColor mTickLabelColor, mSelectedTickLabelColor;
1253 QString mDateTimeFormat;
1254 Qt::TimeSpec mDateTimeSpec;
1255 int mNumberPrecision;
1256 QLatin1Char mNumberFormatChar;
1257 bool mNumberBeautifulPowers;
1262 int mSubTickCount, mAutoTickCount;
1263 bool mAutoTicks, mAutoTickStep, mAutoSubTicks;
1265 QPen mTickPen, mSelectedTickPen;
1266 QPen mSubTickPen, mSelectedSubTickPen;
1269 bool mRangeReversed;
1271 double mScaleLogBase, mScaleLogBaseLogInv;
1276 int mLowestVisibleTick, mHighestVisibleTick;
1277 QVector<double> mTickVector;
1278 QVector<QString> mTickVectorLabels;
1279 QVector<double> mSubTickVector;
1280 bool mCachedMarginValid;
1284 virtual void setupTickVectors();
1285 virtual void generateAutoTicks();
1286 virtual int calculateAutoSubTickCount(
double tickStep)
const;
1287 virtual int calculateMargin();
1290 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
1291 virtual void draw(QCPPainter *painter);
1294 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1295 virtual void deselectEvent(
bool *selectionStateChanged);
1298 void visibleTickBounds(
int &lowIndex,
int &highIndex)
const;
1299 double baseLog(
double value)
const;
1300 double basePow(
double value)
const;
1301 QPen getBasePen()
const;
1302 QPen getTickPen()
const;
1303 QPen getSubTickPen()
const;
1304 QFont getTickLabelFont()
const;
1305 QFont getLabelFont()
const;
1306 QColor getTickLabelColor()
const;
1307 QColor getLabelColor()
const;
1310 Q_DISABLE_COPY(QCPAxis)
1313 friend class QCPGrid;
1316 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::SelectableParts)
1317 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPAxis::AxisTypes)
1327 virtual void draw(QCPPainter *painter);
1328 virtual int size()
const;
1338 QCPLineEnding lowerEnding, upperEnding;
1343 int tickLabelPadding;
1344 double tickLabelRotation;
1346 bool substituteExponent;
1347 bool numberMultiplyCross;
1348 int tickLengthIn, tickLengthOut, subTickLengthIn, subTickLengthOut;
1349 QPen tickPen, subTickPen;
1350 QFont tickLabelFont;
1351 QColor tickLabelColor;
1352 QRect axisRect, viewportRect;
1354 bool abbreviateDecimalPowers;
1355 bool reversedEndings;
1357 QVector<double> subTickPositions;
1358 QVector<double> tickPositions;
1359 QVector<QString> tickLabels;
1369 QString basePart, expPart;
1370 QRect baseBounds, expBounds, totalBounds, rotatedTotalBounds;
1371 QFont baseFont, expFont;
1374 QByteArray mLabelParameterHash;
1375 QCache<QString, CachedLabel> mLabelCache;
1376 QRect mAxisSelectionBox, mTickLabelsSelectionBox, mLabelSelectionBox;
1378 virtual QByteArray generateLabelParameterHash()
const;
1380 virtual void placeTickLabel(QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
1381 virtual void drawTickLabel(QCPPainter *painter,
double x,
double y,
const TickLabelData &labelData)
const;
1382 virtual TickLabelData getTickLabelData(
const QFont &font,
const QString &text)
const;
1383 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
1384 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
1388 class QCP_LIB_DECL QCPAbstractPlottable :
public QCPLayerable
1392 Q_PROPERTY(QString name READ name WRITE setName)
1393 Q_PROPERTY(
bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
1394 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters)
1395 Q_PROPERTY(
bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars)
1396 Q_PROPERTY(QPen pen READ pen WRITE setPen)
1397 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
1398 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
1399 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
1400 Q_PROPERTY(QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis)
1401 Q_PROPERTY(QCPAxis* valueAxis READ valueAxis WRITE setValueAxis)
1402 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1403 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1406 QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis);
1409 QString
name()
const {
return mName; }
1413 QPen
pen()
const {
return mPen; }
1417 QCPAxis *
keyAxis()
const {
return mKeyAxis.data(); }
1423 void setName(
const QString &name);
1424 void setAntialiasedFill(
bool enabled);
1425 void setAntialiasedScatters(
bool enabled);
1426 void setAntialiasedErrorBars(
bool enabled);
1427 void setPen(
const QPen &pen);
1428 void setSelectedPen(
const QPen &pen);
1429 void setBrush(
const QBrush &brush);
1430 void setSelectedBrush(
const QBrush &brush);
1431 void setKeyAxis(QCPAxis *axis);
1432 void setValueAxis(QCPAxis *axis);
1433 Q_SLOT
void setSelectable(
bool selectable);
1434 Q_SLOT
void setSelected(
bool selected);
1437 virtual void clearData() = 0;
1438 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1439 virtual bool addToLegend();
1440 virtual bool removeFromLegend()
const;
1443 void rescaleAxes(
bool onlyEnlarge=
false)
const;
1444 void rescaleKeyAxis(
bool onlyEnlarge=
false)
const;
1445 void rescaleValueAxis(
bool onlyEnlarge=
false)
const;
1448 void selectionChanged(
bool selected);
1449 void selectableChanged(
bool selectable);
1462 bool mAntialiasedFill, mAntialiasedScatters, mAntialiasedErrorBars;
1463 QPen mPen, mSelectedPen;
1464 QBrush mBrush, mSelectedBrush;
1465 QPointer<QCPAxis> mKeyAxis, mValueAxis;
1466 bool mSelectable, mSelected;
1469 virtual QRect clipRect()
const;
1470 virtual void draw(QCPPainter *painter) = 0;
1472 void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
1474 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1475 virtual void deselectEvent(
bool *selectionStateChanged);
1478 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const = 0;
1479 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const = 0;
1480 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const = 0;
1483 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
1484 const QPointF coordsToPixels(
double key,
double value)
const;
1485 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
1486 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
1487 QPen mainPen()
const;
1488 QBrush mainBrush()
const;
1489 void applyFillAntialiasingHint(QCPPainter *painter)
const;
1490 void applyScattersAntialiasingHint(QCPPainter *painter)
const;
1491 void applyErrorBarsAntialiasingHint(QCPPainter *painter)
const;
1492 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1495 Q_DISABLE_COPY(QCPAbstractPlottable)
1498 friend class QCPAxis;
1507 virtual ~QCPItemAnchor();
1510 QString
name()
const {
return mName; }
1511 virtual QPointF pixelPoint()
const;
1521 QSet<QCPItemPosition*> mChildrenX, mChildrenY;
1533 Q_DISABLE_COPY(QCPItemAnchor)
1540 class QCP_LIB_DECL QCPItemPosition :
public QCPItemAnchor
1560 virtual ~QCPItemPosition();
1569 double key()
const {
return mKey; }
1571 QPointF
coords()
const {
return QPointF(mKey, mValue); }
1572 QCPAxis *
keyAxis()
const {
return mKeyAxis.data(); }
1575 virtual QPointF pixelPoint()
const;
1581 bool setParentAnchor(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1582 bool setParentAnchorX(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1583 bool setParentAnchorY(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1584 void setCoords(
double key,
double value);
1585 void setCoords(
const QPointF &coords);
1586 void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
1588 void setPixelPoint(
const QPointF &pixelPoint);
1593 QPointer<QCPAxis> mKeyAxis, mValueAxis;
1594 QPointer<QCPAxisRect> mAxisRect;
1595 double mKey, mValue;
1596 QCPItemAnchor *mParentAnchorX, *mParentAnchorY;
1602 Q_DISABLE_COPY(QCPItemPosition)
1607 class QCP_LIB_DECL QCPAbstractItem :
public QCPLayerable
1611 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
1612 Q_PROPERTY(
QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
1613 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1614 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1618 virtual ~QCPAbstractItem();
1627 void setClipToAxisRect(
bool clip);
1629 Q_SLOT
void setSelectable(
bool selectable);
1630 Q_SLOT
void setSelected(
bool selected);
1633 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1636 QList<QCPItemPosition*>
positions()
const {
return mPositions; }
1637 QList<QCPItemAnchor*>
anchors()
const {
return mAnchors; }
1638 QCPItemPosition *position(
const QString &name)
const;
1639 QCPItemAnchor *anchor(
const QString &name)
const;
1640 bool hasAnchor(
const QString &name)
const;
1643 void selectionChanged(
bool selected);
1644 void selectableChanged(
bool selectable);
1648 bool mClipToAxisRect;
1649 QPointer<QCPAxisRect> mClipAxisRect;
1650 QList<QCPItemPosition*> mPositions;
1651 QList<QCPItemAnchor*> mAnchors;
1652 bool mSelectable, mSelected;
1656 virtual QRect clipRect()
const;
1657 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
1658 virtual void draw(QCPPainter *painter) = 0;
1660 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1661 virtual void deselectEvent(
bool *selectionStateChanged);
1664 virtual QPointF anchorPixelPoint(
int anchorId)
const;
1667 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1668 double rectSelectTest(
const QRectF &rect,
const QPointF &pos,
bool filledRect)
const;
1669 QCPItemPosition *createPosition(
const QString &name);
1670 QCPItemAnchor *createAnchor(
const QString &name,
int anchorId);
1673 Q_DISABLE_COPY(QCPAbstractItem)
1676 friend class QCPItemAnchor;
1684 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
1685 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1686 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1687 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1688 Q_PROPERTY(QCPLayoutGrid* plotLayout READ plotLayout)
1689 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
1690 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
1691 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
1692 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
1715 explicit QCustomPlot(QWidget *parent = 0);
1716 virtual ~QCustomPlot();
1734 void setViewport(
const QRect &rect);
1735 void setBackground(
const QPixmap &pm);
1736 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1737 void setBackground(
const QBrush &brush);
1738 void setBackgroundScaled(
bool scaled);
1739 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1740 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
1742 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
1744 void setAutoAddPlottableToLegend(
bool on);
1745 void setInteractions(
const QCP::Interactions &interactions);
1746 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
1747 void setSelectionTolerance(
int pixels);
1748 void setNoAntialiasingOnDrag(
bool enabled);
1749 void setPlottingHints(
const QCP::PlottingHints &hints);
1751 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
1755 QCPAbstractPlottable *plottable(
int index);
1756 QCPAbstractPlottable *plottable();
1757 bool addPlottable(QCPAbstractPlottable *plottable);
1758 bool removePlottable(QCPAbstractPlottable *plottable);
1759 bool removePlottable(
int index);
1760 int clearPlottables();
1761 int plottableCount()
const;
1762 QList<QCPAbstractPlottable*> selectedPlottables()
const;
1763 QCPAbstractPlottable *plottableAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
1764 bool hasPlottable(QCPAbstractPlottable *plottable)
const;
1769 QCPGraph *addGraph(QCPAxis *keyAxis=0, QCPAxis *valueAxis=0);
1771 bool removeGraph(
int index);
1773 int graphCount()
const;
1774 QList<QCPGraph*> selectedGraphs()
const;
1777 QCPAbstractItem *item(
int index)
const;
1778 QCPAbstractItem *item()
const;
1779 bool addItem(QCPAbstractItem* item);
1780 bool removeItem(QCPAbstractItem *item);
1781 bool removeItem(
int index);
1783 int itemCount()
const;
1784 QList<QCPAbstractItem*> selectedItems()
const;
1785 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
1786 bool hasItem(QCPAbstractItem *item)
const;
1789 QCPLayer *layer(
const QString &name)
const;
1790 QCPLayer *layer(
int index)
const;
1791 QCPLayer *currentLayer()
const;
1792 bool setCurrentLayer(
const QString &name);
1793 bool setCurrentLayer(QCPLayer *layer);
1794 int layerCount()
const;
1795 bool addLayer(
const QString &name, QCPLayer *otherLayer=0,
LayerInsertMode insertMode=limAbove);
1796 bool removeLayer(QCPLayer *layer);
1797 bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer,
LayerInsertMode insertMode=limAbove);
1800 int axisRectCount()
const;
1802 QList<QCPAxisRect*> axisRects()
const;
1803 QCPLayoutElement* layoutElementAt(
const QPointF &pos)
const;
1804 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
1806 QList<QCPAxis*> selectedAxes()
const;
1807 QList<QCPLegend*> selectedLegends()
const;
1808 Q_SLOT
void deselectAll();
1810 bool savePdf(
const QString &fileName,
bool noCosmeticPen=
false,
int width=0,
int height=0,
const QString &pdfCreator=QString(),
const QString &pdfTitle=QString());
1811 bool savePng(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1812 bool saveJpg(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1813 bool saveBmp(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0);
1814 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1);
1815 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
1816 void toPainter(QCPPainter *painter,
int width=0,
int height=0);
1819 QCPAxis *xAxis, *yAxis, *xAxis2, *yAxis2;
1823 void mouseDoubleClick(QMouseEvent *event);
1824 void mousePress(QMouseEvent *event);
1825 void mouseMove(QMouseEvent *event);
1826 void mouseRelease(QMouseEvent *event);
1827 void mouseWheel(QWheelEvent *event);
1829 void plottableClick(QCPAbstractPlottable *plottable, QMouseEvent *event);
1830 void plottableDoubleClick(QCPAbstractPlottable *plottable, QMouseEvent *event);
1831 void itemClick(QCPAbstractItem *item, QMouseEvent *event);
1832 void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event);
1837 void titleClick(QMouseEvent *event,
QCPPlotTitle *title);
1838 void titleDoubleClick(QMouseEvent *event,
QCPPlotTitle *title);
1840 void selectionChangedByUser();
1841 void beforeReplot();
1847 QCPLayoutGrid *mPlotLayout;
1848 bool mAutoAddPlottableToLegend;
1849 QList<QCPAbstractPlottable*> mPlottables;
1850 QList<QCPGraph*> mGraphs;
1851 QList<QCPAbstractItem*> mItems;
1852 QList<QCPLayer*> mLayers;
1853 QCP::AntialiasedElements mAntialiasedElements, mNotAntialiasedElements;
1854 QCP::Interactions mInteractions;
1855 int mSelectionTolerance;
1856 bool mNoAntialiasingOnDrag;
1857 QBrush mBackgroundBrush;
1858 QPixmap mBackgroundPixmap;
1859 QPixmap mScaledBackgroundPixmap;
1860 bool mBackgroundScaled;
1861 Qt::AspectRatioMode mBackgroundScaledMode;
1862 QCPLayer *mCurrentLayer;
1863 QCP::PlottingHints mPlottingHints;
1864 Qt::KeyboardModifier mMultiSelectModifier;
1867 QPixmap mPaintBuffer;
1868 QPoint mMousePressPos;
1869 QPointer<QCPLayoutElement> mMouseEventElement;
1873 virtual QSize minimumSizeHint()
const;
1874 virtual QSize sizeHint()
const;
1875 virtual void paintEvent(QPaintEvent *event);
1876 virtual void resizeEvent(QResizeEvent *event);
1877 virtual void mouseDoubleClickEvent(QMouseEvent *event);
1878 virtual void mousePressEvent(QMouseEvent *event);
1879 virtual void mouseMoveEvent(QMouseEvent *event);
1880 virtual void mouseReleaseEvent(QMouseEvent *event);
1881 virtual void wheelEvent(QWheelEvent *event);
1884 virtual void draw(QCPPainter *painter);
1885 virtual void axisRemoved(QCPAxis *axis);
1886 virtual void legendRemoved(
QCPLegend *legend);
1889 void updateLayerIndices()
const;
1890 QCPLayerable *layerableAt(
const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=0)
const;
1891 void drawBackground(QCPPainter *painter);
1894 friend class QCPAxis;
1895 friend class QCPLayer;
1934 bool operator==(
const QCPColorGradient &other)
const;
1935 bool operator!=(
const QCPColorGradient &other)
const {
return !(*
this == other); }
1944 void setLevelCount(
int n);
1945 void setColorStops(
const QMap<double, QColor> &colorStops);
1946 void setColorStopAt(
double position,
const QColor &color);
1948 void setPeriodic(
bool enabled);
1951 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
1952 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
1954 void clearColorStops();
1955 QCPColorGradient inverted()
const;
1958 void updateColorBuffer();
1962 QMap<double, QColor> mColorStops;
1967 QVector<QRgb> mColorBuffer;
1968 bool mColorBufferInvalidated;
1972 class QCP_LIB_DECL QCPAxisRect :
public QCPLayoutElement
1976 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1977 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1978 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1979 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
1980 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
1983 explicit QCPAxisRect(QCustomPlot *parentPlot,
bool setupDefaultAxes=
true);
1984 virtual ~QCPAxisRect();
1992 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
1993 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
1994 double rangeZoomFactor(Qt::Orientation orientation);
1997 void setBackground(
const QPixmap &pm);
1998 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1999 void setBackground(
const QBrush &brush);
2000 void setBackgroundScaled(
bool scaled);
2001 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
2002 void setRangeDrag(Qt::Orientations orientations);
2003 void setRangeZoom(Qt::Orientations orientations);
2004 void setRangeDragAxes(QCPAxis *horizontal, QCPAxis *vertical);
2005 void setRangeZoomAxes(QCPAxis *horizontal, QCPAxis *vertical);
2006 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
2007 void setRangeZoomFactor(
double factor);
2012 QList<QCPAxis*> axes(QCPAxis::AxisTypes types)
const;
2013 QList<QCPAxis*> axes()
const;
2015 QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
2016 bool removeAxis(QCPAxis *axis);
2019 void setupFullAxesBox(
bool connectRanges=
false);
2020 QList<QCPAbstractPlottable*> plottables()
const;
2021 QList<QCPGraph*> graphs()
const;
2022 QList<QCPAbstractItem*> items()
const;
2025 int left()
const {
return mRect.left(); }
2026 int right()
const {
return mRect.right(); }
2027 int top()
const {
return mRect.top(); }
2028 int bottom()
const {
return mRect.bottom(); }
2029 int width()
const {
return mRect.width(); }
2030 int height()
const {
return mRect.height(); }
2031 QSize
size()
const {
return mRect.size(); }
2032 QPoint
topLeft()
const {
return mRect.topLeft(); }
2036 QPoint
center()
const {
return mRect.center(); }
2040 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
2044 QBrush mBackgroundBrush;
2045 QPixmap mBackgroundPixmap;
2046 QPixmap mScaledBackgroundPixmap;
2047 bool mBackgroundScaled;
2048 Qt::AspectRatioMode mBackgroundScaledMode;
2049 QCPLayoutInset *mInsetLayout;
2050 Qt::Orientations mRangeDrag, mRangeZoom;
2051 QPointer<QCPAxis> mRangeDragHorzAxis, mRangeDragVertAxis, mRangeZoomHorzAxis, mRangeZoomVertAxis;
2052 double mRangeZoomFactorHorz, mRangeZoomFactorVert;
2054 QCPRange mDragStartHorzRange, mDragStartVertRange;
2055 QCP::AntialiasedElements mAADragBackup, mNotAADragBackup;
2058 QHash<QCPAxis::AxisType, QList<QCPAxis*> > mAxes;
2061 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
2062 virtual void draw(QCPPainter *painter);
2065 virtual void mousePressEvent(QMouseEvent *event);
2066 virtual void mouseMoveEvent(QMouseEvent *event);
2067 virtual void mouseReleaseEvent(QMouseEvent *event);
2068 virtual void wheelEvent(QWheelEvent *event);
2071 void drawBackground(QCPPainter *painter);
2075 Q_DISABLE_COPY(QCPAxisRect)
2077 friend class QCustomPlot;
2081 class QCP_LIB_DECL QCPAbstractLegendItem :
public QCPLayoutElement
2085 Q_PROPERTY(
QCPLegend* parentLegend READ parentLegend)
2086 Q_PROPERTY(QFont font READ font WRITE setFont)
2087 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2088 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2089 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2090 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged)
2091 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
2094 explicit QCPAbstractLegendItem(
QCPLegend *parent);
2098 QFont
font()
const {
return mFont; }
2106 void setFont(
const QFont &font);
2107 void setTextColor(
const QColor &color);
2108 void setSelectedFont(
const QFont &font);
2109 void setSelectedTextColor(
const QColor &color);
2110 Q_SLOT
void setSelectable(
bool selectable);
2111 Q_SLOT
void setSelected(
bool selected);
2114 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2117 void selectionChanged(
bool selected);
2118 void selectableChanged(
bool selectable);
2125 QFont mSelectedFont;
2126 QColor mSelectedTextColor;
2127 bool mSelectable, mSelected;
2131 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
2132 virtual QRect clipRect()
const;
2133 virtual void draw(QCPPainter *painter) = 0;
2135 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2136 virtual void deselectEvent(
bool *selectionStateChanged);
2139 Q_DISABLE_COPY(QCPAbstractLegendItem)
2145 class QCP_LIB_DECL QCPPlottableLegendItem :
public QCPAbstractLegendItem
2149 QCPPlottableLegendItem(
QCPLegend *parent, QCPAbstractPlottable *plottable);
2156 QCPAbstractPlottable *mPlottable;
2159 virtual void draw(QCPPainter *painter);
2160 virtual QSize minimumSizeHint()
const;
2163 QPen getIconBorderPen()
const;
2164 QColor getTextColor()
const;
2165 QFont getFont()
const;
2173 Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
2174 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2175 Q_PROPERTY(QFont font READ font WRITE setFont)
2176 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2177 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
2178 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
2179 Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
2180 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged)
2181 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged)
2182 Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
2183 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
2184 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2185 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2186 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2195 ,spLegendBox = 0x001
2201 explicit QCPLegend();
2202 virtual ~QCPLegend();
2207 QFont
font()
const {
return mFont; }
2213 SelectableParts selectedParts()
const;
2221 void setBorderPen(
const QPen &pen);
2222 void setBrush(
const QBrush &brush);
2223 void setFont(
const QFont &font);
2224 void setTextColor(
const QColor &color);
2225 void setIconSize(
const QSize &size);
2226 void setIconSize(
int width,
int height);
2227 void setIconTextPadding(
int padding);
2228 void setIconBorderPen(
const QPen &pen);
2229 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
2230 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
2231 void setSelectedBorderPen(
const QPen &pen);
2232 void setSelectedIconBorderPen(
const QPen &pen);
2233 void setSelectedBrush(
const QBrush &brush);
2234 void setSelectedFont(
const QFont &font);
2235 void setSelectedTextColor(
const QColor &color);
2238 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2241 QCPAbstractLegendItem *item(
int index)
const;
2242 QCPPlottableLegendItem *itemWithPlottable(
const QCPAbstractPlottable *plottable)
const;
2243 int itemCount()
const;
2244 bool hasItem(QCPAbstractLegendItem *item)
const;
2245 bool hasItemWithPlottable(
const QCPAbstractPlottable *plottable)
const;
2246 bool addItem(QCPAbstractLegendItem *item);
2247 bool removeItem(
int index);
2248 bool removeItem(QCPAbstractLegendItem *item);
2250 QList<QCPAbstractLegendItem*> selectedItems()
const;
2253 void selectionChanged(QCPLegend::SelectableParts parts);
2254 void selectableChanged(QCPLegend::SelectableParts parts);
2258 QPen mBorderPen, mIconBorderPen;
2263 int mIconTextPadding;
2264 SelectableParts mSelectedParts, mSelectableParts;
2265 QPen mSelectedBorderPen, mSelectedIconBorderPen;
2266 QBrush mSelectedBrush;
2267 QFont mSelectedFont;
2268 QColor mSelectedTextColor;
2271 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
2273 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
2274 virtual void draw(QCPPainter *painter);
2276 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2277 virtual void deselectEvent(
bool *selectionStateChanged);
2280 QPen getBorderPen()
const;
2281 QBrush getBrush()
const;
2284 Q_DISABLE_COPY(QCPLegend)
2286 friend class QCustomPlot;
2287 friend class QCPAbstractLegendItem;
2289 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPLegend::SelectableParts)
2293 class QCP_LIB_DECL QCPPlotTitle :
public QCPLayoutElement
2297 Q_PROPERTY(QString text READ text WRITE setText)
2298 Q_PROPERTY(QFont font READ font WRITE setFont)
2299 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2300 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2301 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2302 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
2303 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
2306 explicit QCPPlotTitle(QCustomPlot *parentPlot);
2307 explicit QCPPlotTitle(QCustomPlot *parentPlot,
const QString &text);
2310 QString
text()
const {
return mText; }
2311 QFont
font()
const {
return mFont; }
2319 void setText(
const QString &text);
2320 void setFont(
const QFont &font);
2321 void setTextColor(
const QColor &color);
2322 void setSelectedFont(
const QFont &font);
2323 void setSelectedTextColor(
const QColor &color);
2324 Q_SLOT
void setSelectable(
bool selectable);
2325 Q_SLOT
void setSelected(
bool selected);
2328 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2331 void selectionChanged(
bool selected);
2332 void selectableChanged(
bool selectable);
2339 QFont mSelectedFont;
2340 QColor mSelectedTextColor;
2341 QRect mTextBoundingRect;
2342 bool mSelectable, mSelected;
2345 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
2346 virtual void draw(QCPPainter *painter);
2347 virtual QSize minimumSizeHint()
const;
2348 virtual QSize maximumSizeHint()
const;
2350 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2351 virtual void deselectEvent(
bool *selectionStateChanged);
2354 QFont mainFont()
const;
2355 QColor mainTextColor()
const;
2358 Q_DISABLE_COPY(QCPPlotTitle)
2369 QImage mGradientImage;
2370 bool mGradientImageInvalidated;
2378 virtual void draw(QCPPainter *painter);
2379 void updateGradientImage();
2380 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
2381 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
2386 class QCP_LIB_DECL QCPColorScale :
public QCPLayoutElement
2391 Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
2392 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
2393 Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
2394 Q_PROPERTY(QString label READ label WRITE setLabel)
2395 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
2396 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
2397 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
2400 explicit QCPColorScale(QCustomPlot *parentPlot);
2401 virtual ~QCPColorScale();
2404 QCPAxis *
axis()
const {
return mColorAxis.data(); }
2408 QCPColorGradient
gradient()
const {
return mGradient; }
2409 QString label()
const;
2411 bool rangeDrag()
const;
2412 bool rangeZoom()
const;
2416 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
2418 Q_SLOT
void setGradient(
const QCPColorGradient &gradient);
2419 void setLabel(
const QString &str);
2420 void setBarWidth(
int width);
2421 void setRangeDrag(
bool enabled);
2422 void setRangeZoom(
bool enabled);
2425 QList<QCPColorMap*> colorMaps()
const;
2426 void rescaleDataRange(
bool onlyVisibleMaps);
2432 void dataRangeChanged(QCPRange newRange);
2434 void gradientChanged(QCPColorGradient newGradient);
2439 QCPRange mDataRange;
2441 QCPColorGradient mGradient;
2445 QPointer<QCPColorScaleAxisRectPrivate> mAxisRect;
2446 QPointer<QCPAxis> mColorAxis;
2449 virtual void applyDefaultAntialiasingHint(QCPPainter *painter)
const;
2451 virtual void mousePressEvent(QMouseEvent *event);
2452 virtual void mouseMoveEvent(QMouseEvent *event);
2453 virtual void mouseReleaseEvent(QMouseEvent *event);
2454 virtual void wheelEvent(QWheelEvent *event);
2457 Q_DISABLE_COPY(QCPColorScale)
2471 QCPData(
double key,
double value);
2473 double keyErrorPlus, keyErrorMinus;
2474 double valueErrorPlus, valueErrorMinus;
2494 Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2495 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2496 Q_PROPERTY(ErrorType errorType READ errorType WRITE setErrorType)
2497 Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen)
2498 Q_PROPERTY(
double errorBarSize READ errorBarSize WRITE setErrorBarSize)
2499 Q_PROPERTY(
bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol)
2500 Q_PROPERTY(
QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
2501 Q_PROPERTY(
bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
2528 explicit QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis);
2543 void setData(
QCPDataMap *data,
bool copy=
false);
2544 void setData(
const QVector<double> &key,
const QVector<double> &value);
2545 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError);
2546 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyErrorMinus,
const QVector<double> &keyErrorPlus);
2547 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueError);
2548 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueErrorMinus,
const QVector<double> &valueErrorPlus);
2549 void setDataBothError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError,
const QVector<double> &valueError);
2550 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);
2554 void setErrorPen(
const QPen &pen);
2555 void setErrorBarSize(
double size);
2556 void setErrorBarSkipSymbol(
bool enabled);
2557 void setChannelFillGraph(
QCPGraph *targetGraph);
2558 void setAdaptiveSampling(
bool enabled);
2562 void addData(
const QCPData &data);
2563 void addData(
double key,
double value);
2564 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2565 void removeDataBefore(
double key);
2566 void removeDataAfter(
double key);
2567 void removeData(
double fromKey,
double toKey);
2568 void removeData(
double key);
2571 virtual void clearData();
2572 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2576 void rescaleAxes(
bool onlyEnlarge,
bool includeErrorBars)
const;
2577 void rescaleKeyAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
2578 void rescaleValueAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
2587 double mErrorBarSize;
2588 bool mErrorBarSkipSymbol;
2589 QPointer<QCPGraph> mChannelFillGraph;
2590 bool mAdaptiveSampling;
2593 virtual void draw(QCPPainter *painter);
2594 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
2595 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2596 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2597 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain,
bool includeErrors)
const;
2598 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain,
bool includeErrors)
const;
2601 virtual void drawFill(QCPPainter *painter, QVector<QPointF> *lineData)
const;
2602 virtual void drawScatterPlot(QCPPainter *painter, QVector<QCPData> *scatterData)
const;
2603 virtual void drawLinePlot(QCPPainter *painter, QVector<QPointF> *lineData)
const;
2604 virtual void drawImpulsePlot(QCPPainter *painter, QVector<QPointF> *lineData)
const;
2607 void getPreparedData(QVector<QCPData> *lineData, QVector<QCPData> *scatterData)
const;
2608 void getPlotData(QVector<QPointF> *lineData, QVector<QCPData> *scatterData)
const;
2609 void getScatterPlotData(QVector<QCPData> *scatterData)
const;
2610 void getLinePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2611 void getStepLeftPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2612 void getStepRightPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2613 void getStepCenterPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2614 void getImpulsePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2615 void drawError(QCPPainter *painter,
double x,
double y,
const QCPData &data)
const;
2616 void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper)
const;
2617 int countDataInBounds(
const QCPDataMap::const_iterator &lower,
const QCPDataMap::const_iterator &upper,
int maxCount)
const;
2618 void addFillBasePoints(QVector<QPointF> *lineData)
const;
2619 void removeFillBasePoints(QVector<QPointF> *lineData)
const;
2620 QPointF lowerFillBasePoint(
double lowerKey)
const;
2621 QPointF upperFillBasePoint(
double upperKey)
const;
2622 const QPolygonF getChannelFillPolygon(
const QVector<QPointF> *lineData)
const;
2623 int findIndexBelowX(
const QVector<QPointF> *data,
double x)
const;
2624 int findIndexAboveX(
const QVector<QPointF> *data,
double x)
const;
2625 int findIndexBelowY(
const QVector<QPointF> *data,
double y)
const;
2626 int findIndexAboveY(
const QVector<QPointF> *data,
double y)
const;
2627 double pointDistance(
const QPointF &pixelPoint)
const;
2629 friend class QCustomPlot;
2630 friend class QCPLegend;
2642 QCPCurveData(
double t,
double key,
double value);
2643 double t, key, value;
2664 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2665 Q_PROPERTY(LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2676 explicit QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis);
2686 void setData(
const QVector<double> &t,
const QVector<double> &key,
const QVector<double> &value);
2687 void setData(
const QVector<double> &key,
const QVector<double> &value);
2693 void addData(
const QCPCurveData &data);
2694 void addData(
double t,
double key,
double value);
2695 void addData(
double key,
double value);
2696 void addData(
const QVector<double> &ts,
const QVector<double> &keys,
const QVector<double> &values);
2697 void removeDataBefore(
double t);
2698 void removeDataAfter(
double t);
2699 void removeData(
double fromt,
double tot);
2700 void removeData(
double t);
2703 virtual void clearData();
2704 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2713 virtual void draw(QCPPainter *painter);
2714 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
2715 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2716 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2719 virtual void drawScatterPlot(QCPPainter *painter,
const QVector<QPointF> *pointData)
const;
2722 void getCurveData(QVector<QPointF> *lineData)
const;
2723 int getRegion(
double x,
double y,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
2724 QPointF getOptimizedPoint(
int prevRegion,
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
2725 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
2726 bool mayTraverse(
int prevRegion,
int currentRegion)
const;
2727 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom, QPointF &crossA, QPointF &crossB)
const;
2728 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom, QVector<QPointF> &beforeTraverse, QVector<QPointF> &afterTraverse)
const;
2729 double pointDistance(
const QPointF &pixelPoint)
const;
2731 friend class QCustomPlot;
2732 friend class QCPLegend;
2744 Q_PROPERTY(SpacingType spacingType READ spacingType WRITE setSpacingType)
2745 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
2758 QCPBarsGroup(QCustomPlot *parentPlot);
2767 void setSpacing(
double spacing);
2770 QList<QCPBars*>
bars()
const {
return mBars; }
2771 QCPBars* bars(
int index)
const;
2772 int size()
const {
return mBars.size(); }
2777 void insert(
int i,
QCPBars *bars);
2782 QCustomPlot *mParentPlot;
2785 QList<QCPBars*> mBars;
2788 void registerBars(
QCPBars *bars);
2789 void unregisterBars(
QCPBars *bars);
2792 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
2793 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
2796 Q_DISABLE_COPY(QCPBarsGroup)
2806 QCPBarData(
double key,
double value);
2827 Q_PROPERTY(
double width READ width WRITE setWidth)
2828 Q_PROPERTY(WidthType widthType READ widthType WRITE setWidthType)
2829 Q_PROPERTY(QCPBarsGroup* barsGroup READ barsGroup WRITE setBarsGroup)
2830 Q_PROPERTY(
double baseValue READ baseValue WRITE setBaseValue)
2831 Q_PROPERTY(
QCPBars* barBelow READ barBelow)
2832 Q_PROPERTY(
QCPBars* barAbove READ barAbove)
2847 explicit QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis);
2860 void setWidth(
double width);
2862 void setBarsGroup(QCPBarsGroup *barsGroup);
2863 void setBaseValue(
double baseValue);
2865 void setData(
const QVector<double> &key,
const QVector<double> &value);
2868 void moveBelow(
QCPBars *bars);
2869 void moveAbove(
QCPBars *bars);
2871 void addData(
const QCPBarData &data);
2872 void addData(
double key,
double value);
2873 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2874 void removeDataBefore(
double key);
2875 void removeDataAfter(
double key);
2876 void removeData(
double fromKey,
double toKey);
2877 void removeData(
double key);
2880 virtual void clearData();
2881 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2888 QCPBarsGroup *mBarsGroup;
2890 QPointer<QCPBars> mBarBelow, mBarAbove;
2893 virtual void draw(QCPPainter *painter);
2894 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
2895 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2896 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2899 void getVisibleDataBounds(QCPBarDataMap::const_iterator &lower, QCPBarDataMap::const_iterator &upperEnd)
const;
2900 QPolygonF getBarPolygon(
double key,
double value)
const;
2901 void getPixelWidth(
double key,
double &lower,
double &upper)
const;
2902 double getStackedBaseValue(
double key,
bool positive)
const;
2905 friend class QCustomPlot;
2906 friend class QCPLegend;
2907 friend class QCPBarsGroup;
2915 class QCP_LIB_DECL QCPStatisticalBox :
public QCPAbstractPlottable
2919 Q_PROPERTY(
double key READ key WRITE setKey)
2920 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum)
2921 Q_PROPERTY(
double lowerQuartile READ lowerQuartile WRITE setLowerQuartile)
2922 Q_PROPERTY(
double median READ median WRITE setMedian)
2923 Q_PROPERTY(
double upperQuartile READ upperQuartile WRITE setUpperQuartile)
2924 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum)
2925 Q_PROPERTY(QVector<double> outliers READ outliers WRITE setOutliers)
2926 Q_PROPERTY(
double width READ width WRITE setWidth)
2927 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
2928 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
2929 Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
2930 Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
2931 Q_PROPERTY(
QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
2934 explicit QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis);
2937 double key()
const {
return mKey; }
2952 void setKey(
double key);
2953 void setMinimum(
double value);
2954 void setLowerQuartile(
double value);
2955 void setMedian(
double value);
2956 void setUpperQuartile(
double value);
2957 void setMaximum(
double value);
2958 void setOutliers(
const QVector<double> &values);
2959 void setData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum);
2960 void setWidth(
double width);
2961 void setWhiskerWidth(
double width);
2962 void setWhiskerPen(
const QPen &pen);
2963 void setWhiskerBarPen(
const QPen &pen);
2964 void setMedianPen(
const QPen &pen);
2968 virtual void clearData();
2969 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2973 QVector<double> mOutliers;
2974 double mKey, mMinimum, mLowerQuartile, mMedian, mUpperQuartile, mMaximum;
2976 double mWhiskerWidth;
2977 QPen mWhiskerPen, mWhiskerBarPen, mMedianPen;
2981 virtual void draw(QCPPainter *painter);
2982 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
2983 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2984 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
2987 virtual void drawQuartileBox(QCPPainter *painter, QRectF *quartileBox=0)
const;
2988 virtual void drawMedian(QCPPainter *painter)
const;
2989 virtual void drawWhiskers(QCPPainter *painter)
const;
2990 virtual void drawOutliers(QCPPainter *painter)
const;
2992 friend class QCustomPlot;
2993 friend class QCPLegend;
3000 QCPColorMapData(
int keySize,
int valueSize,
const QCPRange &keyRange,
const QCPRange &valueRange);
3002 QCPColorMapData(
const QCPColorMapData &other);
3003 QCPColorMapData &operator=(
const QCPColorMapData &other);
3011 double data(
double key,
double value);
3012 double cell(
int keyIndex,
int valueIndex);
3015 void setSize(
int keySize,
int valueSize);
3016 void setKeySize(
int keySize);
3017 void setValueSize(
int valueSize);
3018 void setRange(
const QCPRange &keyRange,
const QCPRange &valueRange);
3019 void setKeyRange(
const QCPRange &keyRange);
3020 void setValueRange(
const QCPRange &valueRange);
3021 void setData(
double key,
double value,
double z);
3022 void setCell(
int keyIndex,
int valueIndex,
double z);
3025 void recalculateDataBounds();
3027 void fill(
double z);
3029 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
3030 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
3034 int mKeySize, mValueSize;
3035 QCPRange mKeyRange, mValueRange;
3039 QCPRange mDataBounds;
3046 class QCP_LIB_DECL QCPColorMap :
public QCPAbstractPlottable
3050 Q_PROPERTY(QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
3051 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
3052 Q_PROPERTY(QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
3053 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
3054 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
3055 Q_PROPERTY(QCPColorScale* colorScale READ colorScale WRITE setColorScale)
3058 explicit QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis);
3059 virtual ~QCPColorMap();
3062 QCPColorMapData *
data()
const {
return mMapData; }
3067 QCPColorGradient
gradient()
const {
return mGradient; }
3071 void setData(QCPColorMapData *data,
bool copy=
false);
3072 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
3074 Q_SLOT
void setGradient(
const QCPColorGradient &gradient);
3075 void setInterpolate(
bool enabled);
3076 void setTightBoundary(
bool enabled);
3077 void setColorScale(QCPColorScale *colorScale);
3080 void rescaleDataRange(
bool recalculateDataBounds=
false);
3081 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
3084 virtual void clearData();
3085 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3088 void dataRangeChanged(QCPRange newRange);
3090 void gradientChanged(QCPColorGradient newGradient);
3094 QCPRange mDataRange;
3096 QCPColorMapData *mMapData;
3097 QCPColorGradient mGradient;
3099 bool mTightBoundary;
3100 QPointer<QCPColorScale> mColorScale;
3102 QImage mMapImage, mUndersampledMapImage;
3103 QPixmap mLegendIcon;
3104 bool mMapImageInvalidated;
3107 virtual void updateMapImage();
3110 virtual void draw(QCPPainter *painter);
3111 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
3112 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
3113 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
3115 friend class QCustomPlot;
3116 friend class QCPLegend;
3128 QCPFinancialData(
double key,
double open,
double high,
double low,
double close);
3129 double key, open, high, low, close;
3149 Q_PROPERTY(ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
3150 Q_PROPERTY(
double width READ width WRITE setWidth)
3151 Q_PROPERTY(
bool twoColored READ twoColored WRITE setTwoColored)
3152 Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive)
3153 Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative)
3154 Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive)
3155 Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative)
3168 explicit QCPFinancial(QCPAxis *keyAxis, QCPAxis *valueAxis);
3184 void setData(
const QVector<double> &key,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close);
3186 void setWidth(
double width);
3187 void setTwoColored(
bool twoColored);
3188 void setBrushPositive(
const QBrush &brush);
3189 void setBrushNegative(
const QBrush &brush);
3190 void setPenPositive(
const QPen &pen);
3191 void setPenNegative(
const QPen &pen);
3195 void addData(
const QCPFinancialData &data);
3196 void addData(
double key,
double open,
double high,
double low,
double close);
3197 void addData(
const QVector<double> &key,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close);
3198 void removeDataBefore(
double key);
3199 void removeDataAfter(
double key);
3200 void removeData(
double fromKey,
double toKey);
3201 void removeData(
double key);
3204 virtual void clearData();
3205 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3208 static QCPFinancialDataMap timeSeriesToOhlc(
const QVector<double> &time,
const QVector<double> &value,
double timeBinSize,
double timeBinOffset = 0);
3216 QBrush mBrushPositive, mBrushNegative;
3217 QPen mPenPositive, mPenNegative;
3220 virtual void draw(QCPPainter *painter);
3221 virtual void drawLegendIcon(QCPPainter *painter,
const QRectF &rect)
const;
3222 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
3223 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=
sdBoth)
const;
3226 void drawOhlcPlot(QCPPainter *painter,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end);
3227 void drawCandlestickPlot(QCPPainter *painter,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end);
3228 double ohlcSelectTest(
const QPointF &pos,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end)
const;
3229 double candlestickSelectTest(
const QPointF &pos,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end)
const;
3230 void getVisibleDataBounds(QCPFinancialDataMap::const_iterator &lower, QCPFinancialDataMap::const_iterator &upper)
const;
3232 friend class QCustomPlot;
3233 friend class QCPLegend;
3237 class QCP_LIB_DECL QCPItemStraightLine :
public QCPAbstractItem
3241 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3242 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3245 QCPItemStraightLine(QCustomPlot *parentPlot);
3246 virtual ~QCPItemStraightLine();
3249 QPen
pen()
const {
return mPen; }
3253 void setPen(
const QPen &pen);
3254 void setSelectedPen(
const QPen &pen);
3257 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3259 QCPItemPosition *
const point1;
3260 QCPItemPosition *
const point2;
3264 QPen mPen, mSelectedPen;
3267 virtual void draw(QCPPainter *painter);
3270 double distToStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QVector2D &point)
const;
3271 QLineF getRectClippedStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QRect &rect)
const;
3272 QPen mainPen()
const;
3276 class QCP_LIB_DECL QCPItemLine :
public QCPAbstractItem
3280 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3281 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3282 Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
3283 Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
3286 QCPItemLine(QCustomPlot *parentPlot);
3287 virtual ~QCPItemLine();
3290 QPen
pen()
const {
return mPen; }
3292 QCPLineEnding
head()
const {
return mHead; }
3293 QCPLineEnding
tail()
const {
return mTail; }
3296 void setPen(
const QPen &pen);
3297 void setSelectedPen(
const QPen &pen);
3298 void setHead(
const QCPLineEnding &head);
3299 void setTail(
const QCPLineEnding &tail);
3302 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3304 QCPItemPosition *
const start;
3305 QCPItemPosition *
const end;
3309 QPen mPen, mSelectedPen;
3310 QCPLineEnding mHead, mTail;
3313 virtual void draw(QCPPainter *painter);
3316 QLineF getRectClippedLine(
const QVector2D &start,
const QVector2D &end,
const QRect &rect)
const;
3317 QPen mainPen()
const;
3321 class QCP_LIB_DECL QCPItemCurve :
public QCPAbstractItem
3325 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3326 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3327 Q_PROPERTY(QCPLineEnding head READ head WRITE setHead)
3328 Q_PROPERTY(QCPLineEnding tail READ tail WRITE setTail)
3331 QCPItemCurve(QCustomPlot *parentPlot);
3332 virtual ~QCPItemCurve();
3335 QPen
pen()
const {
return mPen; }
3337 QCPLineEnding
head()
const {
return mHead; }
3338 QCPLineEnding
tail()
const {
return mTail; }
3341 void setPen(
const QPen &pen);
3342 void setSelectedPen(
const QPen &pen);
3343 void setHead(
const QCPLineEnding &head);
3344 void setTail(
const QCPLineEnding &tail);
3347 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3349 QCPItemPosition *
const start;
3350 QCPItemPosition *
const startDir;
3351 QCPItemPosition *
const endDir;
3352 QCPItemPosition *
const end;
3356 QPen mPen, mSelectedPen;
3357 QCPLineEnding mHead, mTail;
3360 virtual void draw(QCPPainter *painter);
3363 QPen mainPen()
const;
3367 class QCP_LIB_DECL QCPItemRect :
public QCPAbstractItem
3371 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3372 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3373 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3374 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3377 QCPItemRect(QCustomPlot *parentPlot);
3378 virtual ~QCPItemRect();
3381 QPen
pen()
const {
return mPen; }
3387 void setPen(
const QPen &pen);
3388 void setSelectedPen(
const QPen &pen);
3389 void setBrush(
const QBrush &brush);
3390 void setSelectedBrush(
const QBrush &brush);
3393 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3395 QCPItemPosition *
const topLeft;
3396 QCPItemPosition *
const bottomRight;
3397 QCPItemAnchor *
const top;
3398 QCPItemAnchor *
const topRight;
3399 QCPItemAnchor *
const right;
3400 QCPItemAnchor *
const bottom;
3401 QCPItemAnchor *
const bottomLeft;
3402 QCPItemAnchor *
const left;
3405 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
3408 QPen mPen, mSelectedPen;
3409 QBrush mBrush, mSelectedBrush;
3412 virtual void draw(QCPPainter *painter);
3413 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3416 QPen mainPen()
const;
3417 QBrush mainBrush()
const;
3421 class QCP_LIB_DECL QCPItemText :
public QCPAbstractItem
3425 Q_PROPERTY(QColor color READ color WRITE setColor)
3426 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
3427 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3428 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3429 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3430 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3431 Q_PROPERTY(QFont font READ font WRITE setFont)
3432 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
3433 Q_PROPERTY(QString text READ text WRITE setText)
3434 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
3435 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
3436 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
3437 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
3440 QCPItemText(QCustomPlot *parentPlot);
3441 virtual ~QCPItemText();
3446 QPen
pen()
const {
return mPen; }
3450 QFont
font()
const {
return mFont; }
3452 QString
text()
const {
return mText; }
3459 void setColor(
const QColor &color);
3460 void setSelectedColor(
const QColor &color);
3461 void setPen(
const QPen &pen);
3462 void setSelectedPen(
const QPen &pen);
3463 void setBrush(
const QBrush &brush);
3464 void setSelectedBrush(
const QBrush &brush);
3465 void setFont(
const QFont &font);
3466 void setSelectedFont(
const QFont &font);
3467 void setText(
const QString &text);
3468 void setPositionAlignment(Qt::Alignment alignment);
3469 void setTextAlignment(Qt::Alignment alignment);
3470 void setRotation(
double degrees);
3471 void setPadding(
const QMargins &padding);
3474 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3476 QCPItemPosition *
const position;
3477 QCPItemAnchor *
const topLeft;
3478 QCPItemAnchor *
const top;
3479 QCPItemAnchor *
const topRight;
3480 QCPItemAnchor *
const right;
3481 QCPItemAnchor *
const bottomRight;
3482 QCPItemAnchor *
const bottom;
3483 QCPItemAnchor *
const bottomLeft;
3484 QCPItemAnchor *
const left;
3487 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
3490 QColor mColor, mSelectedColor;
3491 QPen mPen, mSelectedPen;
3492 QBrush mBrush, mSelectedBrush;
3493 QFont mFont, mSelectedFont;
3495 Qt::Alignment mPositionAlignment;
3496 Qt::Alignment mTextAlignment;
3501 virtual void draw(QCPPainter *painter);
3502 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3505 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
3506 QFont mainFont()
const;
3507 QColor mainColor()
const;
3508 QPen mainPen()
const;
3509 QBrush mainBrush()
const;
3513 class QCP_LIB_DECL QCPItemEllipse :
public QCPAbstractItem
3517 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3518 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3519 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3520 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3523 QCPItemEllipse(QCustomPlot *parentPlot);
3524 virtual ~QCPItemEllipse();
3527 QPen
pen()
const {
return mPen; }
3533 void setPen(
const QPen &pen);
3534 void setSelectedPen(
const QPen &pen);
3535 void setBrush(
const QBrush &brush);
3536 void setSelectedBrush(
const QBrush &brush);
3539 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3541 QCPItemPosition *
const topLeft;
3542 QCPItemPosition *
const bottomRight;
3543 QCPItemAnchor *
const topLeftRim;
3544 QCPItemAnchor *
const top;
3545 QCPItemAnchor *
const topRightRim;
3546 QCPItemAnchor *
const right;
3547 QCPItemAnchor *
const bottomRightRim;
3548 QCPItemAnchor *
const bottom;
3549 QCPItemAnchor *
const bottomLeftRim;
3550 QCPItemAnchor *
const left;
3551 QCPItemAnchor *
const center;
3554 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
3557 QPen mPen, mSelectedPen;
3558 QBrush mBrush, mSelectedBrush;
3561 virtual void draw(QCPPainter *painter);
3562 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3565 QPen mainPen()
const;
3566 QBrush mainBrush()
const;
3570 class QCP_LIB_DECL QCPItemPixmap :
public QCPAbstractItem
3574 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
3575 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
3576 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
3577 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
3578 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3579 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3582 QCPItemPixmap(QCustomPlot *parentPlot);
3583 virtual ~QCPItemPixmap();
3590 QPen
pen()
const {
return mPen; }
3594 void setPixmap(
const QPixmap &pixmap);
3595 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
3596 void setPen(
const QPen &pen);
3597 void setSelectedPen(
const QPen &pen);
3600 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3602 QCPItemPosition *
const topLeft;
3603 QCPItemPosition *
const bottomRight;
3604 QCPItemAnchor *
const top;
3605 QCPItemAnchor *
const topRight;
3606 QCPItemAnchor *
const right;
3607 QCPItemAnchor *
const bottom;
3608 QCPItemAnchor *
const bottomLeft;
3609 QCPItemAnchor *
const left;
3612 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
3616 QPixmap mScaledPixmap;
3618 bool mScaledPixmapInvalidated;
3619 Qt::AspectRatioMode mAspectRatioMode;
3620 Qt::TransformationMode mTransformationMode;
3621 QPen mPen, mSelectedPen;
3624 virtual void draw(QCPPainter *painter);
3625 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3628 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
3629 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
3630 QPen mainPen()
const;
3634 class QCP_LIB_DECL QCPItemTracer :
public QCPAbstractItem
3638 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3639 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3640 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3641 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3642 Q_PROPERTY(
double size READ size WRITE setSize)
3643 Q_PROPERTY(TracerStyle style READ style WRITE setStyle)
3644 Q_PROPERTY(
QCPGraph* graph READ graph WRITE setGraph)
3645 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
3646 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
3662 QCPItemTracer(QCustomPlot *parentPlot);
3663 virtual ~QCPItemTracer();
3666 QPen
pen()
const {
return mPen; }
3670 double size()
const {
return mSize; }
3677 void setPen(
const QPen &pen);
3678 void setSelectedPen(
const QPen &pen);
3679 void setBrush(
const QBrush &brush);
3680 void setSelectedBrush(
const QBrush &brush);
3681 void setSize(
double size);
3684 void setGraphKey(
double key);
3685 void setInterpolating(
bool enabled);
3688 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3691 void updatePosition();
3693 QCPItemPosition *
const position;
3697 QPen mPen, mSelectedPen;
3698 QBrush mBrush, mSelectedBrush;
3703 bool mInterpolating;
3706 virtual void draw(QCPPainter *painter);
3709 QPen mainPen()
const;
3710 QBrush mainBrush()
const;
3714 class QCP_LIB_DECL QCPItemBracket :
public QCPAbstractItem
3718 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3719 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3720 Q_PROPERTY(
double length READ length WRITE setLength)
3721 Q_PROPERTY(BracketStyle style READ style WRITE setStyle)
3730 QCPItemBracket(QCustomPlot *parentPlot);
3731 virtual ~QCPItemBracket();
3734 QPen
pen()
const {
return mPen; }
3740 void setPen(
const QPen &pen);
3741 void setSelectedPen(
const QPen &pen);
3742 void setLength(
double length);
3746 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3748 QCPItemPosition *
const left;
3749 QCPItemPosition *
const right;
3750 QCPItemAnchor *
const center;
3755 QPen mPen, mSelectedPen;
3760 virtual void draw(QCPPainter *painter);
3761 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3764 QPen mainPen()
const;
3767 #endif // QCUSTOMPLOT_H double whiskerWidth() const
Definition: qcustomplot.h:2945
ColorInterpolation
Definition: qcustomplot.h:1909
int iconTextPadding() const
Definition: qcustomplot.h:2210
Definition: qcustomplot.h:2293
bool isEmpty() const
Definition: qcustomplot.h:3028
QCPLineEnding tail() const
Definition: qcustomplot.h:3338
BracketStyle
Definition: qcustomplot.h:3724
Qt::TransformationMode transformationMode() const
Definition: qcustomplot.h:3589
int columnSpacing() const
Definition: qcustomplot.h:777
QColor selectedTickLabelColor() const
Definition: qcustomplot.h:1136
0x0001 Axis base line and tick marks
Definition: qcustomplot.h:118
bool visible() const
Definition: qcustomplot.h:423
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:424
QMapIterator< double, QCPBarData > QCPBarDataMapIterator
Definition: qcustomplot.h:2819
bool autoSubTicks() const
Definition: qcustomplot.h:1102
Definition: qcustomplot.h:1540
EndingStyle
Definition: qcustomplot.h:888
QCP::AntialiasedElements antialiasedElements() const
Definition: qcustomplot.h:1724
0x0100 Error bars
Definition: qcustomplot.h:126
0x00 no margin
Definition: qcustomplot.h:105
QVector< double > tickVector() const
Definition: qcustomplot.h:1116
Definition: qcustomplot.h:1367
QPen selectedPen() const
Definition: qcustomplot.h:3735
QList< double > rowStretchFactors() const
Definition: qcustomplot.h:776
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:1989
int top() const
Definition: qcustomplot.h:2027
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts) ...
Definition: qcustomplot.h:160
double median() const
Definition: qcustomplot.h:2940
QCPBars * barAbove() const
Definition: qcustomplot.h:2856
QSize maximumSize() const
Definition: qcustomplot.h:663
virtual int calculateAutoMargin(QCP::MarginSide side)
QFont labelFont() const
Definition: qcustomplot.h:1126
Definition: qcustomplot.h:719
QCPGraph * channelFillGraph() const
Definition: qcustomplot.h:2539
double graphKey() const
Definition: qcustomplot.h:3673
QCPColorGradient gradient() const
Definition: qcustomplot.h:3067
bool inverted() const
Definition: qcustomplot.h:907
QPixmap pixmap() const
Definition: qcustomplot.h:3586
Whether to use immediate repaint or queued update depends on whether the plotting hint QCP::phForceRe...
Definition: qcustomplot.h:1712
PainterModes modes() const
Definition: qcustomplot.h:334
Qt::Alignment positionAlignment() const
Definition: qcustomplot.h:3453
QMapIterator< double, QCPData > QCPDataMapIterator
Definition: qcustomplot.h:2486
QBrush selectedBrush() const
Definition: qcustomplot.h:3449
double maximum() const
Definition: qcustomplot.h:2942
QMap< double, QCPBarData > QCPBarDataMap
Definition: qcustomplot.h:2818
QPen selectedTickPen() const
Definition: qcustomplot.h:1139
bool antialiasedFill() const
Definition: qcustomplot.h:1410
bool clipToAxisRect() const
Definition: qcustomplot.h:1621
0xFF all margins
Definition: qcustomplot.h:104
ScaleType scaleType() const
Definition: qcustomplot.h:1094
QCP::MarginSides autoMargins() const
Definition: qcustomplot.h:661
QPen selectedPen() const
Definition: qcustomplot.h:3291
0x0200 Borders of fills (e.g. under or between graphs)
Definition: qcustomplot.h:127
QString text() const
Definition: qcustomplot.h:3452
QRect axisSelectionBox() const
Definition: qcustomplot.h:1331
bool subGridVisible() const
Definition: qcustomplot.h:945
bool backgroundScaled() const
Definition: qcustomplot.h:1988
bool antialiasing() const
Definition: qcustomplot.h:333
QPen selectedPen() const
Definition: qcustomplot.h:3667
LineStyle
Definition: qcustomplot.h:2509
AnchorIndex
Definition: qcustomplot.h:3612
QFont selectedTickLabelFont() const
Definition: qcustomplot.h:1134
QFont font() const
Definition: qcustomplot.h:3450
double rotation() const
Definition: qcustomplot.h:3455
0x08 bottom margin
Definition: qcustomplot.h:103
double width() const
Definition: qcustomplot.h:2851
QCPAxis * valueAxis() const
Definition: qcustomplot.h:1418
bool antialiasedSubGrid() const
Definition: qcustomplot.h:946
QPen basePen() const
Definition: qcustomplot.h:1123
Definition: qcustomplot.h:93
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: qcustomplot.h:700
QPen pen() const
Definition: qcustomplot.h:1413
Qt::Alignment textAlignment() const
Definition: qcustomplot.h:3454
QColor selectedTextColor() const
Definition: qcustomplot.h:2101
QList< QCPItemAnchor * > anchors() const
Definition: qcustomplot.h:1637
QPen errorPen() const
Definition: qcustomplot.h:2536
int index() const
Definition: qcustomplot.h:382
QCPScatterStyle outlierStyle() const
Definition: qcustomplot.h:2949
bool contains(QCPBars *bars) const
Definition: qcustomplot.h:2775
ScatterShape shape() const
Definition: qcustomplot.h:276
0x04 top margin
Definition: qcustomplot.h:102
const QCPRange operator+(const QCPRange &range, double value)
Definition: qcustomplot.h:542
QCPBarsGroup * barsGroup() const
Definition: qcustomplot.h:2853
InsetPlacement
Definition: qcustomplot.h:830
QCPLayerable * parentLayerable() const
Definition: qcustomplot.h:425
QPen selectedPen() const
Definition: qcustomplot.h:1414
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:2534
QColor selectedColor() const
Definition: qcustomplot.h:3445
SpacingType spacingType() const
Definition: qcustomplot.h:2762
QColor labelColor() const
Definition: qcustomplot.h:1127
bool tightBoundary() const
Definition: qcustomplot.h:3066
Definition: qcustomplot.h:2362
QPen pen() const
Definition: qcustomplot.h:3381
QPen whiskerBarPen() const
Definition: qcustomplot.h:2947
bool selectable() const
Definition: qcustomplot.h:2315
bool selected() const
Definition: qcustomplot.h:2103
0x0000 No elements
Definition: qcustomplot.h:130
QPen subGridPen() const
Definition: qcustomplot.h:949
Definition: qcustomplot.h:234
QPainterPath customPath() const
Definition: qcustomplot.h:280
ColorInterpolation colorInterpolation() const
Definition: qcustomplot.h:1940
QMutableMapIterator< double, QCPFinancialData > QCPFinancialDataMutableMapIterator
Definition: qcustomplot.h:3142
QRect outerRect() const
Definition: qcustomplot.h:658
bool errorBarSkipSymbol() const
Definition: qcustomplot.h:2538
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
Definition: qcustomplot.h:664
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:2407
bool selected() const
Definition: qcustomplot.h:2316
QPen selectedBorderPen() const
Definition: qcustomplot.h:2214
QVector< QString > tickVectorLabels() const
Definition: qcustomplot.h:1117
QString name() const
Definition: qcustomplot.h:1409
QString text() const
Definition: qcustomplot.h:2310
QBrush selectedBrush() const
Definition: qcustomplot.h:3530
bool backgroundScaled() const
Definition: qcustomplot.h:1721
QCPRange keyRange() const
Definition: qcustomplot.h:3008
virtual void simplify()
Definition: qcustomplot.h:853
bool ticks() const
Definition: qcustomplot.h:1103
QMap< double, QCPFinancialData > QCPFinancialDataMap
Definition: qcustomplot.h:3140
bool autoTicks() const
Definition: qcustomplot.h:1098
QVector< double > outliers() const
Definition: qcustomplot.h:2943
double upper
Definition: qcustomplot.h:479
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
Definition: qcustomplot.h:665
RefreshPriority
Definition: qcustomplot.h:1710
QCPGraph * graph() const
Definition: qcustomplot.h:3672
QCPItemAnchor * parentAnchorX() const
Definition: qcustomplot.h:1567
QBrush selectedBrush() const
Definition: qcustomplot.h:3669
bool visible() const
Definition: qcustomplot.h:384
AxisType axisType() const
Definition: qcustomplot.h:1092
QCPLayer * layer() const
Definition: qcustomplot.h:426
SignDomain
Definition: qcustomplot.h:1455
QCPItemAnchor * parentAnchorY() const
Definition: qcustomplot.h:1568
double lower
Definition: qcustomplot.h:479
int subTickCount() const
Definition: qcustomplot.h:1120
Definition: qcustomplot.h:365
QPoint bottomRight() const
Definition: qcustomplot.h:2035
0x000 No hints are set
Definition: qcustomplot.h:139
QPen whiskerPen() const
Definition: qcustomplot.h:2946
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
Definition: qcustomplot.h:157
QPen selectedPen() const
Definition: qcustomplot.h:3447
QPen pen() const
Definition: qcustomplot.h:3249
0x080 All other objects are selectable (e.g. your own derived layerables, the plot title...
Definition: qcustomplot.h:162
QRect viewport() const
Definition: qcustomplot.h:1719
QFont selectedFont() const
Definition: qcustomplot.h:2217
The positive sign domain, i.e. numbers greater than zero.
Definition: qcustomplot.h:193
void drawLine(const QPointF &p1, const QPointF &p2)
Definition: qcustomplot.h:347
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Definition: qcustomplot.h:706
double lowerQuartile() const
Definition: qcustomplot.h:2939
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:1524
0x0020 Main lines of plottables (excluding error bars, see element aeErrorBars)
Definition: qcustomplot.h:123
double value() const
Definition: qcustomplot.h:1570
#define QCP_LIB_DECL
Definition: qcustomplot.h:87
virtual void draw(QCPPainter *painter)
Definition: qcustomplot.h:707
TracerStyle style() const
Definition: qcustomplot.h:3671
int autoTickCount() const
Definition: qcustomplot.h:1099
QBrush brushPositive() const
Definition: qcustomplot.h:3176
QString label() const
Definition: qcustomplot.h:1128
double length() const
Definition: qcustomplot.h:3736
QPoint bottomLeft() const
Definition: qcustomplot.h:2034
Definition: qcustomplot.h:1321
QPen penPositive() const
Definition: qcustomplot.h:3178
ScatterShape
Definition: qcustomplot.h:246
bool selectable() const
Definition: qcustomplot.h:1419
AntialiasedElement
Definition: qcustomplot.h:118
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
Definition: qcustomplot.h:144
0x01 left margin
Definition: qcustomplot.h:100
QMutableMapIterator< double, QCPData > QCPDataMutableMapIterator
Definition: qcustomplot.h:2487
int numberPrecision() const
Definition: qcustomplot.h:1114
QCPRange dataRange() const
Definition: qcustomplot.h:3063
QCPRange & operator-=(const double &value)
Definition: qcustomplot.h:488
QPen pen() const
Definition: qcustomplot.h:3734
ErrorType errorType() const
Definition: qcustomplot.h:2535
QBrush brush() const
Definition: qcustomplot.h:278
int left() const
Definition: qcustomplot.h:2025
AnchorIndex
Definition: qcustomplot.h:3405
QPen pen() const
Definition: qcustomplot.h:3290
QPen pen() const
Definition: qcustomplot.h:3590
const QCPRange operator*(const QCPRange &range, double value)
Definition: qcustomplot.h:572
QCP::AntialiasedElements notAntialiasedElements() const
Definition: qcustomplot.h:1725
QSize size() const
Definition: qcustomplot.h:2031
Definition: qcustomplot.h:1680
QCPAxis::AxisType type() const
Definition: qcustomplot.h:2405
LabelSide
Definition: qcustomplot.h:1064
QFont selectedFont() const
Definition: qcustomplot.h:2313
QCPDataMap * data() const
Definition: qcustomplot.h:2532
QSize iconSize() const
Definition: qcustomplot.h:2209
QBrush brush() const
Definition: qcustomplot.h:3529
Qt::AspectRatioMode aspectRatioMode() const
Definition: qcustomplot.h:3588
QCPGrid * grid() const
Definition: qcustomplot.h:1143
QMapIterator< double, QCPCurveData > QCPCurveDataMapIterator
Definition: qcustomplot.h:2656
virtual void update(UpdatePhase phase)
double width() const
Definition: qcustomplot.h:905
QString name() const
Definition: qcustomplot.h:381
QString dateTimeFormat() const
Definition: qcustomplot.h:1111
QCPRange dataRange() const
Definition: qcustomplot.h:2406
bool selectable() const
Definition: qcustomplot.h:1623
QRect rect() const
Definition: qcustomplot.h:657
QPen selectedSubTickPen() const
Definition: qcustomplot.h:1140
Qt::Orientations rangeDrag() const
Definition: qcustomplot.h:1990
QMargins minimumMargins() const
Definition: qcustomplot.h:660
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Definition: qcustomplot.h:213
SelectablePart
Definition: qcustomplot.h:1080
Definition: qcustomplot.h:2169
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: qcustomplot.h:701
double key() const
Definition: qcustomplot.h:2937
QCPColorScale * colorScale() const
Definition: qcustomplot.h:3068
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
Definition: qcustomplot.h:193
Qt::Orientations rangeZoom() const
Definition: qcustomplot.h:1991
SelectableParts selectableParts() const
Definition: qcustomplot.h:1133
QCPLayoutGrid * plotLayout() const
Definition: qcustomplot.h:1723
QCPAbstractPlottable * plottable()
Definition: qcustomplot.h:2152
double errorBarSize() const
Definition: qcustomplot.h:2537
Qt::Orientation orientation() const
Definition: qcustomplot.h:1206
Definition: qcustomplot.h:312
Definition: qcustomplot.h:629
double width() const
Definition: qcustomplot.h:2944
bool isNone() const
Definition: qcustomplot.h:291
bool autoAddPlottableToLegend() const
Definition: qcustomplot.h:1726
PositionType typeY() const
Definition: qcustomplot.h:1565
QColor textColor() const
Definition: qcustomplot.h:2312
EndingStyle style() const
Definition: qcustomplot.h:904
QCPAxis * keyAxis() const
Definition: qcustomplot.h:1572
ChartStyle chartStyle() const
Definition: qcustomplot.h:3173
Definition: qcustomplot.h:1972
AnchorIndex
Definition: qcustomplot.h:3754
QPen pen() const
Definition: qcustomplot.h:3335
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Definition: qcustomplot.h:608
void rescaleKeyAxis(bool onlyEnlarge=false) const
bool adaptiveSampling() const
Definition: qcustomplot.h:2540
Both sign domains, including zero, i.e. all numbers.
Definition: qcustomplot.h:192
Definition: qcustomplot.h:2386
int keySize() const
Definition: qcustomplot.h:3006
QCPLineEnding head() const
Definition: qcustomplot.h:3292
bool operator!=(const QCPRange &other) const
Definition: qcustomplot.h:485
bool operator==(const QCPRange &other) const
Definition: qcustomplot.h:484
QCPLineEnding head() const
Definition: qcustomplot.h:3337
QPen pen() const
Definition: qcustomplot.h:3527
QList< double > columnStretchFactors() const
Definition: qcustomplot.h:775
Qt::KeyboardModifier multiSelectModifier() const
Definition: qcustomplot.h:1731
LayerInsertMode
Definition: qcustomplot.h:1700
QPen selectedPen() const
Definition: qcustomplot.h:3250
Definition: qcustomplot.h:2081
SelectableParts selectableParts() const
Definition: qcustomplot.h:2212
virtual void mouseMoveEvent(QMouseEvent *event)
QCPBars * barBelow() const
Definition: qcustomplot.h:2855
int bottom() const
Definition: qcustomplot.h:2028
QBrush selectedBrush() const
Definition: qcustomplot.h:3384
QCPRange & operator*=(const double &value)
Definition: qcustomplot.h:489
0x0010 Legend items
Definition: qcustomplot.h:122
QPen selectedPen() const
Definition: qcustomplot.h:3382
bool autoTickLabels() const
Definition: qcustomplot.h:1100
UpdatePhase
Definition: qcustomplot.h:646
QCPRange & operator/=(const double &value)
Definition: qcustomplot.h:490
QList< QCPLayerable * > children() const
Definition: qcustomplot.h:383
void rescaleValueAxis(bool onlyEnlarge=false) const
PositionType
Definition: qcustomplot.h:1549
double width() const
Definition: qcustomplot.h:3174
QCPRange & operator+=(const double &value)
Definition: qcustomplot.h:487
Definition: qcustomplot.h:2660
int rowSpacing() const
Definition: qcustomplot.h:778
0xFFFF All elements
Definition: qcustomplot.h:129
Definition: qcustomplot.h:2145
bool isPenDefined() const
Definition: qcustomplot.h:292
QList< QCPItemPosition * > positions() const
Definition: qcustomplot.h:1636
QCustomPlot * parentPlot() const
Definition: qcustomplot.h:380
AnchorIndex
Definition: qcustomplot.h:3487
bool selected() const
Definition: qcustomplot.h:1420
const QCP::Interactions interactions() const
Definition: qcustomplot.h:1727
QPen selectedPen() const
Definition: qcustomplot.h:3591
QFont font() const
Definition: qcustomplot.h:2311
WidthType widthType() const
Definition: qcustomplot.h:2852
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable) ...
Definition: qcustomplot.h:158
bool isInvalidData(double value)
Definition: qcustomplot.h:172
QPen medianPen() const
Definition: qcustomplot.h:2948
Definition: qcustomplot.h:980
QPen borderPen() const
Definition: qcustomplot.h:2205
TracerStyle
Definition: qcustomplot.h:3654
void rescaleAxes(bool onlyEnlarge=false) const
QMargins margins() const
Definition: qcustomplot.h:659
0x0040 Main lines of items
Definition: qcustomplot.h:124
Qt::TimeSpec dateTimeSpec() const
Definition: qcustomplot.h:1112
PositionType type() const
Definition: qcustomplot.h:1563
QMutableMapIterator< double, QCPCurveData > QCPCurveDataMutableMapIterator
Definition: qcustomplot.h:2657
QRect tickLabelsSelectionBox() const
Definition: qcustomplot.h:1332
QPixmap background() const
Definition: qcustomplot.h:1987
ErrorType
Definition: qcustomplot.h:2521
SelectableParts selectedParts() const
Definition: qcustomplot.h:1132
QCPLegend * parentLegend() const
Definition: qcustomplot.h:2097
PositionType typeX() const
Definition: qcustomplot.h:1564
GradientPreset
Definition: qcustomplot.h:1918
QCPAxis * keyAxis() const
Definition: qcustomplot.h:1417
double length() const
Definition: qcustomplot.h:906
QPen pen() const
Definition: qcustomplot.h:3666
int size() const
Definition: qcustomplot.h:2772
QPen pen() const
Definition: qcustomplot.h:277
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
Definition: qcustomplot.h:128
bool interpolating() const
Definition: qcustomplot.h:3674
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
Definition: qcustomplot.h:159
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
Definition: qcustomplot.h:155
LabelType
Definition: qcustomplot.h:1055
virtual void mouseReleaseEvent(QMouseEvent *event)
QFont selectedFont() const
Definition: qcustomplot.h:2100
0x0008 Legend box
Definition: qcustomplot.h:121
QList< QCPBars * > bars() const
Definition: qcustomplot.h:2770
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
QRect labelSelectionBox() const
Definition: qcustomplot.h:1333
AnchorIndex
Definition: qcustomplot.h:3554
bool antialiasedZeroLine() const
Definition: qcustomplot.h:947
QFont selectedLabelFont() const
Definition: qcustomplot.h:1135
QPen pen() const
Definition: qcustomplot.h:948
double tickStep() const
Definition: qcustomplot.h:1115
bool interpolate() const
Definition: qcustomplot.h:3065
QMapIterator< double, QCPFinancialData > QCPFinancialDataMapIterator
Definition: qcustomplot.h:3141
Definition: qcustomplot.h:1607
virtual void wheelEvent(QWheelEvent *event)
WidthType
Definition: qcustomplot.h:2841
QCPFinancialDataMap * data() const
Definition: qcustomplot.h:3172
0x0002 Grid lines
Definition: qcustomplot.h:119
QBrush brush() const
Definition: qcustomplot.h:3448
QPoint topLeft() const
Definition: qcustomplot.h:2032
QCPCurveDataMap * data() const
Definition: qcustomplot.h:2680
Definition: qcustomplot.h:140
bool selectable() const
Definition: qcustomplot.h:2102
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap) ...
Definition: qcustomplot.h:125
QCPColorGradient gradient() const
Definition: qcustomplot.h:2408
int width() const
Definition: qcustomplot.h:2029
double minimum() const
Definition: qcustomplot.h:2938
0x0004 Sub grid lines
Definition: qcustomplot.h:120
bool operator!=(const QCPColorGradient &other) const
Definition: qcustomplot.h:1935
LineStyle lineStyle() const
Definition: qcustomplot.h:2533
QCPAxisRect * axisRect() const
Definition: qcustomplot.h:1093
QCPItemAnchor * parentAnchor() const
Definition: qcustomplot.h:1566
BracketStyle style() const
Definition: qcustomplot.h:3737
bool scaled() const
Definition: qcustomplot.h:3587
bool noAntialiasingOnDrag() const
Definition: qcustomplot.h:1729
Qt::AspectRatioMode backgroundScaledMode() const
Definition: qcustomplot.h:1722
virtual QCPItemPosition * toQCPItemPosition()
Definition: qcustomplot.h:1599
QString name() const
Definition: qcustomplot.h:1510
QCPScatterStyle scatterStyle() const
Definition: qcustomplot.h:2681
double key() const
Definition: qcustomplot.h:1569
QPen selectedBasePen() const
Definition: qcustomplot.h:1138
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem) ...
Definition: qcustomplot.h:161
QPen zeroLinePen() const
Definition: qcustomplot.h:950
QMap< double, QCPCurveData > QCPCurveDataMap
Definition: qcustomplot.h:2655
QCPBarDataMap * data() const
Definition: qcustomplot.h:2857
double baseValue() const
Definition: qcustomplot.h:2854
virtual void mousePressEvent(QMouseEvent *event)
Definition: qcustomplot.h:699
int padding() const
Definition: qcustomplot.h:1130
QPen iconBorderPen() const
Definition: qcustomplot.h:2211
Definition: qcustomplot.h:2823
QColor textColor() const
Definition: qcustomplot.h:2099
AxisType
Definition: qcustomplot.h:1042
QFont tickLabelFont() const
Definition: qcustomplot.h:1107
QPen selectedIconBorderPen() const
Definition: qcustomplot.h:2215
QCPLayout * layout() const
Definition: qcustomplot.h:656
QCPLineEnding tail() const
Definition: qcustomplot.h:3293
QColor selectedTextColor() const
Definition: qcustomplot.h:2218
QPixmap background() const
Definition: qcustomplot.h:1720
int levelCount() const
Definition: qcustomplot.h:1938
QBrush brush() const
Definition: qcustomplot.h:1415
int valueSize() const
Definition: qcustomplot.h:3007
QPointF coords() const
Definition: qcustomplot.h:1571
QCPRange valueRange() const
Definition: qcustomplot.h:3009
QCP::PlottingHints plottingHints() const
Definition: qcustomplot.h:1730
virtual void mousePressEvent(QMouseEvent *event)
Definition: qcustomplot.h:408
QColor selectedTextColor() const
Definition: qcustomplot.h:2314
QMutableMapIterator< double, QCPBarData > QCPBarDataMutableMapIterator
Definition: qcustomplot.h:2820
QBrush brush() const
Definition: qcustomplot.h:2206
QColor color() const
Definition: qcustomplot.h:3444
SelectablePart
Definition: qcustomplot.h:2194
QPen selectedPen() const
Definition: qcustomplot.h:3336
QPoint topRight() const
Definition: qcustomplot.h:2033
ScaleType
Definition: qcustomplot.h:1072
bool antialiasedScatters() const
Definition: qcustomplot.h:1411
bool twoColored() const
Definition: qcustomplot.h:3175
QPen selectedPen() const
Definition: qcustomplot.h:3528
bool selected() const
Definition: qcustomplot.h:1624
QBrush selectedBrush() const
Definition: qcustomplot.h:2216
QPen tickPen() const
Definition: qcustomplot.h:1124
QFont font() const
Definition: qcustomplot.h:2098
Definition: qcustomplot.h:2490
int selectionTolerance() const
Definition: qcustomplot.h:1728
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Definition: qcustomplot.h:702
int barWidth() const
Definition: qcustomplot.h:2410
QCPAxis * valueAxis() const
Definition: qcustomplot.h:1573
0x02 right margin
Definition: qcustomplot.h:101
The negative sign domain, i.e. numbers smaller than zero.
Definition: qcustomplot.h:191
const QCPRange operator/(const QCPRange &range, double value)
Definition: qcustomplot.h:592
bool autoTickStep() const
Definition: qcustomplot.h:1101
QCPLayoutInset * insetLayout() const
Definition: qcustomplot.h:2017
int height() const
Definition: qcustomplot.h:2030
QColor selectedLabelColor() const
Definition: qcustomplot.h:1137
QSize minimumSize() const
Definition: qcustomplot.h:662
Definition: qcustomplot.h:1388
QBrush brush() const
Definition: qcustomplot.h:3668
QPen penNegative() const
Definition: qcustomplot.h:3179
SpacingType
Definition: qcustomplot.h:2754
QCPAxis * axis() const
Definition: qcustomplot.h:2404
bool tickLabels() const
Definition: qcustomplot.h:1104
bool antialiased() const
Definition: qcustomplot.h:427
ChartStyle
Definition: qcustomplot.h:3163
PainterMode
Definition: qcustomplot.h:320
QColor textColor() const
Definition: qcustomplot.h:2208
static Qt::Orientation orientation(AxisType type)
Definition: qcustomplot.h:1219
int right() const
Definition: qcustomplot.h:2026
QPoint center() const
Definition: qcustomplot.h:2036
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
Definition: qcustomplot.h:156
LineStyle lineStyle() const
Definition: qcustomplot.h:2682
Definition: qcustomplot.h:1362
PlottingHint
Definition: qcustomplot.h:139
MarginSide
Definition: qcustomplot.h:100
QCPAxis::ScaleType dataScaleType() const
Definition: qcustomplot.h:3064
QMargins padding() const
Definition: qcustomplot.h:3456
QPen pen() const
Definition: qcustomplot.h:3446
Definition: qcustomplot.h:3145
Definition: qcustomplot.h:142
bool antialiasedErrorBars() const
Definition: qcustomplot.h:1412
QPixmap pixmap() const
Definition: qcustomplot.h:279
bool periodic() const
Definition: qcustomplot.h:1941
Definition: qcustomplot.h:3046
QBrush brushNegative() const
Definition: qcustomplot.h:3177
const QCPRange operator-(const QCPRange &range, double value)
Definition: qcustomplot.h:562
QCPColorMapData * data() const
Definition: qcustomplot.h:3062
QBrush selectedBrush() const
Definition: qcustomplot.h:1416
QMap< double, QCPData > QCPDataMap
Definition: qcustomplot.h:2485
bool rangeReversed() const
Definition: qcustomplot.h:1097
double upperQuartile() const
Definition: qcustomplot.h:2941
double spacing() const
Definition: qcustomplot.h:2763
QBrush brush() const
Definition: qcustomplot.h:3383
double size() const
Definition: qcustomplot.h:275
virtual void wheelEvent(QWheelEvent *event)
Definition: qcustomplot.h:703
LineStyle
Definition: qcustomplot.h:2673
QFont font() const
Definition: qcustomplot.h:2207
LabelType tickLabelType() const
Definition: qcustomplot.h:1106
QMap< double, QColor > colorStops() const
Definition: qcustomplot.h:1939
const QCPRange range() const
Definition: qcustomplot.h:1096
QColor tickLabelColor() const
Definition: qcustomplot.h:1108
QCPRange dataBounds() const
Definition: qcustomplot.h:3010
QPen subTickPen() const
Definition: qcustomplot.h:1125
QFont selectedFont() const
Definition: qcustomplot.h:3451
double size() const
Definition: qcustomplot.h:3670
double scaleLogBase() const
Definition: qcustomplot.h:1095
Interaction
Definition: qcustomplot.h:155
bool isEmpty() const
Definition: qcustomplot.h:2773