48#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
51# include <QPrintEngine>
54# include <QtPrintSupport>
81#if defined(QCUSTOMPLOT_COMPILE_LIBRARY)
82# define QCP_LIB_DECL Q_DECL_EXPORT
83#elif defined(QCUSTOMPLOT_USE_LIBRARY)
84# define QCP_LIB_DECL Q_DECL_IMPORT
173 return qIsNaN(value) || qIsInf(value);
198 case QCP::msTop: margins.setTop(value);
break;
200 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
227Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
228Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
229Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
230Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
268 QCPScatterStyle(ScatterShape shape,
const QColor &color,
const QColor &fill,
double size);
269 QCPScatterStyle(ScatterShape shape,
const QPen &pen,
const QBrush &brush,
double size);
271 QCPScatterStyle(
const QPainterPath &customPath,
const QPen &pen,
const QBrush &brush=Qt::NoBrush,
double size=6);
274 double size()
const {
return mSize; }
276 QPen
pen()
const {
return mPen; }
277 QBrush
brush()
const {
return mBrush; }
278 QPixmap
pixmap()
const {
return mPixmap; }
282 void setSize(
double size);
283 void setShape(ScatterShape shape);
284 void setPen(
const QPen &pen);
285 void setBrush(
const QBrush &brush);
286 void setPixmap(
const QPixmap &pixmap);
287 void setCustomPath(
const QPainterPath &customPath);
290 bool isNone()
const {
return mShape == ssNone; }
292 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
293 void drawShape(
QCPPainter *painter, QPointF pos)
const;
294 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
322 ,pmNonCosmetic = 0x04
324 Q_FLAGS(PainterMode PainterModes)
325 Q_DECLARE_FLAGS(PainterModes, PainterMode)
332 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
333 PainterModes
modes()
const {
return mModes; }
336 void setAntialiasing(
bool enabled);
337 void setMode(PainterMode mode,
bool enabled=
true);
338 void setModes(PainterModes modes);
341 bool begin(QPaintDevice *device);
342 void setPen(
const QPen &pen);
343 void setPen(
const QColor &color);
344 void setPen(Qt::PenStyle penStyle);
345 void drawLine(
const QLineF &line);
351 void makeNonCosmetic();
361Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
368 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
369 Q_PROPERTY(QString name READ name)
370 Q_PROPERTY(
int index READ index)
371 Q_PROPERTY(QList<QCPLayerable*> children READ children)
372 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
380 QString
name()
const {
return mName; }
381 int index()
const {
return mIndex; }
382 QList<QCPLayerable*>
children()
const {
return mChildren; }
386 void setVisible(
bool visible);
411 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
412 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
413 Q_PROPERTY(
QCPLayerable* parentLayerable READ parentLayerable)
414 Q_PROPERTY(
QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged)
415 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
429 void setVisible(
bool on);
430 Q_SLOT
bool setLayer(
QCPLayer *layer);
431 bool setLayer(
const QString &layerName);
432 void setAntialiased(
bool enabled);
435 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
438 bool realVisibility()
const;
452 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
454 virtual QRect clipRect()
const;
458 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
459 virtual void deselectEvent(
bool *selectionStateChanged);
462 void initializeParentPlot(
QCustomPlot *parentPlot);
464 bool moveToLayer(
QCPLayer *layer,
bool prepend);
481 QCPRange(
double lower,
double upper);
498 double center()
const;
500 void expand(
const QCPRange &otherRange);
502 QCPRange sanitizedForLogScale()
const;
503 QCPRange sanitizedForLinScale()
const;
504 bool contains(
double value)
const;
506 static bool validRange(
double lower,
double upper);
507 static bool validRange(
const QCPRange &range);
608 bool isEmpty()
const;
614 QHash<QCP::MarginSide, QList<QCPLayoutElement*> >
mChildren;
632 Q_PROPERTY(
QCPLayout* layout READ layout)
633 Q_PROPERTY(QRect rect READ rect)
634 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
635 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
636 Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
637 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
638 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
656 QRect
rect()
const {
return mRect; }
664 QHash<QCP::MarginSide, QCPMarginGroup*>
marginGroups()
const {
return mMarginGroups; }
667 void setOuterRect(
const QRect &rect);
668 void setMargins(
const QMargins &margins);
669 void setMinimumMargins(
const QMargins &margins);
670 void setAutoMargins(QCP::MarginSides sides);
671 void setMinimumSize(
const QSize &size);
672 void setMinimumSize(
int width,
int height);
673 void setMaximumSize(
const QSize &size);
674 void setMaximumSize(
int width,
int height);
675 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
678 virtual void update(UpdatePhase phase);
679 virtual QSize minimumSizeHint()
const;
680 virtual QSize maximumSizeHint()
const;
681 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
684 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
702 virtual void wheelEvent(QWheelEvent *event) {Q_UNUSED(event)}
707 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
726 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
733 virtual void simplify();
736 bool removeAt(
int index);
742 virtual void updateLayout();
745 void sizeConstraintsChanged()
const;
748 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
const;
760 Q_PROPERTY(
int rowCount READ rowCount)
761 Q_PROPERTY(
int columnCount READ columnCount)
762 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
763 Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
764 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
765 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
772 int rowCount()
const;
773 int columnCount()
const;
780 void setColumnStretchFactor(
int column,
double factor);
781 void setColumnStretchFactors(
const QList<double> &factors);
782 void setRowStretchFactor(
int row,
double factor);
783 void setRowStretchFactors(
const QList<double> &factors);
784 void setColumnSpacing(
int pixels);
785 void setRowSpacing(
int pixels);
788 virtual void updateLayout();
789 virtual int elementCount()
const;
793 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
794 virtual void simplify();
795 virtual QSize minimumSizeHint()
const;
796 virtual QSize maximumSizeHint()
const;
801 bool hasElement(
int row,
int column);
802 void expandTo(
int newRowCount,
int newColumnCount);
803 void insertRow(
int newIndex);
804 void insertColumn(
int newIndex);
814 void getMinimumRowColSizes(QVector<int> *minColWidths, QVector<int> *minRowHeights)
const;
815 void getMaximumRowColSizes(QVector<int> *maxColWidths, QVector<int> *maxRowHeights)
const;
837 InsetPlacement insetPlacement(
int index)
const;
838 Qt::Alignment insetAlignment(
int index)
const;
839 QRectF insetRect(
int index)
const;
842 void setInsetPlacement(
int index, InsetPlacement placement);
843 void setInsetAlignment(
int index, Qt::Alignment alignment);
844 void setInsetRect(
int index,
const QRectF &rect);
847 virtual void updateLayout();
848 virtual int elementCount()
const;
853 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
900 QCPLineEnding(EndingStyle style,
double width=8,
double length=10,
bool inverted=
false);
904 double width()
const {
return mWidth; }
905 double length()
const {
return mLength; }
909 void setStyle(EndingStyle style);
910 void setWidth(
double width);
911 void setLength(
double length);
912 void setInverted(
bool inverted);
915 double boundingDistance()
const;
916 double realLength()
const;
917 void draw(
QCPPainter *painter,
const QVector2D &pos,
const QVector2D &dir)
const;
918 void draw(
QCPPainter *painter,
const QVector2D &pos,
double angle)
const;
933 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
934 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
935 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
936 Q_PROPERTY(QPen pen READ pen WRITE setPen)
937 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
938 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
947 QPen
pen()
const {
return mPen; }
952 void setSubGridVisible(
bool visible);
953 void setAntialiasedSubGrid(
bool enabled);
954 void setAntialiasedZeroLine(
bool enabled);
955 void setPen(
const QPen &pen);
956 void setSubGridPen(
const QPen &pen);
957 void setZeroLinePen(
const QPen &pen);
963 QPen
mPen, mSubGridPen, mZeroLinePen;
968 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
972 void drawGridLines(
QCPPainter *painter)
const;
973 void drawSubGridLines(
QCPPainter *painter)
const;
983 Q_PROPERTY(
AxisType axisType READ axisType)
985 Q_PROPERTY(
ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
986 Q_PROPERTY(
double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
987 Q_PROPERTY(
QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
988 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
989 Q_PROPERTY(
bool autoTicks READ autoTicks WRITE setAutoTicks)
990 Q_PROPERTY(
int autoTickCount READ autoTickCount WRITE setAutoTickCount)
991 Q_PROPERTY(
bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
992 Q_PROPERTY(
bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
993 Q_PROPERTY(
bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
994 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
995 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
996 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
997 Q_PROPERTY(
LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
998 Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
999 Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1000 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
1001 Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
1002 Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec)
1003 Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
1004 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1005 Q_PROPERTY(
double tickStep READ tickStep WRITE setTickStep)
1006 Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
1007 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels)
1008 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1009 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1010 Q_PROPERTY(
int subTickCount READ subTickCount WRITE setSubTickCount)
1011 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1012 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1013 Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
1014 Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
1015 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
1016 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
1017 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
1018 Q_PROPERTY(QString label READ label WRITE setLabel)
1019 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
1020 Q_PROPERTY(
int padding READ padding WRITE setPadding)
1022 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
1023 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
1024 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
1025 Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1026 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
1027 Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
1028 Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1029 Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1030 Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
1031 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1032 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1033 Q_PROPERTY(
QCPGrid* grid READ grid)
1045 Q_FLAGS(AxisType AxisTypes)
1046 Q_DECLARE_FLAGS(AxisTypes, AxisType)
1071 ,spTickLabels = 0x002
1072 ,spAxisLabel = 0x004
1074 Q_FLAGS(SelectablePart SelectableParts)
1075 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
1094 int tickLabelPadding()
const;
1098 double tickLabelRotation()
const;
1101 QString numberFormat()
const;
1106 int tickLengthIn()
const;
1107 int tickLengthOut()
const;
1109 int subTickLengthIn()
const;
1110 int subTickLengthOut()
const;
1116 QString
label()
const {
return mLabel; }
1117 int labelPadding()
const;
1135 void setScaleLogBase(
double base);
1136 Q_SLOT
void setRange(
const QCPRange &range);
1137 void setRange(
double lower,
double upper);
1138 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
1139 void setRangeLower(
double lower);
1140 void setRangeUpper(
double upper);
1141 void setRangeReversed(
bool reversed);
1142 void setAutoTicks(
bool on);
1143 void setAutoTickCount(
int approximateCount);
1144 void setAutoTickLabels(
bool on);
1145 void setAutoTickStep(
bool on);
1146 void setAutoSubTicks(
bool on);
1147 void setTicks(
bool show);
1148 void setTickLabels(
bool show);
1149 void setTickLabelPadding(
int padding);
1150 void setTickLabelType(LabelType type);
1151 void setTickLabelFont(
const QFont &font);
1152 void setTickLabelColor(
const QColor &color);
1153 void setTickLabelRotation(
double degrees);
1154 void setDateTimeFormat(
const QString &format);
1155 void setDateTimeSpec(
const Qt::TimeSpec &timeSpec);
1156 void setNumberFormat(
const QString &formatCode);
1157 void setNumberPrecision(
int precision);
1158 void setTickStep(
double step);
1159 void setTickVector(
const QVector<double> &vec);
1160 void setTickVectorLabels(
const QVector<QString> &vec);
1161 void setTickLength(
int inside,
int outside=0);
1162 void setTickLengthIn(
int inside);
1163 void setTickLengthOut(
int outside);
1164 void setSubTickCount(
int count);
1165 void setSubTickLength(
int inside,
int outside=0);
1166 void setSubTickLengthIn(
int inside);
1167 void setSubTickLengthOut(
int outside);
1168 void setBasePen(
const QPen &pen);
1169 void setTickPen(
const QPen &pen);
1170 void setSubTickPen(
const QPen &pen);
1171 void setLabelFont(
const QFont &font);
1172 void setLabelColor(
const QColor &color);
1173 void setLabel(
const QString &str);
1174 void setLabelPadding(
int padding);
1175 void setPadding(
int padding);
1176 void setOffset(
int offset);
1177 void setSelectedTickLabelFont(
const QFont &font);
1178 void setSelectedLabelFont(
const QFont &font);
1179 void setSelectedTickLabelColor(
const QColor &color);
1180 void setSelectedLabelColor(
const QColor &color);
1181 void setSelectedBasePen(
const QPen &pen);
1182 void setSelectedTickPen(
const QPen &pen);
1183 void setSelectedSubTickPen(
const QPen &pen);
1184 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
1185 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
1190 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
1194 void moveRange(
double diff);
1195 void scaleRange(
double factor,
double center);
1196 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
1197 void rescale(
bool onlyVisiblePlottables=
false);
1198 double pixelToCoord(
double value)
const;
1199 double coordToPixel(
double value)
const;
1200 SelectablePart getPartAt(
const QPointF &pos)
const;
1201 QList<QCPAbstractPlottable*> plottables()
const;
1202 QList<QCPGraph*> graphs()
const;
1203 QList<QCPAbstractItem*> items()
const;
1206 static Qt::Orientation
orientation(
AxisType type) {
return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
1207 static AxisType opposite(AxisType type);
1271 virtual void setupTickVectors();
1272 virtual void generateAutoTicks();
1273 virtual int calculateAutoSubTickCount(
double tickStep)
const;
1274 virtual int calculateMargin();
1277 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1281 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1282 virtual void deselectEvent(
bool *selectionStateChanged);
1285 void visibleTickBounds(
int &lowIndex,
int &highIndex)
const;
1286 double baseLog(
double value)
const;
1287 double basePow(
double value)
const;
1288 QPen getBasePen()
const;
1289 QPen getTickPen()
const;
1290 QPen getSubTickPen()
const;
1291 QFont getTickLabelFont()
const;
1292 QFont getLabelFont()
const;
1293 QColor getTickLabelColor()
const;
1294 QColor getLabelColor()
const;
1303Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::SelectableParts)
1304Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::AxisTypes)
1315 virtual int size()
const;
1364 virtual QByteArray generateLabelParameterHash()
const;
1366 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
1368 virtual TickLabelData getTickLabelData(
const QFont &font,
const QString &text)
const;
1369 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
1370 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
1378 Q_PROPERTY(QString name READ name WRITE setName)
1379 Q_PROPERTY(
bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
1380 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters)
1381 Q_PROPERTY(
bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars)
1382 Q_PROPERTY(QPen pen READ pen WRITE setPen)
1383 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
1384 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
1385 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
1386 Q_PROPERTY(
QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis)
1387 Q_PROPERTY(
QCPAxis* valueAxis READ valueAxis WRITE setValueAxis)
1388 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1389 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1395 QString
name()
const {
return mName; }
1399 QPen
pen()
const {
return mPen; }
1409 void setName(
const QString &name);
1410 void setAntialiasedFill(
bool enabled);
1411 void setAntialiasedScatters(
bool enabled);
1412 void setAntialiasedErrorBars(
bool enabled);
1413 void setPen(
const QPen &pen);
1414 void setSelectedPen(
const QPen &pen);
1415 void setBrush(
const QBrush &brush);
1416 void setSelectedBrush(
const QBrush &brush);
1417 void setKeyAxis(
QCPAxis *axis);
1418 void setValueAxis(
QCPAxis *axis);
1419 Q_SLOT
void setSelectable(
bool selectable);
1420 Q_SLOT
void setSelected(
bool selected);
1424 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1425 virtual bool addToLegend();
1426 virtual bool removeFromLegend()
const;
1429 void rescaleAxes(
bool onlyEnlarge=
false)
const;
1430 void rescaleKeyAxis(
bool onlyEnlarge=
false)
const;
1431 void rescaleValueAxis(
bool onlyEnlarge=
false)
const;
1455 virtual QRect clipRect()
const;
1458 void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1460 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1461 virtual void deselectEvent(
bool *selectionStateChanged);
1469 void coordsToPixels(
double key,
double value,
double &
x,
double &
y)
const;
1470 const QPointF coordsToPixels(
double key,
double value)
const;
1471 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
1472 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
1473 QPen mainPen()
const;
1474 QBrush mainBrush()
const;
1475 void applyFillAntialiasingHint(
QCPPainter *painter)
const;
1476 void applyScattersAntialiasingHint(
QCPPainter *painter)
const;
1477 void applyErrorBarsAntialiasingHint(
QCPPainter *painter)
const;
1478 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1496 QString
name()
const {
return mName; }
1497 virtual QPointF pixelPoint()
const;
1549 double key()
const {
return mKey; }
1551 QPointF
coords()
const {
return QPointF(mKey, mValue); }
1555 virtual QPointF pixelPoint()
const;
1558 void setType(PositionType type);
1559 bool setParentAnchor(
QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1560 void setCoords(
double key,
double value);
1561 void setCoords(
const QPointF &coords);
1564 void setPixelPoint(
const QPointF &pixelPoint);
1587 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
1588 Q_PROPERTY(
QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
1589 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1590 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1603 void setClipToAxisRect(
bool clip);
1605 Q_SLOT
void setSelectable(
bool selectable);
1606 Q_SLOT
void setSelected(
bool selected);
1609 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1612 QList<QCPItemPosition*>
positions()
const {
return mPositions; }
1613 QList<QCPItemAnchor*>
anchors()
const {
return mAnchors; }
1616 bool hasAnchor(
const QString &name)
const;
1632 virtual QRect clipRect()
const;
1633 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1636 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1637 virtual void deselectEvent(
bool *selectionStateChanged);
1640 virtual QPointF anchorPixelPoint(
int anchorId)
const;
1643 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1644 double rectSelectTest(
const QRectF &rect,
const QPointF &pos,
bool filledRect)
const;
1646 QCPItemAnchor *createAnchor(
const QString &name,
int anchorId);
1660 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
1661 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1662 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1663 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1665 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
1666 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
1667 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
1668 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
1679 Q_ENUMS(LayerInsertMode)
1710 void setViewport(
const QRect &rect);
1711 void setBackground(
const QPixmap &pm);
1712 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1713 void setBackground(
const QBrush &brush);
1714 void setBackgroundScaled(
bool scaled);
1715 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1716 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
1718 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
1720 void setAutoAddPlottableToLegend(
bool on);
1721 void setInteractions(
const QCP::Interactions &interactions);
1722 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
1723 void setSelectionTolerance(
int pixels);
1724 void setNoAntialiasingOnDrag(
bool enabled);
1725 void setPlottingHints(
const QCP::PlottingHints &hints);
1727 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
1735 bool removePlottable(
int index);
1736 int clearPlottables();
1737 int plottableCount()
const;
1738 QList<QCPAbstractPlottable*> selectedPlottables()
const;
1747 bool removeGraph(
int index);
1749 int graphCount()
const;
1750 QList<QCPGraph*> selectedGraphs()
const;
1757 bool removeItem(
int index);
1759 int itemCount()
const;
1760 QList<QCPAbstractItem*> selectedItems()
const;
1761 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
1765 QCPLayer *layer(
const QString &name)
const;
1768 bool setCurrentLayer(
const QString &name);
1769 bool setCurrentLayer(
QCPLayer *layer);
1770 int layerCount()
const;
1771 bool addLayer(
const QString &name,
QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove);
1773 bool moveLayer(
QCPLayer *layer,
QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
1776 int axisRectCount()
const;
1778 QList<QCPAxisRect*> axisRects()
const;
1780 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
1782 QList<QCPAxis*> selectedAxes()
const;
1783 QList<QCPLegend*> selectedLegends()
const;
1784 Q_SLOT
void deselectAll();
1786 bool savePdf(
const QString &fileName,
bool noCosmeticPen=
false,
int width=0,
int height=0,
const QString &pdfCreator=
"",
const QString &pdfTitle=
"");
1787 bool savePng(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1788 bool saveJpg(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1789 bool saveBmp(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0);
1790 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1);
1791 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
1792 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
1849 virtual QSize minimumSizeHint()
const;
1850 virtual QSize sizeHint()
const;
1851 virtual void paintEvent(QPaintEvent *event);
1852 virtual void resizeEvent(QResizeEvent *event);
1853 virtual void mouseDoubleClickEvent(QMouseEvent *event);
1854 virtual void mousePressEvent(QMouseEvent *event);
1855 virtual void mouseMoveEvent(QMouseEvent *event);
1856 virtual void mouseReleaseEvent(QMouseEvent *event);
1857 virtual void wheelEvent(QWheelEvent *event);
1861 virtual void axisRemoved(
QCPAxis *axis);
1862 virtual void legendRemoved(
QCPLegend *legend);
1865 void updateLayerIndices()
const;
1866 QCPLayerable *layerableAt(
const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=0)
const;
1888 Q_ENUMS(ColorInterpolation)
1907 Q_ENUMS(GradientPreset)
1920 void setLevelCount(
int n);
1921 void setColorStops(
const QMap<double, QColor> &colorStops);
1922 void setColorStopAt(
double position,
const QColor &color);
1923 void setColorInterpolation(ColorInterpolation interpolation);
1924 void setPeriodic(
bool enabled);
1927 void colorize(
const double *
data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
1928 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
1929 void loadPreset(GradientPreset preset);
1930 void clearColorStops();
1934 void updateColorBuffer();
1952 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1953 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1954 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1955 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
1956 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
1968 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
1969 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
1970 double rangeZoomFactor(Qt::Orientation orientation);
1973 void setBackground(
const QPixmap &pm);
1974 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1975 void setBackground(
const QBrush &brush);
1976 void setBackgroundScaled(
bool scaled);
1977 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1978 void setRangeDrag(Qt::Orientations orientations);
1979 void setRangeZoom(Qt::Orientations orientations);
1982 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
1983 void setRangeZoomFactor(
double factor);
1988 QList<QCPAxis*> axes(QCPAxis::AxisTypes types)
const;
1989 QList<QCPAxis*> axes()
const;
1991 QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
1992 bool removeAxis(
QCPAxis *axis);
1995 void setupFullAxesBox(
bool connectRanges=
false);
1996 QList<QCPAbstractPlottable*> plottables()
const;
1997 QList<QCPGraph*> graphs()
const;
1998 QList<QCPAbstractItem*> items()
const;
2001 int left()
const {
return mRect.left(); }
2002 int right()
const {
return mRect.right(); }
2003 int top()
const {
return mRect.top(); }
2004 int bottom()
const {
return mRect.bottom(); }
2005 int width()
const {
return mRect.width(); }
2006 int height()
const {
return mRect.height(); }
2007 QSize
size()
const {
return mRect.size(); }
2008 QPoint
topLeft()
const {
return mRect.topLeft(); }
2012 QPoint
center()
const {
return mRect.center(); }
2015 virtual void update(UpdatePhase phase);
2016 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
2034 QHash<QCPAxis::AxisType, QList<QCPAxis*> >
mAxes;
2037 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2041 virtual void mousePressEvent(QMouseEvent *event);
2042 virtual void mouseMoveEvent(QMouseEvent *event);
2043 virtual void mouseReleaseEvent(QMouseEvent *event);
2044 virtual void wheelEvent(QWheelEvent *event);
2061 Q_PROPERTY(
QCPLegend* parentLegend READ parentLegend)
2062 Q_PROPERTY(QFont font READ font WRITE setFont)
2063 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2064 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2065 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2066 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged)
2067 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
2074 QFont
font()
const {
return mFont; }
2082 void setFont(
const QFont &font);
2083 void setTextColor(
const QColor &color);
2084 void setSelectedFont(
const QFont &font);
2085 void setSelectedTextColor(
const QColor &color);
2086 Q_SLOT
void setSelectable(
bool selectable);
2087 Q_SLOT
void setSelected(
bool selected);
2090 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2107 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2108 virtual QRect clipRect()
const;
2111 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2112 virtual void deselectEvent(
bool *selectionStateChanged);
2136 virtual QSize minimumSizeHint()
const;
2139 QPen getIconBorderPen()
const;
2140 QColor getTextColor()
const;
2141 QFont getFont()
const;
2149 Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
2150 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2151 Q_PROPERTY(QFont font READ font WRITE setFont)
2152 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2153 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
2154 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
2155 Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
2156 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged)
2157 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged)
2158 Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
2159 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
2160 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2161 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2162 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2171 ,spLegendBox = 0x001
2174 Q_FLAGS(SelectablePart SelectableParts)
2175 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
2183 QFont
font()
const {
return mFont; }
2189 SelectableParts selectedParts()
const;
2197 void setBorderPen(
const QPen &pen);
2198 void setBrush(
const QBrush &brush);
2199 void setFont(
const QFont &font);
2200 void setTextColor(
const QColor &color);
2201 void setIconSize(
const QSize &size);
2202 void setIconSize(
int width,
int height);
2203 void setIconTextPadding(
int padding);
2204 void setIconBorderPen(
const QPen &pen);
2205 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
2206 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
2207 void setSelectedBorderPen(
const QPen &pen);
2208 void setSelectedIconBorderPen(
const QPen &pen);
2209 void setSelectedBrush(
const QBrush &brush);
2210 void setSelectedFont(
const QFont &font);
2211 void setSelectedTextColor(
const QColor &color);
2214 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2219 int itemCount()
const;
2223 bool removeItem(
int index);
2226 QList<QCPAbstractLegendItem*> selectedItems()
const;
2247 virtual void parentPlotInitialized(
QCustomPlot *parentPlot);
2249 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2252 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2253 virtual void deselectEvent(
bool *selectionStateChanged);
2256 QPen getBorderPen()
const;
2257 QBrush getBrush()
const;
2265Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPLegend::SelectableParts)
2273 Q_PROPERTY(QString text READ text WRITE setText)
2274 Q_PROPERTY(QFont font READ font WRITE setFont)
2275 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2276 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2277 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2278 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
2279 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
2286 QString
text()
const {
return mText; }
2287 QFont
font()
const {
return mFont; }
2295 void setText(
const QString &text);
2296 void setFont(
const QFont &font);
2297 void setTextColor(
const QColor &color);
2298 void setSelectedFont(
const QFont &font);
2299 void setSelectedTextColor(
const QColor &color);
2300 Q_SLOT
void setSelectable(
bool selectable);
2301 Q_SLOT
void setSelected(
bool selected);
2304 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2321 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2323 virtual QSize minimumSizeHint()
const;
2324 virtual QSize maximumSizeHint()
const;
2326 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2327 virtual void deselectEvent(
bool *selectionStateChanged);
2330 QFont mainFont()
const;
2331 QColor mainTextColor()
const;
2355 void updateGradientImage();
2356 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
2357 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
2367 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
2368 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
2369 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
2370 Q_PROPERTY(QString label READ label WRITE setLabel)
2371 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
2372 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
2373 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
2385 QString label()
const;
2387 bool rangeDrag()
const;
2388 bool rangeZoom()
const;
2392 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
2395 void setLabel(
const QString &str);
2396 void setBarWidth(
int width);
2397 void setRangeDrag(
bool enabled);
2398 void setRangeZoom(
bool enabled);
2401 QList<QCPColorMap*> colorMaps()
const;
2402 void rescaleDataRange(
bool onlyVisibleMaps);
2405 virtual void update(UpdatePhase phase);
2425 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2427 virtual void mousePressEvent(QMouseEvent *event);
2428 virtual void mouseMoveEvent(QMouseEvent *event);
2429 virtual void mouseReleaseEvent(QMouseEvent *event);
2430 virtual void wheelEvent(QWheelEvent *event);
2447 QCPData(
double key,
double value);
2470 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2471 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2472 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
2473 Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen)
2474 Q_PROPERTY(
double errorBarSize READ errorBarSize WRITE setErrorBarSize)
2475 Q_PROPERTY(
bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol)
2476 Q_PROPERTY(
QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
2477 Q_PROPERTY(
bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
2520 void setData(
const QVector<double> &key,
const QVector<double> &value);
2521 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError);
2522 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyErrorMinus,
const QVector<double> &keyErrorPlus);
2523 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueError);
2524 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueErrorMinus,
const QVector<double> &valueErrorPlus);
2525 void setDataBothError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError,
const QVector<double> &valueError);
2526 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);
2527 void setLineStyle(LineStyle ls);
2529 void setErrorType(ErrorType errorType);
2530 void setErrorPen(
const QPen &pen);
2531 void setErrorBarSize(
double size);
2532 void setErrorBarSkipSymbol(
bool enabled);
2533 void setChannelFillGraph(
QCPGraph *targetGraph);
2534 void setAdaptiveSampling(
bool enabled);
2539 void addData(
double key,
double value);
2540 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2541 void removeDataBefore(
double key);
2542 void removeDataAfter(
double key);
2543 void removeData(
double fromKey,
double toKey);
2544 void removeData(
double key);
2547 virtual void clearData();
2548 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2552 void rescaleAxes(
bool onlyEnlarge,
bool includeErrorBars)
const;
2553 void rescaleKeyAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
2554 void rescaleValueAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
2570 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2571 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2572 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2573 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain,
bool includeErrors)
const;
2574 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain,
bool includeErrors)
const;
2577 virtual void drawFill(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
2578 virtual void drawScatterPlot(
QCPPainter *painter, QVector<QCPData> *scatterData)
const;
2579 virtual void drawLinePlot(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
2580 virtual void drawImpulsePlot(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
2583 void getPreparedData(QVector<QCPData> *lineData, QVector<QCPData> *scatterData)
const;
2584 void getPlotData(QVector<QPointF> *lineData, QVector<QCPData> *scatterData)
const;
2585 void getScatterPlotData(QVector<QCPData> *scatterData)
const;
2586 void getLinePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2587 void getStepLeftPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2588 void getStepRightPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2589 void getStepCenterPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2590 void getImpulsePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2592 void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper)
const;
2593 int countDataInBounds(
const QCPDataMap::const_iterator &lower,
const QCPDataMap::const_iterator &upper,
int maxCount)
const;
2594 void addFillBasePoints(QVector<QPointF> *lineData)
const;
2595 void removeFillBasePoints(QVector<QPointF> *lineData)
const;
2596 QPointF lowerFillBasePoint(
double lowerKey)
const;
2597 QPointF upperFillBasePoint(
double upperKey)
const;
2598 const QPolygonF getChannelFillPolygon(
const QVector<QPointF> *lineData)
const;
2599 int findIndexBelowX(
const QVector<QPointF> *
data,
double x)
const;
2600 int findIndexAboveX(
const QVector<QPointF> *
data,
double x)
const;
2601 int findIndexBelowY(
const QVector<QPointF> *
data,
double y)
const;
2602 int findIndexAboveY(
const QVector<QPointF> *
data,
double y)
const;
2603 double pointDistance(
const QPointF &pixelPoint)
const;
2640 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2641 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2662 void setData(
const QVector<double> &t,
const QVector<double> &key,
const QVector<double> &value);
2663 void setData(
const QVector<double> &key,
const QVector<double> &value);
2665 void setLineStyle(LineStyle style);
2670 void addData(
double t,
double key,
double value);
2671 void addData(
double key,
double value);
2672 void addData(
const QVector<double> &ts,
const QVector<double> &keys,
const QVector<double> &values);
2673 void removeDataBefore(
double t);
2674 void removeDataAfter(
double t);
2675 void removeData(
double fromt,
double tot);
2676 void removeData(
double t);
2679 virtual void clearData();
2680 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2690 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2691 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2692 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2695 virtual void drawScatterPlot(
QCPPainter *painter,
const QVector<QPointF> *pointData)
const;
2698 void getCurveData(QVector<QPointF> *lineData)
const;
2699 double pointDistance(
const QPointF &pixelPoint)
const;
2700 QPointF outsideCoordsToPixels(
double key,
double value,
int region, QRect axisRect)
const;
2736 Q_PROPERTY(
double width READ width WRITE setWidth)
2737 Q_PROPERTY(
QCPBars* barBelow READ barBelow)
2738 Q_PROPERTY(
QCPBars* barAbove READ barAbove)
2751 void setWidth(
double width);
2753 void setData(
const QVector<double> &key,
const QVector<double> &value);
2756 void moveBelow(
QCPBars *bars);
2757 void moveAbove(
QCPBars *bars);
2760 void addData(
double key,
double value);
2761 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2762 void removeDataBefore(
double key);
2763 void removeDataAfter(
double key);
2764 void removeData(
double fromKey,
double toKey);
2765 void removeData(
double key);
2768 virtual void clearData();
2769 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2779 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2780 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2781 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2784 QPolygonF getBarPolygon(
double key,
double value)
const;
2785 double getBaseValue(
double key,
bool positive)
const;
2801 Q_PROPERTY(
double key READ key WRITE setKey)
2802 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum)
2803 Q_PROPERTY(
double lowerQuartile READ lowerQuartile WRITE setLowerQuartile)
2804 Q_PROPERTY(
double median READ median WRITE setMedian)
2805 Q_PROPERTY(
double upperQuartile READ upperQuartile WRITE setUpperQuartile)
2806 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum)
2807 Q_PROPERTY(QVector<double> outliers READ outliers WRITE setOutliers)
2808 Q_PROPERTY(
double width READ width WRITE setWidth)
2809 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
2810 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
2811 Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
2812 Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
2813 Q_PROPERTY(
QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
2819 double key()
const {
return mKey; }
2834 void setKey(
double key);
2835 void setMinimum(
double value);
2836 void setLowerQuartile(
double value);
2837 void setMedian(
double value);
2838 void setUpperQuartile(
double value);
2839 void setMaximum(
double value);
2840 void setOutliers(
const QVector<double> &values);
2841 void setData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum);
2842 void setWidth(
double width);
2843 void setWhiskerWidth(
double width);
2844 void setWhiskerPen(
const QPen &pen);
2845 void setWhiskerBarPen(
const QPen &pen);
2846 void setMedianPen(
const QPen &pen);
2850 virtual void clearData();
2851 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2856 double mKey, mMinimum, mLowerQuartile, mMedian, mUpperQuartile, mMaximum;
2864 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2865 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2866 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2869 virtual void drawQuartileBox(
QCPPainter *painter, QRectF *quartileBox=0)
const;
2870 virtual void drawMedian(
QCPPainter *painter)
const;
2871 virtual void drawWhiskers(
QCPPainter *painter)
const;
2872 virtual void drawOutliers(
QCPPainter *painter)
const;
2893 double data(
double key,
double value);
2894 double cell(
int keyIndex,
int valueIndex);
2897 void setSize(
int keySize,
int valueSize);
2898 void setKeySize(
int keySize);
2899 void setValueSize(
int valueSize);
2901 void setKeyRange(
const QCPRange &keyRange);
2902 void setValueRange(
const QCPRange &valueRange);
2903 void setData(
double key,
double value,
double z);
2904 void setCell(
int keyIndex,
int valueIndex,
double z);
2907 void recalculateDataBounds();
2909 void fill(
double z);
2911 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
2912 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
2932 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
2933 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
2934 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
2935 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
2936 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
2937 Q_PROPERTY(
QCPColorScale* colorScale READ colorScale WRITE setColorScale)
2954 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
2957 void setInterpolate(
bool enabled);
2958 void setTightBoundary(
bool enabled);
2962 void rescaleDataRange(
bool recalculateDataBounds=
false);
2963 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
2966 virtual void clearData();
2967 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2989 virtual void updateMapImage();
2993 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2994 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2995 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3006 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3007 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3014 QPen
pen()
const {
return mPen; }
3018 void setPen(
const QPen &pen);
3019 void setSelectedPen(
const QPen &pen);
3022 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3035 double distToStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QVector2D &point)
const;
3036 QLineF getRectClippedStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QRect &rect)
const;
3037 QPen mainPen()
const;
3045 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3046 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3055 QPen
pen()
const {
return mPen; }
3061 void setPen(
const QPen &pen);
3062 void setSelectedPen(
const QPen &pen);
3067 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3081 QLineF getRectClippedLine(
const QVector2D &start,
const QVector2D &end,
const QRect &rect)
const;
3082 QPen mainPen()
const;
3090 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3091 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3100 QPen
pen()
const {
return mPen; }
3106 void setPen(
const QPen &pen);
3107 void setSelectedPen(
const QPen &pen);
3112 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3128 QPen mainPen()
const;
3136 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3137 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3138 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3139 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3146 QPen
pen()
const {
return mPen; }
3152 void setPen(
const QPen &pen);
3153 void setSelectedPen(
const QPen &pen);
3154 void setBrush(
const QBrush &brush);
3155 void setSelectedBrush(
const QBrush &brush);
3158 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3178 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3181 QPen mainPen()
const;
3182 QBrush mainBrush()
const;
3190 Q_PROPERTY(QColor color READ color WRITE setColor)
3191 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
3192 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3193 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3194 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3195 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3196 Q_PROPERTY(QFont font READ font WRITE setFont)
3197 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
3198 Q_PROPERTY(QString text READ text WRITE setText)
3199 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
3200 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
3201 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
3202 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
3211 QPen
pen()
const {
return mPen; }
3215 QFont
font()
const {
return mFont; }
3217 QString
text()
const {
return mText; }
3224 void setColor(
const QColor &color);
3225 void setSelectedColor(
const QColor &color);
3226 void setPen(
const QPen &pen);
3227 void setSelectedPen(
const QPen &pen);
3228 void setBrush(
const QBrush &brush);
3229 void setSelectedBrush(
const QBrush &brush);
3230 void setFont(
const QFont &font);
3231 void setSelectedFont(
const QFont &font);
3232 void setText(
const QString &text);
3233 void setPositionAlignment(Qt::Alignment alignment);
3234 void setTextAlignment(Qt::Alignment alignment);
3235 void setRotation(
double degrees);
3236 void setPadding(
const QMargins &padding);
3239 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3267 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3270 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
3271 QFont mainFont()
const;
3272 QColor mainColor()
const;
3273 QPen mainPen()
const;
3274 QBrush mainBrush()
const;
3282 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3283 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3284 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3285 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3292 QPen
pen()
const {
return mPen; }
3298 void setPen(
const QPen &pen);
3299 void setSelectedPen(
const QPen &pen);
3300 void setBrush(
const QBrush &brush);
3301 void setSelectedBrush(
const QBrush &brush);
3304 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3319 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim,
aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
3327 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3330 QPen mainPen()
const;
3331 QBrush mainBrush()
const;
3339 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
3340 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
3341 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
3342 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3343 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3353 QPen
pen()
const {
return mPen; }
3357 void setPixmap(
const QPixmap &pixmap);
3358 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio);
3359 void setPen(
const QPen &pen);
3360 void setSelectedPen(
const QPen &pen);
3363 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3386 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3389 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
3390 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
3391 QPen mainPen()
const;
3399 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3400 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3401 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3402 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3403 Q_PROPERTY(
double size READ size WRITE setSize)
3404 Q_PROPERTY(
TracerStyle style READ style WRITE setStyle)
3405 Q_PROPERTY(
QCPGraph* graph READ graph WRITE setGraph)
3406 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
3407 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
3421 Q_ENUMS(TracerStyle)
3427 QPen
pen()
const {
return mPen; }
3431 double size()
const {
return mSize; }
3438 void setPen(
const QPen &pen);
3439 void setSelectedPen(
const QPen &pen);
3440 void setBrush(
const QBrush &brush);
3441 void setSelectedBrush(
const QBrush &brush);
3442 void setSize(
double size);
3443 void setStyle(TracerStyle style);
3445 void setGraphKey(
double key);
3446 void setInterpolating(
bool enabled);
3449 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3452 void updatePosition();
3470 QPen mainPen()
const;
3471 QBrush mainBrush()
const;
3479 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3480 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3481 Q_PROPERTY(
double length READ length WRITE setLength)
3482 Q_PROPERTY(
BracketStyle style READ style WRITE setStyle)
3495 QPen
pen()
const {
return mPen; }
3501 void setPen(
const QPen &pen);
3502 void setSelectedPen(
const QPen &pen);
3503 void setLength(
double length);
3504 void setStyle(BracketStyle style);
3507 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3522 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3525 QPen mainPen()
const;
bool operator==(const BatteryInfo &right, const BatteryInfo &left)
The abstract base class for all items in a plot.
QPointer< QCPAxisRect > mClipAxisRect
bool clipToAxisRect() const
void selectableChanged(bool selectable)
QList< QCPItemPosition * > positions() const
Returns all positions of the item in a list.
QList< QCPItemAnchor * > anchors() const
Returns all anchors of the item in a list.
QList< QCPItemAnchor * > mAnchors
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
This function is used to decide whether a click hits a layerable object or not.
void selectionChanged(bool selected)
This signal is emitted when the selection state of this item has changed, either by user interaction ...
virtual void draw(QCPPainter *painter)=0
QList< QCPItemPosition * > mPositions
The abstract base class for all entries in a QCPLegend.
QCPLegend * parentLegend() const
QColor selectedTextColor() const
QColor mSelectedTextColor
void selectionChanged(bool selected)
This signal is emitted when the selection state of this legend item has changed, either by user inter...
virtual void draw(QCPPainter *painter)=0
QCPLegend * mParentLegend
void selectableChanged(bool selectable)
QFont selectedFont() const
The abstract base class for all data representing objects in a plot.
void selectableChanged(bool selectable)
This signal is emitted when the selectability of this plottable has changed.
bool antialiasedFill() const
void rescaleAxes(bool onlyEnlarge=false) const
Rescales the key and value axes associated with this plottable to contain all displayed data,...
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
This function is used to decide whether a click hits a layerable object or not.
void selectionChanged(bool selected)
This signal is emitted when the selection state of this plottable has changed, either by user interac...
QPointer< QCPAxis > mKeyAxis
SignDomain
Represents negative and positive sign domain for passing to getKeyRange and getValueRange.
bool antialiasedScatters() const
QCPAxis * valueAxis() const
virtual void clearData()=0
Clears all data in the plottable.
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
void rescaleValueAxis(bool onlyEnlarge=false) const
Rescales the value axis of the plottable so the whole plottable is visible.
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
QCPAxis * keyAxis() const
virtual void draw(QCPPainter *painter)=0
bool mAntialiasedErrorBars
bool antialiasedErrorBars() const
void rescaleKeyAxis(bool onlyEnlarge=false) const
Rescales the key axis of the plottable so the whole plottable is visible.
QBrush selectedBrush() const
QCPLineEnding lowerEnding
QCache< QString, CachedLabel > mLabelCache
bool abbreviateDecimalPowers
QCustomPlot * mParentPlot
QByteArray mLabelParameterHash
QRect axisSelectionBox() const
QRect tickLabelsSelectionBox() const
QVector< QString > tickLabels
QVector< double > tickPositions
QRect labelSelectionBox() const
QVector< double > subTickPositions
Holds multiple axes and arranges them in a rectangular shape.
bool backgroundScaled() const
Qt::AspectRatioMode backgroundScaledMode() const
int width() const
Returns the pixel width of this axis rect.
virtual void update(UpdatePhase phase)
This method is called automatically upon replot and doesn't need to be called by users of QCPAxisRect...
QCPLayoutInset * mInsetLayout
QPoint bottomRight() const
Returns the bottom right corner of this axis rect in pixels.
QPixmap mBackgroundPixmap
int right() const
Returns the pixel position of the right border of this axis rect.
QCPRange mDragStartHorzRange
int top() const
Returns the pixel position of the top border of this axis rect.
virtual void mouseMoveEvent(QMouseEvent *event)
This event is called, if the mouse is moved inside the outer rect of this layout element.
QPixmap background() const
QPoint topLeft() const
Returns the top left corner of this axis rect in pixels.
virtual void wheelEvent(QWheelEvent *event)
This event is called, if the mouse wheel is scrolled while the cursor is inside the rect of this layo...
virtual void mousePressEvent(QMouseEvent *event)
This event is called, if the mouse was pressed while being inside the outer rect of this layout eleme...
QSize size() const
Returns the pixel size of this axis rect.
QPoint topRight() const
Returns the top right corner of this axis rect in pixels.
Qt::AspectRatioMode mBackgroundScaledMode
QCPLayoutInset * insetLayout() const
Returns the inset layout of this axis rect.
Qt::Orientations rangeZoom() const
Qt::Orientations rangeDrag() const
QCP::AntialiasedElements mAADragBackup
QPixmap mScaledBackgroundPixmap
Qt::Orientations mRangeDrag
QPoint bottomLeft() const
Returns the bottom left corner of this axis rect in pixels.
int height() const
Returns the pixel height of this axis rect.
int bottom() const
Returns the pixel position of the bottom border of this axis rect.
double mRangeZoomFactorHorz
QPoint center() const
Returns the center of this axis rect in pixels.
virtual void mouseReleaseEvent(QMouseEvent *event)
This event is called, if the mouse was previously pressed inside the outer rect of this layout elemen...
virtual int calculateAutoMargin(QCP::MarginSide side)
QPointer< QCPAxis > mRangeDragHorzAxis
int left() const
Returns the pixel position of the left border of this axis rect.
QHash< QCPAxis::AxisType, QList< QCPAxis * > > mAxes
Manages a single axis inside a QCustomPlot.
QCPAxisRect * axisRect() const
Qt::Orientation mOrientation
QColor labelColor() const
void rangeChanged(const QCPRange &newRange)
This signal is emitted when the range of this axis has changed.
QFont selectedTickLabelFont() const
QFont tickLabelFont() const
LabelType tickLabelType() const
QPen selectedBasePen() const
QFont selectedLabelFont() const
bool autoTickStep() const
SelectableParts selectableParts() const
int numberPrecision() const
QVector< double > mSubTickVector
QString dateTimeFormat() const
void scaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the scale type changes, by calls to setScaleType.
ScaleType
Defines the scale of an axis.
QColor mSelectedTickLabelColor
int autoTickCount() const
LabelType
When automatic tick label generation is enabled (setAutoTickLabels), defines how the coordinate of th...
QFont mSelectedTickLabelFont
void selectionChanged(const QCPAxis::SelectableParts &parts)
This signal is emitted when the selection state of this axis has changed, either by user interaction ...
QCPGrid * grid() const
Returns the QCPGrid instance belonging to this axis.
QPen selectedSubTickPen() const
QColor selectedTickLabelColor() const
QPen selectedTickPen() const
QColor selectedLabelColor() const
SelectableParts selectedParts() const
double scaleLogBase() const
bool autoTickLabels() const
static Qt::Orientation orientation(AxisType type)
Returns the orientation of the specified axis type.
QColor tickLabelColor() const
AxisType axisType() const
void selectableChanged(const QCPAxis::SelectableParts &parts)
This signal is emitted when the selectability changes, by calls to setSelectableParts.
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QVector< double > mTickVector
SelectableParts mSelectableParts
bool rangeReversed() const
Qt::Orientation orientation() const
Returns the orientation of this axis.
SelectablePart
Defines the selectable parts of an axis.
const QCPRange range() const
ScaleType scaleType() const
QVector< QString > tickVectorLabels() const
QVector< double > tickVector() const
AxisType
Defines at which side of the axis rect the axis will appear.
bool autoSubTicks() const
Qt::TimeSpec dateTimeSpec() const
QCPAxisPainterPrivate * mAxisPainter
QVector< QString > mTickVectorLabels
bool mNumberBeautifulPowers
void ticksRequest()
This signal is emitted when setAutoTicks is false and the axis is about to generate tick labels for a...
Qt::TimeSpec mDateTimeSpec
Holds the data of one single data point (one bar) for QCPBars.
A plottable representing a bar chart in a plot.
QPointer< QCPBars > mBarAbove
QCPBars * barBelow() const
Returns the bars plottable that is directly below this bars plottable.
QCPBarDataMap * data() const
QCPBars * barAbove() const
Returns the bars plottable that is directly above this bars plottable.
Defines a color gradient for use with e.g.
ColorInterpolation mColorInterpolation
QMap< double, QColor > colorStops() const
QMap< double, QColor > mColorStops
bool mColorBufferInvalidated
ColorInterpolation colorInterpolation() const
ColorInterpolation
Defines the color spaces in which color interpolation between gradient stops can be performed.
bool operator!=(const QCPColorGradient &other) const
GradientPreset
Defines the available presets that can be loaded with loadPreset.
QVector< QRgb > mColorBuffer
Holds the two-dimensional data of a QCPColorMap plottable.
QCPRange keyRange() const
QCPRange valueRange() const
QCPRange dataBounds() const
bool isEmpty() const
Returns whether this instance carries no data.
A plottable representing a two-dimensional color map in a plot.
QCPColorMapData * data() const
Returns a pointer to the internal data storage of type QCPColorMapData.
QCPColorScale * colorScale() const
void dataRangeChanged(QCPRange newRange)
This signal is emitted when the data range changes.
bool tightBoundary() const
QCPColorMapData * mMapData
QPointer< QCPColorScale > mColorScale
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the data scale type changes.
QCPColorGradient mGradient
QCPAxis::ScaleType mDataScaleType
QCPAxis::ScaleType dataScaleType() const
void gradientChanged(QCPColorGradient newGradient)
This signal is emitted when the gradient changes.
bool mMapImageInvalidated
QCPColorGradient gradient() const
QCPRange dataRange() const
bool mGradientImageInvalidated
QCPColorScale * mParentColorScale
A color scale for use with color coding data such as QCPColorMap.
QCPAxis::ScaleType mDataScaleType
void dataRangeChanged(QCPRange newRange)
This signal is emitted when the data range changes.
QPointer< QCPAxis > mColorAxis
QCPColorGradient gradient() const
QCPAxis * axis() const
Returns the internal QCPAxis instance of this color scale.
QCPRange dataRange() const
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the data scale type changes.
void gradientChanged(QCPColorGradient newGradient)
This signal is emitted when the gradient changes.
QPointer< QCPColorScaleAxisRectPrivate > mAxisRect
QCPAxis::AxisType type() const
QCPAxis::ScaleType dataScaleType() const
QCPColorGradient mGradient
Holds the data of one single data point for QCPCurve.
A plottable representing a parametric curve in a plot.
LineStyle lineStyle() const
QCPScatterStyle mScatterStyle
QCPCurveDataMap * data() const
LineStyle
Defines how the curve's line is represented visually in the plot.
QCPScatterStyle scatterStyle() const
Holds the data of one single data point for QCPGraph.
A plottable representing a graph in a plot.
bool adaptiveSampling() const
ErrorType errorType() const
QPointer< QCPGraph > mChannelFillGraph
QCPScatterStyle scatterStyle() const
QCPScatterStyle mScatterStyle
double errorBarSize() const
bool errorBarSkipSymbol() const
LineStyle lineStyle() const
QCPDataMap * data() const
Returns a pointer to the internal data storage of type QCPDataMap.
ErrorType
Defines what kind of error bars are drawn for each data point.
LineStyle
Defines how the graph's line is represented visually in the plot.
QCPGraph * channelFillGraph() const
Responsible for drawing the grid of a QCPAxis.
bool antialiasedZeroLine() const
bool antialiasedSubGrid() const
bool subGridVisible() const
An anchor of an item to which positions can be attached to.
QCustomPlot * mParentPlot
QSet< QCPItemPosition * > mChildren
QCPAbstractItem * mParentItem
virtual QCPItemPosition * toQCPItemPosition()
Returns 0 if this instance is merely a QCPItemAnchor, and a valid pointer of type QCPItemPosition* if...
A bracket for referencing/highlighting certain parts in the plot.
QCPItemAnchor *const center
BracketStyle style() const
QCPItemPosition *const left
QCPItemPosition *const right
A curved line from one point to another.
QCPItemPosition *const start
QCPItemPosition *const end
QCPItemPosition *const endDir
QCPLineEnding head() const
QCPItemPosition *const startDir
QCPLineEnding tail() const
QCPItemPosition *const topLeft
QCPItemAnchor *const bottom
QCPItemAnchor *const bottomLeftRim
QCPItemAnchor *const topLeftRim
QCPItemAnchor *const right
QCPItemAnchor *const bottomRightRim
QCPItemAnchor *const topRightRim
QCPItemAnchor *const center
QCPItemAnchor *const left
QCPItemPosition *const bottomRight
QBrush selectedBrush() const
A line from one point to another.
QCPItemPosition *const end
QCPItemPosition *const start
QCPLineEnding head() const
QCPLineEnding tail() const
QCPItemAnchor *const bottomLeft
QCPItemPosition *const topLeft
Qt::AspectRatioMode aspectRatioMode() const
QCPItemAnchor *const topRight
QCPItemAnchor *const left
Qt::AspectRatioMode mAspectRatioMode
QCPItemPosition *const bottomRight
QCPItemAnchor *const right
QCPItemAnchor *const bottom
Manages the position of an item.
QCPItemAnchor * parentAnchor() const
QCPItemAnchor * mParentAnchor
QPointer< QCPAxis > mKeyAxis
virtual QCPItemPosition * toQCPItemPosition()
Returns 0 if this instance is merely a QCPItemAnchor, and a valid pointer of type QCPItemPosition* if...
QCPAxis * valueAxis() const
PositionType
Defines the ways an item position can be specified.
QCPAxis * keyAxis() const
PositionType type() const
PositionType mPositionType
QPointer< QCPAxisRect > mAxisRect
QBrush selectedBrush() const
QCPItemPosition *const bottomRight
QCPItemAnchor *const topRight
QCPItemAnchor *const right
QCPItemAnchor *const bottom
QCPItemPosition *const topLeft
QCPItemAnchor *const left
QCPItemAnchor *const bottomLeft
A straight line that spans infinitely in both directions.
QCPItemPosition *const point1
QCPItemPosition *const point2
QCPItemPosition *const position
Qt::Alignment positionAlignment() const
QBrush selectedBrush() const
QCPItemAnchor *const topLeft
QCPItemAnchor *const bottomLeft
Qt::Alignment mPositionAlignment
QColor selectedColor() const
QFont selectedFont() const
QCPItemAnchor *const bottomRight
QCPItemAnchor *const bottom
Qt::Alignment textAlignment() const
QCPItemAnchor *const left
Qt::Alignment mTextAlignment
QCPItemAnchor *const topRight
QCPItemAnchor *const right
Item that sticks to QCPGraph data points.
TracerStyle
The different visual appearances a tracer item can have.
QCPItemPosition *const position
QBrush selectedBrush() const
bool interpolating() const
TracerStyle style() const
A layer that may contain objects, to control the rendering order.
QList< QCPLayerable * > children() const
Returns a list of all layerables on this layer.
QCustomPlot * mParentPlot
QList< QCPLayerable * > mChildren
QCustomPlot * parentPlot() const
int index() const
Returns the index this layer has in the QCustomPlot.
Base class for all drawable objects.
QPointer< QCPLayerable > mParentLayerable
QCustomPlot * parentPlot() const
QCustomPlot * mParentPlot
QCPLayerable * parentLayerable() const
Returns the parent layerable of this layerable.
void layerChanged(QCPLayer *newLayer)
This signal is emitted when the layer of this layerable changes, i.e.
virtual void draw(QCPPainter *painter)=0
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
The abstract base class for all objects that form the layout system.
UpdatePhase
Defines the phases of the update process, that happens just before a replot.
virtual void mouseMoveEvent(QMouseEvent *event)
This event is called, if the mouse is moved inside the outer rect of this layout element.
QRect rect() const
Returns the inner rect of this layout element.
QCP::MarginSides autoMargins() const
virtual void mousePressEvent(QMouseEvent *event)
This event is called, if the mouse was pressed while being inside the outer rect of this layout eleme...
virtual void wheelEvent(QWheelEvent *event)
This event is called, if the mouse wheel is scrolled while the cursor is inside the rect of this layo...
QCPLayout * layout() const
Returns the parent layout of this layout element.
virtual void draw(QCPPainter *painter)
QMargins minimumMargins() const
QSize minimumSize() const
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
virtual void mouseDoubleClickEvent(QMouseEvent *event)
This event is called, if the mouse is double-clicked inside the outer rect of this layout element.
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
virtual void mouseReleaseEvent(QMouseEvent *event)
This event is called, if the mouse was previously pressed inside the outer rect of this layout elemen...
QCPLayout * mParentLayout
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QCP::MarginSides mAutoMargins
QSize maximumSize() const
A layout that arranges child elements in a grid.
QList< QList< QCPLayoutElement * > > mElements
QList< double > mRowStretchFactors
QList< double > rowStretchFactors() const
QList< double > columnStretchFactors() const
QList< double > mColumnStretchFactors
int columnSpacing() const
A layout that places child elements aligned to the border or arbitrarily positioned.
QList< Qt::Alignment > mInsetAlignment
QList< InsetPlacement > mInsetPlacement
InsetPlacement
Defines how the placement and sizing is handled for a certain element in a QCPLayoutInset.
QList< QCPLayoutElement * > mElements
QList< QRectF > mInsetRect
virtual void simplify()
The QCPInsetLayout does not need simplification since it can never have empty cells due to its linear...
The abstract base class for layouts.
virtual int elementCount() const =0
Returns the number of elements/cells in the layout.
virtual QCPLayoutElement * takeAt(int index)=0
Removes the element with the given index from the layout and returns it.
virtual bool take(QCPLayoutElement *element)=0
Removes the specified element from the layout and returns true on success.
virtual QCPLayoutElement * elementAt(int index) const =0
Returns the element in the cell with the given index.
Manages a legend inside a QCustomPlot.
SelectableParts mSelectableParts
int iconTextPadding() const
QFont selectedFont() const
SelectablePart
Defines the selectable parts of a legend.
QPen iconBorderPen() const
QColor mSelectedTextColor
QBrush selectedBrush() const
void selectionChanged(QCPLegend::SelectableParts parts)
This signal is emitted when the selection state of this legend has changed.
void selectableChanged(QCPLegend::SelectableParts parts)
QColor selectedTextColor() const
SelectableParts selectableParts() const
QPen selectedIconBorderPen() const
QPen selectedBorderPen() const
Handles the different ending decorations for line-like items.
EndingStyle style() const
EndingStyle
Defines the type of ending decoration for line-like items, e.g.
A margin group allows synchronization of margin sides if working with multiple layout elements.
QCustomPlot * mParentPlot
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Returns a list of all layout elements that have their margin side associated with this margin group.
QPainter subclass used internally.
QStack< bool > mAntialiasingStack
PainterMode
Defines special modes the painter can operate in.
bool antialiasing() const
void drawLine(const QPointF &p1, const QPointF &p2)
PainterModes modes() const
A layout element displaying a plot title text.
void selectionChanged(bool selected)
This signal is emitted when the selection state has changed to selected, either by user interaction o...
QFont selectedFont() const
void selectableChanged(bool selectable)
QColor mSelectedTextColor
QColor selectedTextColor() const
A legend item representing a plottable with an icon and the plottable name.
QCPAbstractPlottable * plottable()
QCPAbstractPlottable * mPlottable
Represents the range an axis is encompassing.
static const double maxRange
Maximum values (negative and positive) the range will accept in range-changing functions.
QCPRange & operator/=(const double &value)
Divides both boundaries of the range by value.
QCPRange & operator*=(const double &value)
Multiplies both boundaries of the range by value.
QCPRange & operator-=(const double &value)
Subtracts value from both boundaries of the range.
bool operator!=(const QCPRange &other)
bool operator==(const QCPRange &other)
static const double minRange
Minimum range size (upper - lower) the range changing functions will accept.
QCPRange & operator+=(const double &value)
Adds value to both boundaries of the range.
Represents the visual appearance of scatter points.
bool isPenDefined() const
Returns whether a pen has been defined for this scatter style.
bool isNone() const
Returns whether the scatter shape is ssNone.
ScatterShape
Defines the shape used for scatter points.
QPainterPath customPath() const
ScatterShape shape() const
A plottable representing a single statistical box in a plot.
QVector< double > mOutliers
QPen whiskerBarPen() const
QVector< double > outliers() const
double whiskerWidth() const
QCPScatterStyle mOutlierStyle
QCPScatterStyle outlierStyle() const
double lowerQuartile() const
double upperQuartile() const
The central class of the library.
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
This signal is emitted when a legend (item) is double clicked.
QPixmap mScaledBackgroundPixmap
void beforeReplot()
This signal is emitted immediately before a replot takes place (caused by a call to the slot replot).
Qt::KeyboardModifier mMultiSelectModifier
QRect viewport() const
Returns the viewport rect of this QCustomPlot instance.
void titleClick(QMouseEvent *event, QCPPlotTitle *title)
This signal is emitted when a plot title is clicked.
Qt::KeyboardModifier multiSelectModifier() const
const QCP::Interactions interactions() const
QPointer< QCPLayoutElement > mMouseEventElement
RefreshPriority
Defines with what timing the QCustomPlot surface is refreshed after a replot.
@ rpHint
Whether to use immediate repaint or queued update depends on whether the plotting hint QCP::phForceRe...
QCPLegend * legend
A pointer to the default legend of the main axis rect.
void selectionChangedByUser()
This signal is emitted after the user has changed the selection in the QCustomPlot,...
int selectionTolerance() const
void plottableClick(QCPAbstractPlottable *plottable, QMouseEvent *event)
This signal is emitted when a plottable is clicked.
QPixmap background() const
QList< QCPAbstractPlottable * > mPlottables
QCP::AntialiasedElements antialiasedElements() const
QList< QCPAbstractItem * > mItems
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
This signal is emitted when an axis is double clicked.
void afterReplot()
This signal is emitted immediately after a replot has taken place (caused by a call to the slot replo...
QList< QCPLayer * > mLayers
void mouseMove(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse move event.
QCP::AntialiasedElements notAntialiasedElements() const
LayerInsertMode
Defines how a layer should be inserted relative to an other layer.
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
This signal is emitted when a legend (item) is clicked.
QCPAxis * xAxis
A pointer to the primary x Axis (bottom) of the main axis rect of the plot.
void mouseDoubleClick(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse double click event.
QCP::PlottingHints mPlottingHints
QCP::AntialiasedElements mAntialiasedElements
bool backgroundScaled() const
bool mAutoAddPlottableToLegend
Qt::AspectRatioMode mBackgroundScaledMode
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
This signal is emitted when an axis is clicked.
bool autoAddPlottableToLegend() const
QCP::PlottingHints plottingHints() const
void mouseWheel(QWheelEvent *event)
This signal is emitted when the QCustomPlot receives a mouse wheel event.
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event)
This signal is emitted when an item is double clicked.
bool mNoAntialiasingOnDrag
void mouseRelease(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse release event.
QCPLayoutGrid * mPlotLayout
bool noAntialiasingOnDrag() const
void mousePress(QMouseEvent *event)
This signal is emitted when the QCustomPlot receives a mouse press event.
void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title)
This signal is emitted when a plot title is double clicked.
QCP::Interactions mInteractions
QList< QCPGraph * > mGraphs
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
This signal is emitted when an item is clicked.
QPixmap mBackgroundPixmap
QCPLayoutGrid * plotLayout() const
Returns the top level layout of this QCustomPlot instance.
void plottableDoubleClick(QCPAbstractPlottable *plottable, QMouseEvent *event)
This signal is emitted when a plottable is double clicked.
Qt::AspectRatioMode backgroundScaledMode() const
The QCP Namespace contains general enums and QFlags used throughout the QCustomPlot library.
bool isInvalidData(double value)
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
Interaction
Defines the mouse interactions possible with QCustomPlot.
@ iSelectLegend
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts)
@ iRangeDrag
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes)
@ iSelectPlottables
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable)
@ iRangeZoom
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom,...
@ iSelectAxes
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
@ iSelectItems
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem)
@ iMultiSelect
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
@ iSelectOther
0x080 All other objects are selectable (e.g. your own derived layerables, the plot title,...
PlottingHint
Defines plotting hints that control various aspects of the quality and speed of plotting.
@ phCacheLabels
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
@ phForceRepaint
0x002 causes an immediate repaint() instead of a soft update() when QCustomPlot::replot() is called w...
@ phFastPolylines
0x001 Graph/Curve lines are drawn with a faster method.
@ phNone
0x000 No hints are set
MarginSide
Defines the sides of a rectangular entity to which margins can be applied.
@ msBottom
0x08 bottom margin
@ msRight
0x02 right margin
AntialiasedElement
Defines what objects of a plot can be forcibly drawn antialiased/not antialiased.
@ aeLegendItems
0x0010 Legend items
@ aeZeroLine
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
@ aePlottables
0x0020 Main lines of plottables (excluding error bars, see element aeErrorBars)
@ aeGrid
0x0002 Grid lines
@ aeFills
0x0200 Borders of fills (e.g. under or between graphs)
@ aeErrorBars
0x0100 Error bars
@ aeLegend
0x0008 Legend box
@ aeAll
0xFFFF All elements
@ aeNone
0x0000 No elements
@ aeSubGrid
0x0004 Sub grid lines
@ aeScatters
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap)
@ aeAxes
0x0001 Axis base line and tick marks
@ aeItems
0x0040 Main lines of items
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
QMapIterator< double, QCPData > QCPDataMapIterator
QMap< double, QCPCurveData > QCPCurveDataMap
Container for storing QCPCurveData items in a sorted fashion.
QMutableMapIterator< double, QCPData > QCPDataMutableMapIterator
const QCPRange operator/(const QCPRange &range, double value)
Divides both boundaries of the range by value.
const QCPRange operator*(const QCPRange &range, double value)
Multiplies both boundaries of the range by value.
QMutableMapIterator< double, QCPBarData > QCPBarDataMutableMapIterator
const QCPRange operator-(const QCPRange &range, double value)
Subtracts value from both boundaries of the range.
QMap< double, QCPData > QCPDataMap
Container for storing QCPData items in a sorted fashion.
QMap< double, QCPBarData > QCPBarDataMap
Container for storing QCPBarData items in a sorted fashion.
QMutableMapIterator< double, QCPCurveData > QCPCurveDataMutableMapIterator
QMapIterator< double, QCPBarData > QCPBarDataMapIterator
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
QMapIterator< double, QCPCurveData > QCPCurveDataMapIterator
const QCPRange operator+(const QCPRange &range, double value)
Adds value to both boundaries of the range.