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);
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);
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;
324 Q_FLAGS(PainterMode PainterModes)
325 Q_DECLARE_FLAGS(PainterModes, PainterMode)
332 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
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)
386 void setVisible(
bool visible);
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;
458 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
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;
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;
748 QVector<int>
getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
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);
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);
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;
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);
1045 Q_FLAGS(AxisType AxisTypes)
1046 Q_DECLARE_FLAGS(AxisTypes, AxisType)
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;
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;
1207 static AxisType opposite(AxisType type);
1281 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1286 double baseLog(
double value)
const;
1287 double basePow(
double value)
const;
1303Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::SelectableParts)
1304Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::AxisTypes)
1315 virtual int size()
const;
1366 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
1370 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
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;
1460 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1472 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
1478 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1497 virtual QPointF pixelPoint()
const;
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);
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;
1616 bool hasAnchor(
const QString &name)
const;
1636 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
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;
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);
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();
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;
2015 virtual void update(UpdatePhase phase);
2016 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
2034 QHash<QCPAxis::AxisType, QList<QCPAxis*> >
mAxes;
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;
2111 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2174 Q_FLAGS(SelectablePart SelectableParts)
2175 Q_DECLARE_FLAGS(SelectableParts, SelectablePart)
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;
2252 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2265Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPLegend::SelectableParts)
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;
2326 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
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);
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;
2583 void getPreparedData(QVector<QCPData> *lineData, QVector<QCPData> *scatterData)
const;
2584 void getPlotData(QVector<QPointF> *lineData, 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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
3389 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
3390 QRect
getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
3421 Q_ENUMS(TracerStyle)
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();
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;
bool operator==(const BatteryInfo &right, const BatteryInfo &left)
The abstract base class for all items in a plot.
Q_SLOT void setSelected(bool selected)
Sets whether this item is selected or not.
double rectSelectTest(const QRectF &rect, const QPointF &pos, bool filledRect) const
void setClipToAxisRect(bool clip)
Sets whether the item shall be clipped to an axis rect or whether it shall be visible on the entire Q...
QPointer< QCPAxisRect > mClipAxisRect
bool clipToAxisRect() const
virtual QRect clipRect() const
virtual QPointF anchorPixelPoint(int anchorId) const
virtual QCP::Interaction selectionCategory() const
void selectableChanged(bool selectable)
friend class QCPItemAnchor
QList< QCPItemPosition * > positions() const
Returns all positions of the item in a list.
QCPItemPosition * createPosition(const QString &name)
void setClipAxisRect(QCPAxisRect *rect)
Sets the clip axis rect.
QList< QCPItemAnchor * > anchors() const
Returns all anchors of the item in a list.
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Q_SLOT void setSelectable(bool selectable)
Sets whether the user can (de-)select this item by clicking on the QCustomPlot surface.
double distSqrToLine(const QPointF &start, const QPointF &end, const QPointF &point) const
QList< QCPItemAnchor * > mAnchors
virtual void deselectEvent(bool *selectionStateChanged)
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.
QCPAbstractItem(QCustomPlot *parentPlot)
Base class constructor which initializes base class members.
void selectionChanged(bool selected)
This signal is emitted when the selection state of this item has changed, either by user interaction ...
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
QCPAxisRect * clipAxisRect() const
virtual void draw(QCPPainter *painter)=0
QCPItemAnchor * createAnchor(const QString &name, int anchorId)
QList< QCPItemPosition * > mPositions
The abstract base class for all entries in a QCPLegend.
QCPLegend * parentLegend() const
QColor selectedTextColor() const
void setFont(const QFont &font)
Sets the default font of this specific legend item to font.
QColor mSelectedTextColor
void setSelectedTextColor(const QColor &color)
When this legend item is selected, color is used to draw generic text, instead of the normal color se...
void setTextColor(const QColor &color)
Sets the default text color of this specific legend item to color.
Q_SLOT void setSelected(bool selected)
Sets whether this specific legend item is selected.
void selectionChanged(bool selected)
This signal is emitted when the selection state of this legend item has changed, either by user inter...
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
void setSelectedFont(const QFont &font)
When this legend item is selected, font is used to draw generic text, instead of the normal font set ...
virtual void draw(QCPPainter *painter)=0
Q_SLOT void setSelectable(bool selectable)
Sets whether this specific legend item is selectable.
virtual QCP::Interaction selectionCategory() const
QCPLegend * mParentLegend
void selectableChanged(bool selectable)
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
virtual QRect clipRect() const
QFont selectedFont() const
virtual void deselectEvent(bool *selectionStateChanged)
QCPAbstractLegendItem(QCPLegend *parent)
Constructs a QCPAbstractLegendItem and associates it with the QCPLegend parent.
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 applyErrorBarsAntialiasingHint(QCPPainter *painter) const
void setAntialiasedFill(bool enabled)
Sets whether fills of this plottable is drawn antialiased or not.
friend class QCPPlottableLegendItem
void rescaleAxes(bool onlyEnlarge=false) const
Rescales the key and value axes associated with this plottable to contain all displayed data,...
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
Q_SLOT void setSelectable(bool selectable)
Sets whether the user can (de-)select this plottable by clicking on the QCustomPlot surface.
QPointer< QCPAxis > mValueAxis
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
void setAntialiasedScatters(bool enabled)
Sets whether the scatter symbols of this plottable are drawn antialiased or not.
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 pixelsToCoords(double x, double y, double &key, double &value) const
void selectionChanged(bool selected)
This signal is emitted when the selection state of this plottable has changed, either by user interac...
QPointer< QCPAxis > mKeyAxis
void applyDefaultAntialiasingHint(QCPPainter *painter) const
SignDomain
Represents negative and positive sign domain for passing to getKeyRange and getValueRange.
@ sdPositive
The positive sign domain, i.e. numbers greater than zero.
@ sdBoth
Both sign domains, including zero, i.e. all (rational) numbers.
@ sdNegative
The negative sign domain, i.e. numbers smaller than zero.
void setSelectedPen(const QPen &pen)
When the plottable is selected, this pen is used to draw basic lines instead of the normal pen set vi...
virtual void deselectEvent(bool *selectionStateChanged)
virtual bool addToLegend()
Adds this plottable to the legend of the parent QCustomPlot (QCustomPlot::legend).
void setValueAxis(QCPAxis *axis)
The value axis of a plottable can be set to any axis of a QCustomPlot, as long as it is orthogonal to...
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
void setAntialiasedErrorBars(bool enabled)
Sets whether the error bars of this plottable are drawn antialiased or not.
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
bool antialiasedScatters() const
void setBrush(const QBrush &brush)
The brush is used to draw basic fills of the plottable representation in the plot.
void coordsToPixels(double key, double value, double &x, double &y) const
virtual void clearData()=0
Clears all data in the plottable.
QCPAxis * valueAxis() const
void setKeyAxis(QCPAxis *axis)
The key axis of a plottable can be set to any axis of a QCustomPlot, as long as it is orthogonal to t...
void applyFillAntialiasingHint(QCPPainter *painter) const
bool mAntialiasedScatters
void rescaleValueAxis(bool onlyEnlarge=false) const
Rescales the value axis of the plottable so the whole plottable is visible.
QCPAxis * keyAxis() const
virtual QRect clipRect() const
void setPen(const QPen &pen)
The pen is used to draw basic lines that make up the plottable representation in the plot.
void setName(const QString &name)
The name is the textual representation of this plottable as it is displayed in the legend (QCPLegend)...
void applyScattersAntialiasingHint(QCPPainter *painter) const
virtual bool removeFromLegend() const
Removes the plottable from the legend of the parent QCustomPlot.
virtual void draw(QCPPainter *painter)=0
bool mAntialiasedErrorBars
bool antialiasedErrorBars() const
void setSelectedBrush(const QBrush &brush)
When the plottable is selected, this brush is used to draw fills instead of the normal brush set via ...
void rescaleKeyAxis(bool onlyEnlarge=false) const
Rescales the key axis of the plottable so the whole plottable is visible.
QCPAbstractPlottable(QCPAxis *keyAxis, QCPAxis *valueAxis)
Constructs an abstract plottable which uses keyAxis as its key axis ("x") and valueAxis as its value ...
double distSqrToLine(const QPointF &start, const QPointF &end, const QPointF &point) const
virtual QCP::Interaction selectionCategory() const
Q_SLOT void setSelected(bool selected)
Sets whether this plottable is selected or not.
QBrush selectedBrush() const
virtual void draw(QCPPainter *painter)
QCPLineEnding lowerEnding
QCache< QString, CachedLabel > mLabelCache
QRect mTickLabelsSelectionBox
QCPAxisPainterPrivate(QCustomPlot *parentPlot)
Constructs a QCPAxisPainterPrivate instance.
virtual TickLabelData getTickLabelData(const QFont &font, const QString &text) const
virtual QPointF getTickLabelDrawOffset(const TickLabelData &labelData) const
bool abbreviateDecimalPowers
virtual void getMaxTickLabelSize(const QFont &font, const QString &text, QSize *tickLabelsSize) const
QCustomPlot * mParentPlot
virtual void drawTickLabel(QCPPainter *painter, double x, double y, const TickLabelData &labelData) const
QByteArray mLabelParameterHash
QRect axisSelectionBox() const
virtual QByteArray generateLabelParameterHash() const
QRect tickLabelsSelectionBox() const
QVector< QString > tickLabels
QVector< double > tickPositions
QRect labelSelectionBox() const
QCPLineEnding upperEnding
virtual void placeTickLabel(QCPPainter *painter, double position, int distanceToAxis, const QString &text, QSize *tickLabelsSize)
QVector< double > subTickPositions
Holds multiple axes and arranges them in a rectangular shape.
bool backgroundScaled() const
Qt::AspectRatioMode backgroundScaledMode() const
QCPRange mDragStartVertRange
int width() const
Returns the pixel width of this axis rect.
Qt::Orientations mRangeZoom
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
double mRangeZoomFactorVert
QPoint bottomRight() const
Returns the bottom right corner of this axis rect in pixels.
QPixmap mBackgroundPixmap
QPointer< QCPAxis > mRangeDragVertAxis
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...
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
If scaling of the axis background pixmap is enabled (setBackgroundScaled), use this function to defin...
void updateAxesOffset(QCPAxis::AxisType type)
QCPAxisRect(QCustomPlot *parentPlot, bool setupDefaultAxes=true)
Creates a QCPAxisRect instance and sets default values.
QCP::AntialiasedElements mNotAADragBackup
virtual void mousePressEvent(QMouseEvent *event)
This event is called, if the mouse was pressed while being inside the outer rect of this layout eleme...
void setRangeZoom(Qt::Orientations orientations)
Sets which axis orientation may be zoomed by the user with the mouse wheel.
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
QPointer< QCPAxis > mRangeZoomVertAxis
QCPLayoutInset * insetLayout() const
Returns the inset layout of this axis rect.
Qt::Orientations rangeZoom() const
Qt::Orientations rangeDrag() const
QCP::AntialiasedElements mAADragBackup
QPixmap mScaledBackgroundPixmap
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
Qt::Orientations mRangeDrag
QPoint bottomLeft() const
Returns the bottom left corner of this axis rect in pixels.
void drawBackground(QCPPainter *painter)
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...
QPointer< QCPAxis > mRangeZoomHorzAxis
void setRangeDrag(Qt::Orientations orientations)
Sets which axis orientation may be range dragged by the user with mouse interaction.
void setBackgroundScaled(bool scaled)
Sets whether the axis background pixmap shall be scaled to fit the axis rect or not.
virtual int calculateAutoMargin(QCP::MarginSide side)
QPointer< QCPAxis > mRangeDragHorzAxis
void setBackground(const QPixmap &pm)
Sets pm as the axis background pixmap.
virtual void draw(QCPPainter *painter)
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
void setSelectedLabelFont(const QFont &font)
Sets the font that is used for the axis label when it is selected.
Qt::Orientation mOrientation
void setOffset(int offset)
Sets the offset the axis has to its axis rect side.
virtual QCP::Interaction selectionCategory() const
void setTickLabels(bool show)
Sets whether tick labels are displayed.
QColor labelColor() const
void rangeChanged(const QCPRange &newRange)
This signal is emitted when the range of this axis has changed.
void setLowerEnding(const QCPLineEnding &ending)
Sets the style for the lower axis ending.
QFont selectedTickLabelFont() const
QFont tickLabelFont() const
LabelType tickLabelType() const
QCPLineEnding lowerEnding() const
QPen selectedBasePen() const
QFont selectedLabelFont() const
bool autoTickStep() const
void setTickLabelRotation(double degrees)
Sets the rotation of the tick labels.
SelectableParts selectableParts() const
QString numberFormat() const
void setRangeReversed(bool reversed)
Sets whether the axis range (direction) is displayed reversed.
void setNumberPrecision(int precision)
Sets the precision of the tick label numbers.
int numberPrecision() const
virtual void draw(QCPPainter *painter)
void setDateTimeSpec(const Qt::TimeSpec &timeSpec)
Sets the time spec that is used for the date time values when setTickLabelType is ltDateTime.
QVector< double > mSubTickVector
void setSelectedSubTickPen(const QPen &pen)
Sets the pen that is used to draw the subticks when selected.
void setTickLabelFont(const QFont &font)
Sets the font of the tick labels.
QString dateTimeFormat() const
void setDateTimeFormat(const QString &format)
Sets the format in which dates and times are displayed as tick labels, if setTickLabelType is ltDateT...
void setLabel(const QString &str)
Sets the text of the axis label that will be shown below/above or next to the axis,...
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.
@ stLogarithmic
Logarithmic scaling with correspondingly transformed plots and (major) tick marks at every base power...
@ stLinear
Linear scaling.
void setTickLabelColor(const QColor &color)
Sets the color of the tick labels.
void setTickLengthOut(int outside)
Sets the length of the outward ticks in pixels.
QColor mSelectedTickLabelColor
int autoTickCount() const
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
void setLabelPadding(int padding)
Sets the distance between the tick labels and the axis label.
virtual int calculateMargin()
LabelType
When automatic tick label generation is enabled (setAutoTickLabels), defines how the coordinate of th...
@ ltNumber
Tick coordinate is regarded as normal number and will be displayed as such. (see setNumberFormat).
@ ltDateTime
Tick coordinate is regarded as a date/time (seconds since 1970-01-01T00:00:00 UTC) and will be displa...
void setSubTickCount(int count)
Sets the number of sub ticks in one (major) tick step.
void setSubTickLengthOut(int outside)
Sets the length of the outward subticks in pixels.
QFont mSelectedTickLabelFont
Q_SLOT void setSelectableParts(const QCPAxis::SelectableParts &selectableParts)
Sets whether the user can (de-)select the parts in selectable by clicking on the QCustomPlot surface.
virtual void deselectEvent(bool *selectionStateChanged)
void setTickLabelType(LabelType type)
Sets whether the tick labels display numbers or dates/times.
void setPadding(int padding)
Sets the padding of the axis.
virtual void setupTickVectors()
double tickLabelRotation() const
void setSelectedLabelColor(const QColor &color)
Sets the color that is used for the axis label when it is selected.
virtual void generateAutoTicks()
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.
void setUpperEnding(const QCPLineEnding &ending)
Sets the style for the upper axis ending.
QFont getTickLabelFont() const
void setLabelColor(const QColor &color)
Sets the color of the axis label.
void setLabelFont(const QFont &font)
Sets the font of the axis label.
void setScaleLogBase(double base)
If setScaleType is set to stLogarithmic, base will be the logarithm base of the scaling.
QPen selectedSubTickPen() const
QColor selectedTickLabelColor() const
QPen selectedTickPen() const
void setBasePen(const QPen &pen)
Sets the pen, the axis base line is drawn with.
QColor selectedLabelColor() const
void setAutoTickCount(int approximateCount)
When setAutoTickStep is true, approximateCount determines how many ticks should be generated in the v...
void setSelectedTickPen(const QPen &pen)
Sets the pen that is used to draw the (major) ticks when selected.
void setSelectedTickLabelFont(const QFont &font)
Sets the font that is used for tick labels when they are selected.
void setTickVector(const QVector< double > &vec)
If you want full control over what ticks (and possibly labels) the axes show, this function is used t...
SelectableParts selectedParts() const
QColor getTickLabelColor() const
double scaleLogBase() const
SelectableParts mSelectedParts
void setTickVectorLabels(const QVector< QString > &vec)
If you want full control over what ticks and labels the axes show, this function is used to set a num...
double mScaleLogBaseLogInv
QColor mSelectedLabelColor
bool autoTickLabels() const
void setAutoTickStep(bool on)
Sets whether the tick step, i.e.
static Qt::Orientation orientation(AxisType type)
Returns the orientation of the specified axis type.
void setSelectedTickLabelColor(const QColor &color)
Sets the color that is used for tick labels when they are selected.
QColor tickLabelColor() const
QCPLineEnding upperEnding() const
AxisType axisType() const
void selectableChanged(const QCPAxis::SelectableParts &parts)
This signal is emitted when the selectability changes, by calls to setSelectableParts.
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
void setAutoTickLabels(bool on)
Sets whether the tick labels are generated automatically.
double basePow(double value) const
void rangeChanged(const QCPRange &newRange, const QCPRange &oldRange)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QPen getSubTickPen() const
QVector< double > mTickVector
SelectableParts mSelectableParts
bool rangeReversed() const
Qt::Orientation orientation() const
Returns the orientation of this axis.
Q_SLOT void setSelectedParts(const QCPAxis::SelectableParts &selectedParts)
Sets the selected state of the respective axis parts described by SelectablePart.
SelectablePart
Defines the selectable parts of an axis.
@ spTickLabels
Tick labels (numbers) of this axis (as a whole, not individually).
@ spAxisLabel
The axis label.
@ spAxis
The axis backbone and tick marks.
@ spNone
None of the selectable parts.
const QCPRange range() const
void setSubTickLengthIn(int inside)
Sets the length of the inward subticks in pixels.
QCPAxis(QCPAxisRect *parent, AxisType type)
Constructs an Axis instance of Type type for the axis rect parent.
void setTicks(bool show)
Sets whether tick marks are displayed.
int subTickLengthOut() const
virtual int calculateAutoSubTickCount(double tickStep) const
ScaleType scaleType() const
int tickLengthOut() const
void setTickPen(const QPen &pen)
Sets the pen, tick marks will be drawn with.
void setAutoSubTicks(bool on)
Sets whether the number of sub ticks in one tick interval is determined automatically.
Q_SLOT void setScaleType(QCPAxis::ScaleType type)
Sets whether the axis uses a linear scale or a logarithmic scale.
QVector< QString > tickVectorLabels() const
QVector< double > tickVector() const
AxisType
Defines at which side of the axis rect the axis will appear.
@ atBottom
0x08 Axis is horizontal and on the bottom side of the axis rect
@ atTop
0x04 Axis is horizontal and on the top side of the axis rect
@ atRight
0x02 Axis is vertical and on the right side of the axis rect
@ atLeft
0x01 Axis is vertical and on the left side of the axis rect
bool autoSubTicks() const
void setNumberFormat(const QString &formatCode)
Sets the number format for the numbers drawn as tick labels (if tick label type is ltNumber).
double baseLog(double value) const
void setAutoTicks(bool on)
Sets whether the tick positions should be calculated automatically (either from an automatically gene...
QColor getLabelColor() const
Qt::TimeSpec dateTimeSpec() const
QFont getLabelFont() const
void setSelectedBasePen(const QPen &pen)
Sets the pen that is used to draw the axis base line when selected.
Q_SLOT void setRange(const QCPRange &range)
Sets the range of the axis.
void visibleTickBounds(int &lowIndex, int &highIndex) const
void setSubTickPen(const QPen &pen)
Sets the pen, subtick marks will be drawn with.
QCPAxisPainterPrivate * mAxisPainter
QVector< QString > mTickVectorLabels
bool mNumberBeautifulPowers
void setTickLabelPadding(int padding)
Sets the distance between the axis base line (including any outward ticks) and the tick labels.
void ticksRequest()
This signal is emitted when setAutoTicks is false and the axis is about to generate tick labels for a...
void setTickStep(double step)
If setAutoTickStep is set to false, use this function to set the tick step manually.
Qt::TimeSpec mDateTimeSpec
int subTickLengthIn() const
int tickLabelPadding() const
void setTickLengthIn(int inside)
Sets the length of the inward ticks in pixels.
Holds the data of one single data point (one bar) for QCPBars.
QCPBarData()
Constructs a bar data point with key and value set to zero.
A plottable representing a bar chart in a plot.
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
QPointer< QCPBars > mBarAbove
QCPBars * barBelow() const
Returns the bars plottable that is directly below this bars plottable.
QCPBarDataMap * data() const
QPolygonF getBarPolygon(double key, double value) const
virtual void draw(QCPPainter *painter)
QCPBars(QCPAxis *keyAxis, QCPAxis *valueAxis)
Constructs a bar chart which uses keyAxis as its key axis ("x") and valueAxis as its value axis ("y")...
static void connectBars(QCPBars *lower, QCPBars *upper)
QCPBars * barAbove() const
Returns the bars plottable that is directly above this bars plottable.
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
QPointer< QCPBars > mBarBelow
double getBaseValue(double key, bool positive) const
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void setWidth(double width)
Sets the width of the bars in plot (key) coordinates.
Defines a color gradient for use with e.g.
ColorInterpolation mColorInterpolation
QCPColorGradient(GradientPreset preset=gpCold)
Constructs a new QCPColorGradient initialized with the colors and color interpolation according to pr...
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.
@ ciRGB
Color channels red, green and blue are linearly interpolated.
@ ciHSV
Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the ...
bool operator!=(const QCPColorGradient &other) const
GradientPreset
Defines the available presets that can be loaded with loadPreset.
@ gpNight
Continuous lightness from black over weak blueish colors to white (suited for non-biased data represe...
@ gpHues
Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and pha...
@ gpGeography
Colors suitable to represent different elevations on geographical maps.
@ gpIon
Half hue spectrum from black over purple to blue and finally green (creates banding illusion but allo...
@ gpHot
Continuous lightness from black over firey colors to white (suited for non-biased data representation...
@ gpJet
Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion ...
@ gpCandy
Blue over pink to white.
@ gpPolar
Colors suitable to emphasize polarity around the center, with blue for negative, black in the middle ...
@ gpSpectrum
An approximation of the visible light spectrum (creates banding illusion but allows more precise magn...
@ gpGrayscale
Continuous lightness from black to white (suited for non-biased data representation).
@ gpCold
Continuous lightness from black over icey colors to white (suited for non-biased data representation)...
@ gpThermal
Colors suitable for thermal imaging, ranging from dark blue over purple to orange,...
QVector< QRgb > mColorBuffer
Holds the two-dimensional data of a QCPColorMap plottable.
QCPRange keyRange() const
QCPRange valueRange() const
QCPColorMapData(int keySize, int valueSize, const QCPRange &keyRange, const QCPRange &valueRange)
Constructs a new QCPColorMapData instance.
QCPRange dataBounds() const
bool isEmpty() const
Returns whether this instance carries no data.
QCPColorMapData & operator=(const QCPColorMapData &other)
Overwrites this color map data instance with the data stored in other.
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
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
virtual void draw(QCPPainter *painter)
void dataRangeChanged(QCPRange newRange)
This signal is emitted when the data range changes.
void setInterpolate(bool enabled)
Sets whether the color map image shall use bicubic interpolation when displaying the color map shrink...
bool tightBoundary() const
virtual void updateMapImage()
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
Q_SLOT void setGradient(const QCPColorGradient &gradient)
Sets the color gradient that is used to represent the data.
QCPColorMapData * mMapData
QPointer< QCPColorScale > mColorScale
void dataScaleTypeChanged(QCPAxis::ScaleType scaleType)
This signal is emitted when the data scale type changes.
Q_SLOT void setDataRange(const QCPRange &dataRange)
Sets the data range of this color map to dataRange.
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
Sets whether the data is correlated with the color gradient linearly or logarithmically.
QCPColorMap(QCPAxis *keyAxis, QCPAxis *valueAxis)
Constructs a color map with the specified keyAxis and valueAxis.
void setColorScale(QCPColorScale *colorScale)
Associates the color scale colorScale with this color map.
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
void setTightBoundary(bool enabled)
Sets whether the outer most data rows and columns are clipped to the specified key and value range (s...
QCPRange dataRange() const
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
bool mGradientImageInvalidated
QCPColorScale * mParentColorScale
friend class QCPColorScale
Q_SLOT void axisSelectionChanged(QCPAxis::SelectableParts selectedParts)
Q_SLOT void axisSelectableChanged(QCPAxis::SelectableParts selectableParts)
void updateGradientImage()
QCPColorScaleAxisRectPrivate(QCPColorScale *parentColorScale)
Creates a new instance, as a child of parentColorScale.
virtual void draw(QCPPainter *painter)
A color scale for use with color coding data such as QCPColorMap.
virtual void mouseReleaseEvent(QMouseEvent *event)
This event is called, if the mouse was previously pressed inside the outer rect of this layout elemen...
friend class QCPColorScaleAxisRectPrivate
void setType(QCPAxis::AxisType type)
Sets at which side of the color scale the axis is placed, and thus also its orientation.
Q_SLOT void setGradient(const QCPColorGradient &gradient)
Sets the color gradient that will be used to represent data values.
void setRangeDrag(bool enabled)
Sets whether the user can drag the data range (setDataRange).
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.
virtual void mouseMoveEvent(QMouseEvent *event)
This event is called, if the mouse is moved inside the outer rect of this layout element.
QCPRange dataRange() 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...
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
void setRangeZoom(bool enabled)
Sets whether the user can zoom the data range (setDataRange) by scrolling the mouse wheel.
QCPColorScale(QCustomPlot *parentPlot)
Constructs a new QCPColorScale.
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...
void setBarWidth(int width)
Sets the width (or height, for horizontal color scales) the bar where the gradient is displayed will ...
Q_SLOT void setDataRange(const QCPRange &dataRange)
Sets the range spanned by the color gradient and that is shown by the axis in the color scale.
QCPAxis::ScaleType dataScaleType() const
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QCPColorGradient mGradient
Q_SLOT void setDataScaleType(QCPAxis::ScaleType scaleType)
Sets the scale type of the color scale, i.e.
void setLabel(const QString &str)
Sets the axis label of the color scale.
Holds the data of one single data point for QCPCurve.
QCPCurveData()
Constructs a curve data point with t, key and value set to zero.
A plottable representing a parametric curve in a plot.
virtual void drawScatterPlot(QCPPainter *painter, const QVector< QPointF > *pointData) const
LineStyle lineStyle() const
QCPScatterStyle mScatterStyle
QCPCurveDataMap * data() const
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
virtual void draw(QCPPainter *painter)
LineStyle
Defines how the curve's line is represented visually in the plot.
@ lsLine
Data points are connected with a straight line.
@ lsNone
No line is drawn between data points (e.g. only scatters).
QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis)
Constructs a curve which uses keyAxis as its key axis ("x") and valueAxis as its value axis ("y").
void getCurveData(QVector< QPointF > *lineData) const
QPointF outsideCoordsToPixels(double key, double value, int region, QRect axisRect) const
void setLineStyle(LineStyle style)
Sets how the single data points are connected in the plot or how they are represented visually apart ...
void setScatterStyle(const QCPScatterStyle &style)
Sets the visual appearance of single data points in the plot.
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
double pointDistance(const QPointF &pixelPoint) const
QCPScatterStyle scatterStyle() const
Holds the data of one single data point for QCPGraph.
QCPData()
Constructs a data point with key, value and all errors set to zero.
A plottable representing a graph in a plot.
QCPGraph(QCPAxis *keyAxis, QCPAxis *valueAxis)
Constructs a graph which uses keyAxis as its key axis ("x") and valueAxis as its value axis ("y").
void setErrorBarSize(double size)
Sets the width of the handles at both ends of an error bar in pixels.
void setScatterStyle(const QCPScatterStyle &style)
Sets the visual appearance of single data points in the plot.
bool adaptiveSampling() const
ErrorType errorType() const
void setChannelFillGraph(QCPGraph *targetGraph)
Sets the target graph for filling the area between this graph and targetGraph with the current brush ...
QPointer< QCPGraph > mChannelFillGraph
QCPScatterStyle scatterStyle() const
QCPScatterStyle mScatterStyle
void setLineStyle(LineStyle ls)
Sets how the single data points are connected in the plot.
void getStepRightPlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
int findIndexBelowY(const QVector< QPointF > *data, double y) const
double errorBarSize() const
void getPlotData(QVector< QPointF > *lineData, QVector< QCPData > *scatterData) const
virtual void draw(QCPPainter *painter)
void getScatterPlotData(QVector< QCPData > *scatterData) const
void getLinePlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
QPointF upperFillBasePoint(double upperKey) const
bool errorBarSkipSymbol() const
int findIndexAboveY(const QVector< QPointF > *data, double y) const
int findIndexBelowX(const QVector< QPointF > *data, double x) const
void addFillBasePoints(QVector< QPointF > *lineData) const
void getStepLeftPlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
double pointDistance(const QPointF &pixelPoint) const
virtual void drawFill(QCPPainter *painter, QVector< QPointF > *lineData) const
int findIndexAboveX(const QVector< QPointF > *data, double x) const
void getImpulsePlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
void setErrorBarSkipSymbol(bool enabled)
If enabled is set to true, the error bar will not be drawn as a solid line under the scatter symbol b...
void setAdaptiveSampling(bool enabled)
Sets whether adaptive sampling shall be used when plotting this graph.
void drawError(QCPPainter *painter, double x, double y, const QCPData &data) const
void getStepCenterPlotData(QVector< QPointF > *linePixelData, QVector< QCPData > *scatterData) const
void setErrorPen(const QPen &pen)
Sets the pen with which the error bars will be drawn.
void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper) const
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void setErrorType(ErrorType errorType)
Sets which kind of error bars (Key Error, Value Error or both) should be drawn on each data point.
LineStyle lineStyle() const
virtual void drawImpulsePlot(QCPPainter *painter, QVector< QPointF > *lineData) const
QCPDataMap * data() const
Returns a pointer to the internal data storage of type QCPDataMap.
QPointF lowerFillBasePoint(double lowerKey) const
ErrorType
Defines what kind of error bars are drawn for each data point.
@ etValue
Error bars for the value dimension of the data point are shown.
@ etKey
Error bars for the key dimension of the data point are shown.
@ etBoth
Error bars for both key and value dimensions of the data point are shown.
@ etNone
No error bars are shown.
LineStyle
Defines how the graph's line is represented visually in the plot.
@ lsLine
data points are connected by a straight line
@ lsStepCenter
line is drawn as steps where the step is in between two data points
@ lsStepRight
line is drawn as steps where the step height is the value of the right data point
@ lsImpulse
each data point is represented by a line parallel to the value axis, which reaches from the data poin...
@ lsStepLeft
line is drawn as steps where the step height is the value of the left data point
@ lsNone
data points are not connected with any lines (e.g.
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
const QPolygonF getChannelFillPolygon(const QVector< QPointF > *lineData) const
virtual void drawScatterPlot(QCPPainter *painter, QVector< QCPData > *scatterData) const
int countDataInBounds(const QCPDataMap::const_iterator &lower, const QCPDataMap::const_iterator &upper, int maxCount) const
void getPreparedData(QVector< QCPData > *lineData, QVector< QCPData > *scatterData) const
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
QCPGraph * channelFillGraph() const
virtual void drawLinePlot(QCPPainter *painter, QVector< QPointF > *lineData) const
void removeFillBasePoints(QVector< QPointF > *lineData) const
void setZeroLinePen(const QPen &pen)
Sets the pen with which zero lines are drawn.
void setAntialiasedZeroLine(bool enabled)
Sets whether zero lines are drawn antialiased.
void setAntialiasedSubGrid(bool enabled)
Sets whether sub grid lines are drawn antialiased.
bool antialiasedZeroLine() const
void drawSubGridLines(QCPPainter *painter) const
bool mAntialiasedZeroLine
void setSubGridPen(const QPen &pen)
Sets the pen with which sub grid lines are drawn.
void setPen(const QPen &pen)
Sets the pen with which (major) grid lines are drawn.
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QCPGrid(QCPAxis *parentAxis)
Creates a QCPGrid instance and sets default values.
virtual void draw(QCPPainter *painter)
void setSubGridVisible(bool visible)
Sets whether grid lines at sub tick marks are drawn.
void drawGridLines(QCPPainter *painter) 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
friend class QCPItemPosition
virtual QCPItemPosition * toQCPItemPosition()
Returns 0 if this instance is merely a QCPItemAnchor, and a valid pointer of type QCPItemPosition* if...
QCPItemAnchor(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString name, int anchorId=-1)
Creates a new QCPItemAnchor.
A bracket for referencing/highlighting certain parts in the plot.
QCPItemAnchor *const center
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the bracket when selected.
QCPItemBracket(QCustomPlot *parentPlot)
Creates a bracket item and sets default values.
virtual QPointF anchorPixelPoint(int anchorId) const
BracketStyle style() const
void setStyle(BracketStyle style)
Sets the style of the bracket, i.e.
@ bsRound
A brace with round edges.
@ bsSquare
A brace with angled edges.
@ bsCalligraphic
A curly brace with varying stroke width giving a calligraphic impression.
virtual void draw(QCPPainter *painter)
void setPen(const QPen &pen)
Sets the pen that will be used to draw the bracket.
void setLength(double length)
Sets the length in pixels how far the bracket extends in the direction towards the embraced span of t...
QCPItemPosition *const left
QCPItemPosition *const right
void setPen(const QPen &pen)
Sets the pen that will be used to draw the line.
void setHead(const QCPLineEnding &head)
Sets the line ending style of the head.
QCPItemPosition *const start
QCPItemPosition *const end
QCPItemPosition *const endDir
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the line when selected.
virtual void draw(QCPPainter *painter)
QCPLineEnding head() const
QCPItemPosition *const startDir
QCPLineEnding tail() const
void setTail(const QCPLineEnding &tail)
Sets the line ending style of the tail.
QCPItemCurve(QCustomPlot *parentPlot)
Creates a curve item and sets default values.
QCPItemPosition *const topLeft
QCPItemAnchor *const bottom
QCPItemAnchor *const bottomLeftRim
QCPItemAnchor *const topLeftRim
void setBrush(const QBrush &brush)
Sets the brush that will be used to fill the ellipse.
QCPItemAnchor *const right
QCPItemAnchor *const bottomRightRim
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the line of the ellipse when selected.
QCPItemAnchor *const topRightRim
QCPItemEllipse(QCustomPlot *parentPlot)
Creates an ellipse item and sets default values.
QCPItemAnchor *const center
void setSelectedBrush(const QBrush &brush)
Sets the brush that will be used to fill the ellipse when selected.
QCPItemAnchor *const left
QCPItemPosition *const bottomRight
virtual QPointF anchorPixelPoint(int anchorId) const
void setPen(const QPen &pen)
Sets the pen that will be used to draw the line of the ellipse.
virtual void draw(QCPPainter *painter)
QBrush selectedBrush() const
QCPItemPosition *const end
QCPItemLine(QCustomPlot *parentPlot)
Creates a line item and sets default values.
virtual void draw(QCPPainter *painter)
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the line when selected.
void setPen(const QPen &pen)
Sets the pen that will be used to draw the line.
QCPItemPosition *const start
QCPLineEnding head() const
QCPLineEnding tail() const
void setTail(const QCPLineEnding &tail)
Sets the line ending style of the tail.
QLineF getRectClippedLine(const QVector2D &start, const QVector2D &end, const QRect &rect) const
void setHead(const QCPLineEnding &head)
Sets the line ending style of the head.
QCPItemAnchor *const bottomLeft
virtual QPointF anchorPixelPoint(int anchorId) const
QCPItemPosition *const topLeft
QRect getFinalRect(bool *flippedHorz=0, bool *flippedVert=0) const
Qt::AspectRatioMode aspectRatioMode() const
void setPixmap(const QPixmap &pixmap)
Sets the pixmap that will be displayed.
QCPItemAnchor *const topRight
virtual void draw(QCPPainter *painter)
void updateScaledPixmap(QRect finalRect=QRect(), bool flipHorz=false, bool flipVert=false)
QCPItemAnchor *const left
Qt::AspectRatioMode mAspectRatioMode
QCPItemPixmap(QCustomPlot *parentPlot)
Creates a rectangle item and sets default values.
QCPItemPosition *const bottomRight
QCPItemAnchor *const right
void setPen(const QPen &pen)
Sets the pen that will be used to draw a border around the pixmap.
QCPItemAnchor *const bottom
void setScaled(bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio)
Sets whether the pixmap will be scaled to fit the rectangle defined by the topLeft and bottomRight po...
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw a border around the pixmap when selected.
Manages the position of an item.
QCPItemAnchor * parentAnchor() const
QCPItemAnchor * mParentAnchor
QCPItemPosition(QCustomPlot *parentPlot, QCPAbstractItem *parentItem, const QString name)
Creates a new QCPItemPosition.
QPointer< QCPAxis > mValueAxis
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.
@ ptAxisRectRatio
Static positioning given by a fraction of the axis rect size (see setAxisRect).
@ ptAbsolute
Static positioning in pixels, starting from the top left corner of the viewport/widget.
@ ptViewportRatio
Static positioning given by a fraction of the viewport size.
@ ptPlotCoords
Dynamic positioning at a plot coordinate defined by two axes (see setAxes).
QCPAxis * keyAxis() const
PositionType type() const
PositionType mPositionType
QPointer< QCPAxisRect > mAxisRect
virtual void draw(QCPPainter *painter)
QBrush selectedBrush() const
QCPItemPosition *const bottomRight
QCPItemRect(QCustomPlot *parentPlot)
Creates a rectangle item and sets default values.
void setPen(const QPen &pen)
Sets the pen that will be used to draw the line of the rectangle.
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the line of the rectangle when selected.
QCPItemAnchor *const topRight
QCPItemAnchor *const right
QCPItemAnchor *const bottom
QCPItemPosition *const topLeft
QCPItemAnchor *const left
void setBrush(const QBrush &brush)
Sets the brush that will be used to fill the rectangle.
void setSelectedBrush(const QBrush &brush)
Sets the brush that will be used to fill the rectangle when selected.
QCPItemAnchor *const bottomLeft
virtual QPointF anchorPixelPoint(int anchorId) const
double distToStraightLine(const QVector2D &point1, const QVector2D &vec, const QVector2D &point) const
virtual void draw(QCPPainter *painter)
QCPItemStraightLine(QCustomPlot *parentPlot)
Creates a straight line item and sets default values.
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the line when selected.
void setPen(const QPen &pen)
Sets the pen that will be used to draw the line.
QCPItemPosition *const point1
QCPItemPosition *const point2
QLineF getRectClippedStraightLine(const QVector2D &point1, const QVector2D &vec, const QRect &rect) const
void setSelectedFont(const QFont &font)
Sets the font of the text that will be used when the item is selected.
QCPItemPosition *const position
Qt::Alignment positionAlignment() const
void setBrush(const QBrush &brush)
Sets the brush that will be used do fill the background of the text.
void setSelectedPen(const QPen &pen)
Sets the pen that will be used do draw a rectangular border around the text, when the item is selecte...
QBrush selectedBrush() const
void setText(const QString &text)
Sets the text that will be displayed.
virtual QPointF anchorPixelPoint(int anchorId) const
void setRotation(double degrees)
Sets the angle in degrees by which the text (and the text rectangle, if visible) will be rotated arou...
QPointF getTextDrawPoint(const QPointF &pos, const QRectF &rect, Qt::Alignment positionAlignment) const
QCPItemAnchor *const topLeft
QCPItemAnchor *const bottomLeft
void setSelectedBrush(const QBrush &brush)
Sets the brush that will be used do fill the background of the text, when the item is selected.
Qt::Alignment mPositionAlignment
QColor selectedColor() const
QFont selectedFont() const
QCPItemText(QCustomPlot *parentPlot)
Creates a text item and sets default values.
void setPositionAlignment(Qt::Alignment alignment)
Sets which point of the text rect shall be aligned with position.
virtual void draw(QCPPainter *painter)
QCPItemAnchor *const bottomRight
void setFont(const QFont &font)
Sets the font of the text.
QCPItemAnchor *const bottom
Qt::Alignment textAlignment() const
void setPen(const QPen &pen)
Sets the pen that will be used do draw a rectangular border around the text.
void setColor(const QColor &color)
Sets the color of the text.
void setTextAlignment(Qt::Alignment alignment)
Controls how (multi-lined) text is aligned inside the text rect (typically Qt::AlignLeft,...
QCPItemAnchor *const left
Qt::Alignment mTextAlignment
QCPItemAnchor *const topRight
void setSelectedColor(const QColor &color)
Sets the color of the text that will be used when the item is selected.
void setPadding(const QMargins &padding)
Sets the distance between the border of the text rectangle and the text.
QCPItemAnchor *const right
Item that sticks to QCPGraph data points.
void setSelectedBrush(const QBrush &brush)
Sets the brush that will be used to draw any fills of the tracer, when selected.
void setBrush(const QBrush &brush)
Sets the brush that will be used to draw any fills of the tracer.
TracerStyle
The different visual appearances a tracer item can have.
@ tsPlus
A plus shaped crosshair with limited size.
@ tsNone
The tracer is not visible.
@ tsCrosshair
A plus shaped crosshair which spans the complete axis rect.
void setStyle(TracerStyle style)
Sets the style/visual appearance of the tracer.
void setGraphKey(double key)
Sets the key of the graph's data point the tracer will be positioned at.
QCPItemPosition *const position
void setInterpolating(bool enabled)
Sets whether the value of the graph's data points shall be interpolated, when positioning the tracer.
virtual void draw(QCPPainter *painter)
QCPItemTracer(QCustomPlot *parentPlot)
Creates a tracer item and sets default values.
void setSelectedPen(const QPen &pen)
Sets the pen that will be used to draw the line of the tracer when selected.
QBrush selectedBrush() const
void setSize(double size)
Sets the size of the tracer in pixels, if the style supports setting a size (e.g.
bool interpolating() const
void setGraph(QCPGraph *graph)
Sets the QCPGraph this tracer sticks to.
void setPen(const QPen &pen)
Sets the pen that will be used to draw the line of the tracer.
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
void addChild(QCPLayerable *layerable, bool prepend)
QCPLayer(QCustomPlot *parentPlot, const QString &layerName)
Creates a new QCPLayer instance.
QList< QCPLayerable * > mChildren
QCustomPlot * parentPlot() const
void setVisible(bool visible)
Sets whether this layer is visible or not.
void removeChild(QCPLayerable *layerable)
int index() const
Returns the index this layer has in the QCustomPlot.
friend class QCPLayerable
Base class for all drawable objects.
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const =0
QPointer< QCPLayerable > mParentLayerable
QCustomPlot * parentPlot() const
void setVisible(bool on)
Sets the visibility of this layerable object.
void setAntialiased(bool enabled)
Sets whether this object will be drawn antialiased or not.
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
QCPLayerable(QCustomPlot *plot, QString targetLayer="", QCPLayerable *parentLayerable=0)
Creates a new QCPLayerable instance.
void initializeParentPlot(QCustomPlot *parentPlot)
virtual QCP::Interaction selectionCategory() const
void setParentLayerable(QCPLayerable *parentLayerable)
QCustomPlot * mParentPlot
QCPLayerable * parentLayerable() const
Returns the parent layerable of this layerable.
Q_SLOT bool setLayer(QCPLayer *layer)
Sets the layer of this layerable object.
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
void layerChanged(QCPLayer *newLayer)
This signal is emitted when the layer of this layerable changes, i.e.
void applyAntialiasingHint(QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
virtual QRect clipRect() const
virtual void draw(QCPPainter *painter)=0
virtual void deselectEvent(bool *selectionStateChanged)
bool moveToLayer(QCPLayer *layer, bool prepend)
The abstract base class for all objects that form the layout system.
virtual int calculateAutoMargin(QCP::MarginSide side)
virtual void mousePressEvent(QMouseEvent *event)
This event is called, if the mouse was pressed while being inside the outer rect of this layout eleme...
void setMinimumMargins(const QMargins &margins)
If setAutoMargins is enabled on some or all margins, this function is used to provide minimum values ...
UpdatePhase
Defines the phases of the update process, that happens just before a replot.
@ upMargins
Phase in which the margins are calculated and set.
@ upLayout
Final phase in which the layout system places the rects of the elements.
@ upPreparation
Phase used for any type of preparation that needs to be done before margin calculation and layout.
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 mouseReleaseEvent(QMouseEvent *event)
This event is called, if the mouse was previously pressed inside the outer rect of this layout elemen...
void setOuterRect(const QRect &rect)
Sets the outer rect of this layout element.
QCPLayout * layout() const
Returns the parent layout of this layout element.
virtual void draw(QCPPainter *painter)
void setMinimumSize(const QSize &size)
Sets the minimum size for the inner rect of this layout element.
QMargins minimumMargins() const
QSize minimumSize() const
void setMaximumSize(const QSize &size)
Sets the maximum size for the inner rect of this layout element.
virtual void mouseDoubleClickEvent(QMouseEvent *event)
This event is called, if the mouse is double-clicked inside the outer rect of this layout element.
QCPLayoutElement(QCustomPlot *parentPlot=0)
Creates an instance of QCPLayoutElement and sets default values.
void setMargins(const QMargins &margins)
Sets the margins of this layout element.
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
friend class QCPMarginGroup
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 * 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.
int rowCount() const
Returns the number of rows in the layout.
int columnCount() const
Returns the number of columns in the layout.
void setRowStretchFactors(const QList< double > &factors)
Sets the stretch factors of all rows.
QList< QList< QCPLayoutElement * > > mElements
QList< double > mRowStretchFactors
QList< double > rowStretchFactors() const
void setColumnSpacing(int pixels)
Sets the gap that is left blank between columns to pixels.
void getMinimumRowColSizes(QVector< int > *minColWidths, QVector< int > *minRowHeights) const
void setColumnStretchFactors(const QList< double > &factors)
Sets the stretch factors of all columns.
QList< double > columnStretchFactors() const
void getMaximumRowColSizes(QVector< int > *maxColWidths, QVector< int > *maxRowHeights) const
void setRowSpacing(int pixels)
Sets the gap that is left blank between rows to pixels.
QCPLayoutGrid()
Creates an instance of QCPLayoutGrid and sets default values.
QList< double > mColumnStretchFactors
int columnSpacing() const
A layout that places child elements aligned to the border or arbitrarily positioned.
QCPLayoutInset()
Creates an instance of QCPLayoutInset and sets default values.
QList< Qt::Alignment > mInsetAlignment
QList< InsetPlacement > mInsetPlacement
virtual void simplify()
The QCPInsetLayout does not need simplification since it can never have empty cells due to its linear...
InsetPlacement
Defines how the placement and sizing is handled for a certain element in a QCPLayoutInset.
@ ipFree
The element may be positioned/sized arbitrarily, see setInsetRect.
@ ipBorderAligned
The element is aligned to one of the layout sides, see setInsetAlignment.
QList< QCPLayoutElement * > mElements
QList< QRectF > mInsetRect
The abstract base class for layouts.
void clear()
Removes and deletes all layout elements in this layout.
QCPLayout()
Creates an instance of QCPLayout and sets default values.
friend class QCPLayoutElement
virtual void updateLayout()
bool removeAt(int index)
Removes and deletes the element at the provided index.
virtual void update(UpdatePhase phase)
First calls the QCPLayoutElement::update base class implementation to update the margins on this layo...
QVector< int > getSectionSizes(QVector< int > maxSizes, QVector< int > minSizes, QVector< double > stretchFactors, int totalSize) const
virtual void simplify()
Simplifies the layout by collapsing empty cells.
void releaseElement(QCPLayoutElement *el)
bool remove(QCPLayoutElement *element)
Removes and deletes the provided element.
virtual QCPLayoutElement * takeAt(int index)=0
Removes the element with the given index from the layout and returns it.
virtual QCPLayoutElement * elementAt(int index) const =0
Returns the element in the cell with the given index.
virtual int elementCount() const =0
Returns the number of elements/cells in the layout.
virtual bool take(QCPLayoutElement *element)=0
Removes the specified element from the layout and returns true on success.
virtual QList< QCPLayoutElement * > elements(bool recursive) const
Returns a list of all child elements in this layout element.
void sizeConstraintsChanged() const
Subclasses call this method to report changed (minimum/maximum) size constraints.
void adoptElement(QCPLayoutElement *el)
Manages a legend inside a QCustomPlot.
QCPLegend()
Constructs a new QCPLegend instance with parentPlot as the containing plot and default values.
SelectableParts mSelectableParts
int iconTextPadding() const
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QPen getBorderPen() const
Q_SLOT void setSelectedParts(const SelectableParts &selectedParts)
Sets the selected state of the respective legend parts described by SelectablePart.
void setSelectedBorderPen(const QPen &pen)
When the legend box is selected, this pen is used to draw the border instead of the normal pen set vi...
void setIconBorderPen(const QPen &pen)
Sets the pen used to draw a border around each legend icon.
SelectableParts selectedParts() const
virtual void draw(QCPPainter *painter)
QFont selectedFont() const
void setBrush(const QBrush &brush)
Sets the brush of the legend background.
virtual void parentPlotInitialized(QCustomPlot *parentPlot)
virtual void deselectEvent(bool *selectionStateChanged)
SelectablePart
Defines the selectable parts of a legend.
@ spLegendBox
0x001 The legend box (frame)
@ spItems
0x002 Legend items individually (see selectedItems)
QPen iconBorderPen() const
void setIconTextPadding(int padding)
Sets the horizontal space in pixels between the legend icon and the text next to it.
QColor mSelectedTextColor
QPen mSelectedIconBorderPen
void setSelectedTextColor(const QColor &color)
Sets the default text color that is used by legend items when they are selected.
QBrush selectedBrush() const
void selectionChanged(QCPLegend::SelectableParts parts)
This signal is emitted when the selection state of this legend has changed.
void setBorderPen(const QPen &pen)
Sets the pen, the border of the entire legend is drawn with.
void setSelectedBrush(const QBrush &brush)
When the legend box is selected, this brush is used to draw the legend background instead of the norm...
friend class QCPAbstractLegendItem
void selectableChanged(QCPLegend::SelectableParts parts)
void setIconSize(const QSize &size)
Sets the size of legend icons.
virtual QCP::Interaction selectionCategory() const
SelectableParts mSelectedParts
Q_SLOT void setSelectableParts(const SelectableParts &selectableParts)
Sets whether the user can (de-)select the parts in selectable by clicking on the QCustomPlot surface.
void setFont(const QFont &font)
Sets the default font of legend text.
void setSelectedFont(const QFont &font)
Sets the default font that is used by legend items when they are selected.
QColor selectedTextColor() const
SelectableParts selectableParts() const
QPen selectedIconBorderPen() const
QPen selectedBorderPen() const
void setSelectedIconBorderPen(const QPen &pen)
Sets the pen legend items will use to draw their icon borders, when they are selected.
void setTextColor(const QColor &color)
Sets the default color of legend text.
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
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.
@ esHalfBar
A bar perpendicular to the line, pointing out to only one side (to which side can be changed with set...
@ esSkewedBar
A bar that is skewed (skew controllable via setLength).
@ esBar
A bar perpendicular to the line.
@ esDiamond
A filled diamond (45° rotated square).
@ esFlatArrow
A filled arrow head with a straight/flat back (a triangle).
@ esLineArrow
A non-filled arrow head with open back.
@ esSpikeArrow
A filled arrow head with an indented back.
@ esNone
No ending decoration.
@ esSquare
A filled square.
QCPLineEnding()
Creates a QCPLineEnding instance with default values (style esNone).
A margin group allows synchronization of margin sides if working with multiple layout elements.
friend class QCPLayoutElement
void removeChild(QCP::MarginSide side, QCPLayoutElement *element)
QCustomPlot * mParentPlot
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
QCPMarginGroup(QCustomPlot *parentPlot)
Creates a new QCPMarginGroup instance in parentPlot.
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
Returns a list of all layout elements that have their margin side associated with this margin group.
void addChild(QCP::MarginSide side, QCPLayoutElement *element)
int commonMargin(QCP::MarginSide side) const
QPainter subclass used internally.
QStack< bool > mAntialiasingStack
PainterMode
Defines special modes the painter can operate in.
@ pmDefault
0x00 Default mode for painting on screen devices
@ pmNonCosmetic
0x04 Turns pen widths 0 to 1, i.e. disables cosmetic pens. (A cosmetic pen is always drawn with width...
@ pmNoCaching
0x02 Mode for all sorts of exports (e.g. PNG, PDF,...). For example, this prevents using cached pixma...
@ pmVectorized
0x01 Mode for vectorized painting (e.g. PDF export). For example, this prevents some antialiasing fix...
QCPPainter()
Creates a new QCPPainter instance and sets default values.
bool antialiasing() const
void drawLine(const QPointF &p1, const QPointF &p2)
PainterModes modes() const
A layout element displaying a plot title text.
void setSelectedTextColor(const QColor &color)
Sets the color of the title text that will be used if the plot title is selected (setSelected).
void setFont(const QFont &font)
Sets the font of the title text.
virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged)
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 setSelectedFont(const QFont &font)
Sets the font of the title text that will be used if the plot title is selected (setSelected).
void selectableChanged(bool selectable)
void setTextColor(const QColor &color)
Sets the color of the title text.
Q_SLOT void setSelectable(bool selectable)
Sets whether the user may select this plot title to selectable.
QColor mSelectedTextColor
Q_SLOT void setSelected(bool selected)
Sets the selection state of this plot title to selected.
QCPPlotTitle(QCustomPlot *parentPlot)
Creates a new QCPPlotTitle instance and sets default values.
void setText(const QString &text)
Sets the text that will be displayed to text.
QColor mainTextColor() const
virtual void deselectEvent(bool *selectionStateChanged)
QColor selectedTextColor() const
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
virtual QSize maximumSizeHint() const
Returns the maximum size this layout element (the inner rect) may be expanded to.
virtual void draw(QCPPainter *painter)
virtual QSize minimumSizeHint() const
Returns the minimum size this layout element (the inner rect) may be compressed to.
A legend item representing a plottable with an icon and the plottable name.
virtual QSize minimumSizeHint() const
Returns the minimum size this layout element (the inner rect) may be compressed to.
QColor getTextColor() const
virtual void draw(QCPPainter *painter)
QCPAbstractPlottable * plottable()
QCPPlottableLegendItem(QCPLegend *parent, QCPAbstractPlottable *plottable)
Creates a new legend item associated with plottable.
QCPAbstractPlottable * mPlottable
QPen getIconBorderPen() const
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()
Constructs a range with lower and upper set to zero.
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.
QCPScatterStyle()
Creates a new QCPScatterStyle instance with size set to 6.
ScatterShape
Defines the shape used for scatter points.
@ ssDot
\enumimage{ssDot.png} a single pixel (use ssDisc or ssCircle if you want a round shape with a certain...
@ ssCustom
custom painter operations are performed per scatter (As QPainterPath, see setCustomPath)
@ ssSquare
\enumimage{ssSquare.png} a square
@ ssDisc
\enumimage{ssDisc.png} a circle which is filled with the pen's color (not the brush as with ssCircle)
@ ssPlus
\enumimage{ssPlus.png} a plus
@ ssDiamond
\enumimage{ssDiamond.png} a diamond
@ ssCrossCircle
\enumimage{ssCrossCircle.png} a circle with a cross inside
@ ssPlusSquare
\enumimage{ssPlusSquare.png} a square with a plus inside
@ ssStar
\enumimage{ssStar.png} a star with eight arms, i.e. a combination of cross and plus
@ ssTriangleInverted
\enumimage{ssTriangleInverted.png} an equilateral triangle, standing on corner
@ ssPlusCircle
\enumimage{ssPlusCircle.png} a circle with a plus inside
@ ssCrossSquare
\enumimage{ssCrossSquare.png} a square with a cross inside
@ ssTriangle
\enumimage{ssTriangle.png} an equilateral triangle, standing on baseline
@ ssCircle
\enumimage{ssCircle.png} a circle
@ ssPixmap
a custom pixmap specified by setPixmap, centered on the data point coordinates
@ ssCross
\enumimage{ssCross.png} a cross
@ ssNone
no scatter symbols are drawn (e.g. in QCPGraph, data only represented with lines)
@ ssPeace
\enumimage{ssPeace.png} a circle, with one vertical and two downward diagonal lines
QPainterPath customPath() const
ScatterShape shape() const
void setWidth(double width)
Sets the width of the box in key coordinates.
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
QVector< double > mOutliers
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const
QPen whiskerBarPen() const
void setWhiskerPen(const QPen &pen)
Sets the pen used for drawing the whisker backbone (That's the line parallel to the value axis).
virtual void drawMedian(QCPPainter *painter) const
void setMedian(double value)
Sets the parameter "median" of the statistical box plot.
void setUpperQuartile(double value)
Sets the parameter "upper Quartile" of the statistical box plot.
void setLowerQuartile(double value)
Sets the parameter "lower Quartile" of the statistical box plot.
virtual void drawQuartileBox(QCPPainter *painter, QRectF *quartileBox=0) const
void setMedianPen(const QPen &pen)
Sets the pen used for drawing the median indicator line inside the statistical box.
virtual void draw(QCPPainter *painter)
QCPStatisticalBox(QCPAxis *keyAxis, QCPAxis *valueAxis)
Constructs a statistical box which uses keyAxis as its key axis ("x") and valueAxis as its value axis...
void setKey(double key)
Sets the key coordinate of the statistical box.
void setMinimum(double value)
Sets the parameter "minimum" of the statistical box plot.
virtual void drawOutliers(QCPPainter *painter) const
QVector< double > outliers() const
void setWhiskerBarPen(const QPen &pen)
Sets the pen used for drawing the whisker bars (Those are the lines parallel to the key axis at each ...
double whiskerWidth() const
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const
void setMaximum(double value)
Sets the parameter "maximum" of the statistical box plot.
void setOutlierStyle(const QCPScatterStyle &style)
Sets the appearance of the outlier data points.
void setWhiskerWidth(double width)
Sets the width of the whiskers (setMinimum, setMaximum) in key coordinates.
QCPScatterStyle mOutlierStyle
virtual void drawWhiskers(QCPPainter *painter) const
QCPScatterStyle outlierStyle() const
void setOutliers(const QVector< double > &values)
Sets a vector of outlier values that will be drawn as scatters.
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.
void drawBackground(QCPPainter *painter)
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
virtual QSize minimumSizeHint() const
QCPLayerable * layerableAt(const QPointF &pos, bool onlySelectable, QVariant *selectionDetails=0) const
void setBackground(const QPixmap &pm)
Sets pm as the viewport background pixmap (see setViewport).
virtual void resizeEvent(QResizeEvent *event)
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
QCP::AntialiasedElements mNotAntialiasedElements
virtual void paintEvent(QPaintEvent *event)
const QCP::Interactions interactions() const
QPointer< QCPLayoutElement > mMouseEventElement
QCPAbstractPlottable * plottable(int index)
Returns the plottable with index.
void setBackgroundScaled(bool scaled)
Sets whether the viewport background pixmap shall be scaled to fit the viewport.
void setViewport(const QRect &rect)
Sets the viewport of this QCustomPlot.
QCustomPlot(QWidget *parent=0)
Constructs a QCustomPlot and sets reasonable default values.
RefreshPriority
Defines with what timing the QCustomPlot surface is refreshed after a replot.
@ rpImmediate
The QCustomPlot surface is immediately refreshed, by calling QWidget::repaint() after the replot.
@ rpQueued
Queues the refresh such that it is performed at a slightly delayed point in time after the replot,...
@ rpHint
Whether to use immediate repaint or queued update depends on whether the plotting hint QCP::phForceRe...
void setBackgroundScaledMode(Qt::AspectRatioMode mode)
If scaling of the viewport background pixmap is enabled (setBackgroundScaled), use this function to d...
void setSelectionTolerance(int pixels)
Sets the tolerance that is used to decide whether a click selects an object (e.g.
void selectionChangedByUser()
This signal is emitted after the user has changed the selection in the QCustomPlot,...
virtual QSize sizeHint() const
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...
virtual void mouseReleaseEvent(QMouseEvent *event)
QList< QCPLayer * > mLayers
QCPLegend * legend
A pointer to the default legend of the main axis rect.
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.
@ limAbove
Layer is inserted above other layer.
@ limBelow
Layer is inserted below other layer.
virtual void mouseDoubleClickEvent(QMouseEvent *event)
void setNoAntialiasingOnDrag(bool enabled)
Sets whether antialiasing is disabled for this QCustomPlot while the user is dragging axes ranges.
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
This signal is emitted when a legend (item) is clicked.
virtual void wheelEvent(QWheelEvent *event)
void updateLayerIndices() const
virtual void axisRemoved(QCPAxis *axis)
void setMultiSelectModifier(Qt::KeyboardModifier modifier)
Sets the keyboard modifier that will be recognized as multi-select-modifier.
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.
virtual void legendRemoved(QCPLegend *legend)
QCP::PlottingHints mPlottingHints
QCP::AntialiasedElements mAntialiasedElements
bool backgroundScaled() const
bool mAutoAddPlottableToLegend
Qt::AspectRatioMode mBackgroundScaledMode
virtual void mousePressEvent(QMouseEvent *event)
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
This signal is emitted when an axis is clicked.
QCPAbstractItem * item(int index) const
Returns the item with index.
bool autoAddPlottableToLegend() const
virtual void mouseMoveEvent(QMouseEvent *event)
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
virtual void draw(QCPPainter *painter)
void setAutoAddPlottableToLegend(bool on)
If set to true, adding a plottable (e.g.
QCPAxis * xAxis2
A pointer to the secondary x Axis (top) of the main axis rect of the plot.
QList< QCPGraph * > mGraphs
void itemClick(QCPAbstractItem *item, QMouseEvent *event)
This signal is emitted when an item is clicked.
QPixmap mBackgroundPixmap
QCPAxis * yAxis2
A pointer to the secondary y Axis (right) of the main axis rect of the plot.
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.
QCPAxis * yAxis
A pointer to the primary y Axis (left) of the main axis rect of the plot.
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, QCPData > QCPDataMap
Container for storing QCPData items in a sorted fashion.
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, 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.