38 #include <QPaintEvent> 39 #include <QMouseEvent> 53 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) 54 # include <qnumeric.h> 56 # include <QPrintEngine> 59 # include <QtPrintSupport> 87 #if defined(QCUSTOMPLOT_COMPILE_LIBRARY) 88 # define QCP_LIB_DECL Q_DECL_EXPORT 89 #elif defined(QCUSTOMPLOT_USE_LIBRARY) 90 # define QCP_LIB_DECL Q_DECL_IMPORT 179 return qIsNaN(value) || qIsInf(value);
204 case QCP::msTop: margins.setTop(value);
break;
206 case QCP::msAll: margins = QMargins(value, value, value, value);
break;
233 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
234 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
235 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
236 Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
277 QCPScatterStyle(
const QPainterPath &customPath,
const QPen &pen,
const QBrush &brush=Qt::NoBrush,
double size=6);
280 double size()
const {
return mSize; }
282 QPen
pen()
const {
return mPen; }
283 QBrush
brush()
const {
return mBrush; }
284 QPixmap
pixmap()
const {
return mPixmap; }
288 void setSize(
double size);
290 void setPen(
const QPen &pen);
291 void setBrush(
const QBrush &brush);
292 void setPixmap(
const QPixmap &pixmap);
293 void setCustomPath(
const QPainterPath &customPath);
296 bool isNone()
const {
return mShape == ssNone; }
298 void applyTo(
QCPPainter *painter,
const QPen &defaultPen)
const;
299 void drawShape(
QCPPainter *painter, QPointF pos)
const;
300 void drawShape(
QCPPainter *painter,
double x,
double y)
const;
328 ,pmNonCosmetic = 0x04
334 QCPPainter(QPaintDevice *device);
338 bool antialiasing()
const {
return testRenderHint(QPainter::Antialiasing); }
339 PainterModes
modes()
const {
return mModes; }
342 void setAntialiasing(
bool enabled);
344 void setModes(PainterModes modes);
347 bool begin(QPaintDevice *device);
348 void setPen(
const QPen &pen);
349 void setPen(
const QColor &color);
350 void setPen(Qt::PenStyle penStyle);
351 void drawLine(
const QLineF &line);
357 void makeNonCosmetic();
367 Q_DECLARE_OPERATORS_FOR_FLAGS(QCPPainter::PainterModes)
374 Q_PROPERTY(
QCustomPlot* parentPlot READ parentPlot)
375 Q_PROPERTY(QString name READ name)
376 Q_PROPERTY(
int index READ index)
377 Q_PROPERTY(QList<QCPLayerable*> children READ children)
378 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
386 QString
name()
const {
return mName; }
387 int index()
const {
return mIndex; }
388 QList<QCPLayerable*>
children()
const {
return mChildren; }
392 void setVisible(
bool visible);
417 Q_PROPERTY(
bool visible READ visible WRITE setVisible)
418 Q_PROPERTY(QCustomPlot* parentPlot READ parentPlot)
419 Q_PROPERTY(QCPLayerable* parentLayerable READ parentLayerable)
420 Q_PROPERTY(
QCPLayer* layer READ layer WRITE setLayer NOTIFY layerChanged)
421 Q_PROPERTY(
bool antialiased READ antialiased WRITE setAntialiased)
424 QCPLayerable(QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0);
435 void setVisible(
bool on);
436 Q_SLOT
bool setLayer(
QCPLayer *layer);
437 bool setLayer(
const QString &layerName);
438 void setAntialiased(
bool enabled);
441 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
444 bool realVisibility()
const;
447 void layerChanged(
QCPLayer *newLayer);
458 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
460 virtual QRect clipRect()
const;
461 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const = 0;
464 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
465 virtual void deselectEvent(
bool *selectionStateChanged);
468 void initializeParentPlot(QCustomPlot *parentPlot);
469 void setParentLayerable(QCPLayerable* parentLayerable);
470 bool moveToLayer(
QCPLayer *layer,
bool prepend);
474 Q_DISABLE_COPY(QCPLayerable)
476 friend class QCustomPlot;
487 QCPRange(
double lower,
double upper);
490 bool operator!=(
const QCPRange& other)
const {
return !(*
this == other); }
492 QCPRange &
operator+=(
const double& value) { lower+=value; upper+=value;
return *
this; }
493 QCPRange &
operator-=(
const double& value) { lower-=value; upper-=value;
return *
this; }
494 QCPRange &
operator*=(
const double& value) { lower*=value; upper*=value;
return *
this; }
495 QCPRange &
operator/=(
const double& value) { lower/=value; upper/=value;
return *
this; }
496 friend inline const QCPRange
operator+(
const QCPRange&,
double);
497 friend inline const QCPRange
operator+(
double,
const QCPRange&);
498 friend inline const QCPRange
operator-(
const QCPRange& range,
double value);
499 friend inline const QCPRange
operator*(
const QCPRange& range,
double value);
500 friend inline const QCPRange
operator*(
double value,
const QCPRange& range);
501 friend inline const QCPRange
operator/(
const QCPRange& range,
double value);
504 double center()
const;
506 void expand(
const QCPRange &otherRange);
507 QCPRange expanded(
const QCPRange &otherRange)
const;
508 QCPRange sanitizedForLogScale()
const;
509 QCPRange sanitizedForLinScale()
const;
510 bool contains(
double value)
const;
512 static bool validRange(
double lower,
double upper);
513 static bool validRange(
const QCPRange &range);
614 bool isEmpty()
const;
620 QHash<QCP::MarginSide, QList<QCPLayoutElement*> >
mChildren;
638 Q_PROPERTY(
QCPLayout* layout READ layout)
639 Q_PROPERTY(QRect rect READ rect)
640 Q_PROPERTY(QRect outerRect READ outerRect WRITE setOuterRect)
641 Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
642 Q_PROPERTY(QMargins minimumMargins READ minimumMargins WRITE setMinimumMargins)
643 Q_PROPERTY(QSize minimumSize READ minimumSize WRITE setMinimumSize)
644 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
657 explicit QCPLayoutElement(QCustomPlot *parentPlot=0);
658 virtual ~QCPLayoutElement();
662 QRect
rect()
const {
return mRect; }
670 QHash<QCP::MarginSide, QCPMarginGroup*>
marginGroups()
const {
return mMarginGroups; }
673 void setOuterRect(
const QRect &rect);
674 void setMargins(
const QMargins &margins);
675 void setMinimumMargins(
const QMargins &margins);
676 void setAutoMargins(QCP::MarginSides sides);
677 void setMinimumSize(
const QSize &size);
678 void setMinimumSize(
int width,
int height);
679 void setMaximumSize(
const QSize &size);
680 void setMaximumSize(
int width,
int height);
681 void setMarginGroup(QCP::MarginSides sides,
QCPMarginGroup *group);
685 virtual QSize minimumSizeHint()
const;
686 virtual QSize maximumSizeHint()
const;
687 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
690 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
708 virtual void wheelEvent(QWheelEvent *event) {Q_UNUSED(event)}
713 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
716 Q_DISABLE_COPY(QCPLayoutElement)
718 friend class QCustomPlot;
728 explicit QCPLayout();
732 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
735 virtual int elementCount()
const = 0;
736 virtual QCPLayoutElement* elementAt(
int index)
const = 0;
737 virtual QCPLayoutElement* takeAt(
int index) = 0;
738 virtual bool take(QCPLayoutElement* element) = 0;
739 virtual void simplify();
742 bool removeAt(
int index);
743 bool remove(QCPLayoutElement* element);
748 virtual void updateLayout();
751 void sizeConstraintsChanged()
const;
752 void adoptElement(QCPLayoutElement *el);
753 void releaseElement(QCPLayoutElement *el);
754 QVector<int> getSectionSizes(QVector<int> maxSizes, QVector<int> minSizes, QVector<double> stretchFactors,
int totalSize)
const;
757 Q_DISABLE_COPY(QCPLayout)
758 friend class QCPLayoutElement;
766 Q_PROPERTY(
int rowCount READ rowCount)
767 Q_PROPERTY(
int columnCount READ columnCount)
768 Q_PROPERTY(QList<double> columnStretchFactors READ columnStretchFactors WRITE setColumnStretchFactors)
769 Q_PROPERTY(QList<double> rowStretchFactors READ rowStretchFactors WRITE setRowStretchFactors)
770 Q_PROPERTY(
int columnSpacing READ columnSpacing WRITE setColumnSpacing)
771 Q_PROPERTY(
int rowSpacing READ rowSpacing WRITE setRowSpacing)
778 int rowCount()
const;
779 int columnCount()
const;
786 void setColumnStretchFactor(
int column,
double factor);
787 void setColumnStretchFactors(
const QList<double> &factors);
788 void setRowStretchFactor(
int row,
double factor);
789 void setRowStretchFactors(
const QList<double> &factors);
790 void setColumnSpacing(
int pixels);
791 void setRowSpacing(
int pixels);
794 virtual void updateLayout();
795 virtual int elementCount()
const;
796 virtual QCPLayoutElement* elementAt(
int index)
const;
797 virtual QCPLayoutElement* takeAt(
int index);
798 virtual bool take(QCPLayoutElement* element);
799 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
800 virtual void simplify();
801 virtual QSize minimumSizeHint()
const;
802 virtual QSize maximumSizeHint()
const;
805 QCPLayoutElement *element(
int row,
int column)
const;
806 bool addElement(
int row,
int column, QCPLayoutElement *element);
807 bool hasElement(
int row,
int column);
808 void expandTo(
int newRowCount,
int newColumnCount);
809 void insertRow(
int newIndex);
810 void insertColumn(
int newIndex);
820 void getMinimumRowColSizes(QVector<int> *minColWidths, QVector<int> *minRowHeights)
const;
821 void getMaximumRowColSizes(QVector<int> *maxColWidths, QVector<int> *maxRowHeights)
const;
844 Qt::Alignment insetAlignment(
int index)
const;
845 QRectF insetRect(
int index)
const;
849 void setInsetAlignment(
int index, Qt::Alignment alignment);
850 void setInsetRect(
int index,
const QRectF &rect);
853 virtual void updateLayout();
854 virtual int elementCount()
const;
859 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
910 double width()
const {
return mWidth; }
911 double length()
const {
return mLength; }
916 void setWidth(
double width);
917 void setLength(
double length);
918 void setInverted(
bool inverted);
921 double boundingDistance()
const;
922 double realLength()
const;
923 void draw(
QCPPainter *painter,
const QVector2D &pos,
const QVector2D &dir)
const;
924 void draw(
QCPPainter *painter,
const QVector2D &pos,
double angle)
const;
939 Q_PROPERTY(
bool subGridVisible READ subGridVisible WRITE setSubGridVisible)
940 Q_PROPERTY(
bool antialiasedSubGrid READ antialiasedSubGrid WRITE setAntialiasedSubGrid)
941 Q_PROPERTY(
bool antialiasedZeroLine READ antialiasedZeroLine WRITE setAntialiasedZeroLine)
942 Q_PROPERTY(QPen pen READ pen WRITE setPen)
943 Q_PROPERTY(QPen subGridPen READ subGridPen WRITE setSubGridPen)
944 Q_PROPERTY(QPen zeroLinePen READ zeroLinePen WRITE setZeroLinePen)
953 QPen
pen()
const {
return mPen; }
958 void setSubGridVisible(
bool visible);
959 void setAntialiasedSubGrid(
bool enabled);
960 void setAntialiasedZeroLine(
bool enabled);
961 void setPen(
const QPen &pen);
962 void setSubGridPen(
const QPen &pen);
963 void setZeroLinePen(
const QPen &pen);
974 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
978 void drawGridLines(
QCPPainter *painter)
const;
979 void drawSubGridLines(
QCPPainter *painter)
const;
989 Q_PROPERTY(
AxisType axisType READ axisType)
991 Q_PROPERTY(
ScaleType scaleType READ scaleType WRITE setScaleType NOTIFY scaleTypeChanged)
992 Q_PROPERTY(
double scaleLogBase READ scaleLogBase WRITE setScaleLogBase)
993 Q_PROPERTY(
QCPRange range READ range WRITE setRange NOTIFY rangeChanged)
994 Q_PROPERTY(
bool rangeReversed READ rangeReversed WRITE setRangeReversed)
995 Q_PROPERTY(
bool autoTicks READ autoTicks WRITE setAutoTicks)
996 Q_PROPERTY(
int autoTickCount READ autoTickCount WRITE setAutoTickCount)
997 Q_PROPERTY(
bool autoTickLabels READ autoTickLabels WRITE setAutoTickLabels)
998 Q_PROPERTY(
bool autoTickStep READ autoTickStep WRITE setAutoTickStep)
999 Q_PROPERTY(
bool autoSubTicks READ autoSubTicks WRITE setAutoSubTicks)
1000 Q_PROPERTY(
bool ticks READ ticks WRITE setTicks)
1001 Q_PROPERTY(
bool tickLabels READ tickLabels WRITE setTickLabels)
1002 Q_PROPERTY(
int tickLabelPadding READ tickLabelPadding WRITE setTickLabelPadding)
1003 Q_PROPERTY(
LabelType tickLabelType READ tickLabelType WRITE setTickLabelType)
1004 Q_PROPERTY(QFont tickLabelFont READ tickLabelFont WRITE setTickLabelFont)
1005 Q_PROPERTY(QColor tickLabelColor READ tickLabelColor WRITE setTickLabelColor)
1006 Q_PROPERTY(
double tickLabelRotation READ tickLabelRotation WRITE setTickLabelRotation)
1007 Q_PROPERTY(
LabelSide tickLabelSide READ tickLabelSide WRITE setTickLabelSide)
1008 Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat)
1009 Q_PROPERTY(Qt::TimeSpec dateTimeSpec READ dateTimeSpec WRITE setDateTimeSpec)
1010 Q_PROPERTY(QString numberFormat READ numberFormat WRITE setNumberFormat)
1011 Q_PROPERTY(
int numberPrecision READ numberPrecision WRITE setNumberPrecision)
1012 Q_PROPERTY(
double tickStep READ tickStep WRITE setTickStep)
1013 Q_PROPERTY(QVector<double> tickVector READ tickVector WRITE setTickVector)
1014 Q_PROPERTY(QVector<QString> tickVectorLabels READ tickVectorLabels WRITE setTickVectorLabels)
1015 Q_PROPERTY(
int tickLengthIn READ tickLengthIn WRITE setTickLengthIn)
1016 Q_PROPERTY(
int tickLengthOut READ tickLengthOut WRITE setTickLengthOut)
1017 Q_PROPERTY(
int subTickCount READ subTickCount WRITE setSubTickCount)
1018 Q_PROPERTY(
int subTickLengthIn READ subTickLengthIn WRITE setSubTickLengthIn)
1019 Q_PROPERTY(
int subTickLengthOut READ subTickLengthOut WRITE setSubTickLengthOut)
1020 Q_PROPERTY(QPen basePen READ basePen WRITE setBasePen)
1021 Q_PROPERTY(QPen tickPen READ tickPen WRITE setTickPen)
1022 Q_PROPERTY(QPen subTickPen READ subTickPen WRITE setSubTickPen)
1023 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont)
1024 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor)
1025 Q_PROPERTY(QString label READ label WRITE setLabel)
1026 Q_PROPERTY(
int labelPadding READ labelPadding WRITE setLabelPadding)
1027 Q_PROPERTY(
int padding READ padding WRITE setPadding)
1028 Q_PROPERTY(
int offset READ offset WRITE setOffset)
1029 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectionChanged)
1030 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectableChanged)
1031 Q_PROPERTY(QFont selectedTickLabelFont READ selectedTickLabelFont WRITE setSelectedTickLabelFont)
1032 Q_PROPERTY(QFont selectedLabelFont READ selectedLabelFont WRITE setSelectedLabelFont)
1033 Q_PROPERTY(QColor selectedTickLabelColor READ selectedTickLabelColor WRITE setSelectedTickLabelColor)
1034 Q_PROPERTY(QColor selectedLabelColor READ selectedLabelColor WRITE setSelectedLabelColor)
1035 Q_PROPERTY(QPen selectedBasePen READ selectedBasePen WRITE setSelectedBasePen)
1036 Q_PROPERTY(QPen selectedTickPen READ selectedTickPen WRITE setSelectedTickPen)
1037 Q_PROPERTY(QPen selectedSubTickPen READ selectedSubTickPen WRITE setSelectedSubTickPen)
1038 Q_PROPERTY(
QCPLineEnding lowerEnding READ lowerEnding WRITE setLowerEnding)
1039 Q_PROPERTY(
QCPLineEnding upperEnding READ upperEnding WRITE setUpperEnding)
1040 Q_PROPERTY(
QCPGrid* grid READ grid)
1053 Q_DECLARE_FLAGS(AxisTypes,
AxisType)
1087 ,spTickLabels = 0x002
1088 ,spAxisLabel = 0x004
1110 int tickLabelPadding()
const;
1114 double tickLabelRotation()
const;
1118 QString numberFormat()
const;
1123 int tickLengthIn()
const;
1124 int tickLengthOut()
const;
1126 int subTickLengthIn()
const;
1127 int subTickLengthOut()
const;
1133 QString
label()
const {
return mLabel; }
1134 int labelPadding()
const;
1152 void setScaleLogBase(
double base);
1153 Q_SLOT
void setRange(
const QCPRange &range);
1154 void setRange(
double lower,
double upper);
1155 void setRange(
double position,
double size, Qt::AlignmentFlag alignment);
1156 void setRangeLower(
double lower);
1157 void setRangeUpper(
double upper);
1158 void setRangeReversed(
bool reversed);
1159 void setAutoTicks(
bool on);
1160 void setAutoTickCount(
int approximateCount);
1161 void setAutoTickLabels(
bool on);
1162 void setAutoTickStep(
bool on);
1163 void setAutoSubTicks(
bool on);
1164 void setTicks(
bool show);
1165 void setTickLabels(
bool show);
1166 void setTickLabelPadding(
int padding);
1168 void setTickLabelFont(
const QFont &font);
1169 void setTickLabelColor(
const QColor &color);
1170 void setTickLabelRotation(
double degrees);
1172 void setDateTimeFormat(
const QString &format);
1173 void setDateTimeSpec(
const Qt::TimeSpec &timeSpec);
1174 void setNumberFormat(
const QString &formatCode);
1175 void setNumberPrecision(
int precision);
1176 void setTickStep(
double step);
1177 void setTickVector(
const QVector<double> &vec);
1178 void setTickVectorLabels(
const QVector<QString> &vec);
1179 void setTickLength(
int inside,
int outside=0);
1180 void setTickLengthIn(
int inside);
1181 void setTickLengthOut(
int outside);
1182 void setSubTickCount(
int count);
1183 void setSubTickLength(
int inside,
int outside=0);
1184 void setSubTickLengthIn(
int inside);
1185 void setSubTickLengthOut(
int outside);
1186 void setBasePen(
const QPen &pen);
1187 void setTickPen(
const QPen &pen);
1188 void setSubTickPen(
const QPen &pen);
1189 void setLabelFont(
const QFont &font);
1190 void setLabelColor(
const QColor &color);
1191 void setLabel(
const QString &str);
1192 void setLabelPadding(
int padding);
1193 void setPadding(
int padding);
1194 void setOffset(
int offset);
1195 void setSelectedTickLabelFont(
const QFont &font);
1196 void setSelectedLabelFont(
const QFont &font);
1197 void setSelectedTickLabelColor(
const QColor &color);
1198 void setSelectedLabelColor(
const QColor &color);
1199 void setSelectedBasePen(
const QPen &pen);
1200 void setSelectedTickPen(
const QPen &pen);
1201 void setSelectedSubTickPen(
const QPen &pen);
1202 Q_SLOT
void setSelectableParts(
const QCPAxis::SelectableParts &selectableParts);
1203 Q_SLOT
void setSelectedParts(
const QCPAxis::SelectableParts &selectedParts);
1208 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
1212 void moveRange(
double diff);
1213 void scaleRange(
double factor,
double center);
1214 void setScaleRatio(
const QCPAxis *otherAxis,
double ratio=1.0);
1215 void rescale(
bool onlyVisiblePlottables=
false);
1216 double pixelToCoord(
double value)
const;
1217 double coordToPixel(
double value)
const;
1219 QList<QCPAbstractPlottable*> plottables()
const;
1220 QList<QCPGraph*> graphs()
const;
1221 QList<QCPAbstractItem*> items()
const;
1224 static Qt::Orientation
orientation(
AxisType type) {
return type==atBottom||type==atTop ? Qt::Horizontal : Qt::Vertical; }
1228 void ticksRequest();
1229 void rangeChanged(
const QCPRange &newRange);
1232 void selectionChanged(
const QCPAxis::SelectableParts &parts);
1233 void selectableChanged(
const QCPAxis::SelectableParts &parts);
1289 virtual void setupTickVectors();
1290 virtual void generateAutoTicks();
1291 virtual int calculateAutoSubTickCount(
double tickStep)
const;
1292 virtual int calculateMargin();
1295 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1299 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1300 virtual void deselectEvent(
bool *selectionStateChanged);
1303 void visibleTickBounds(
int &lowIndex,
int &highIndex)
const;
1304 double baseLog(
double value)
const;
1305 double basePow(
double value)
const;
1306 QPen getBasePen()
const;
1307 QPen getTickPen()
const;
1308 QPen getSubTickPen()
const;
1309 QFont getTickLabelFont()
const;
1310 QFont getLabelFont()
const;
1311 QColor getTickLabelColor()
const;
1312 QColor getLabelColor()
const;
1317 friend class QCustomPlot;
1321 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::SelectableParts)
1322 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPAxis::AxisTypes)
1329 explicit QCPAxisPainterPrivate(QCustomPlot *parentPlot);
1330 virtual ~QCPAxisPainterPrivate();
1333 virtual int size()
const;
1383 virtual QByteArray generateLabelParameterHash()
const;
1385 virtual void placeTickLabel(
QCPPainter *painter,
double position,
int distanceToAxis,
const QString &text, QSize *tickLabelsSize);
1387 virtual TickLabelData getTickLabelData(
const QFont &font,
const QString &text)
const;
1388 virtual QPointF getTickLabelDrawOffset(
const TickLabelData &labelData)
const;
1389 virtual void getMaxTickLabelSize(
const QFont &font,
const QString &text, QSize *tickLabelsSize)
const;
1397 Q_PROPERTY(QString name READ name WRITE setName)
1398 Q_PROPERTY(
bool antialiasedFill READ antialiasedFill WRITE setAntialiasedFill)
1399 Q_PROPERTY(
bool antialiasedScatters READ antialiasedScatters WRITE setAntialiasedScatters)
1400 Q_PROPERTY(
bool antialiasedErrorBars READ antialiasedErrorBars WRITE setAntialiasedErrorBars)
1401 Q_PROPERTY(QPen pen READ pen WRITE setPen)
1402 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
1403 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
1404 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
1405 Q_PROPERTY(
QCPAxis* keyAxis READ keyAxis WRITE setKeyAxis)
1406 Q_PROPERTY(
QCPAxis* valueAxis READ valueAxis WRITE setValueAxis)
1407 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1408 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1414 QString
name()
const {
return mName; }
1418 QPen
pen()
const {
return mPen; }
1428 void setName(
const QString &name);
1429 void setAntialiasedFill(
bool enabled);
1430 void setAntialiasedScatters(
bool enabled);
1431 void setAntialiasedErrorBars(
bool enabled);
1432 void setPen(
const QPen &pen);
1433 void setSelectedPen(
const QPen &pen);
1434 void setBrush(
const QBrush &brush);
1435 void setSelectedBrush(
const QBrush &brush);
1436 void setKeyAxis(
QCPAxis *axis);
1437 void setValueAxis(
QCPAxis *axis);
1438 Q_SLOT
void setSelectable(
bool selectable);
1439 Q_SLOT
void setSelected(
bool selected);
1442 virtual void clearData() = 0;
1443 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1444 virtual bool addToLegend();
1445 virtual bool removeFromLegend()
const;
1448 void rescaleAxes(
bool onlyEnlarge=
false)
const;
1449 void rescaleKeyAxis(
bool onlyEnlarge=
false)
const;
1450 void rescaleValueAxis(
bool onlyEnlarge=
false)
const;
1453 void selectionChanged(
bool selected);
1454 void selectableChanged(
bool selectable);
1474 virtual QRect clipRect()
const;
1477 void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1479 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1480 virtual void deselectEvent(
bool *selectionStateChanged);
1483 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const = 0;
1484 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const = 0;
1485 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const = 0;
1488 void coordsToPixels(
double key,
double value,
double &x,
double &y)
const;
1489 const QPointF coordsToPixels(
double key,
double value)
const;
1490 void pixelsToCoords(
double x,
double y,
double &key,
double &value)
const;
1491 void pixelsToCoords(
const QPointF &pixelPos,
double &key,
double &value)
const;
1492 QPen mainPen()
const;
1493 QBrush mainBrush()
const;
1494 void applyFillAntialiasingHint(
QCPPainter *painter)
const;
1495 void applyScattersAntialiasingHint(
QCPPainter *painter)
const;
1496 void applyErrorBarsAntialiasingHint(
QCPPainter *painter)
const;
1497 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1502 friend class QCustomPlot;
1511 QCPItemAnchor(QCustomPlot *parentPlot,
QCPAbstractItem *parentItem,
const QString name,
int anchorId=-1);
1512 virtual ~QCPItemAnchor();
1515 QString
name()
const {
return mName; }
1516 virtual QPointF pixelPoint()
const;
1538 Q_DISABLE_COPY(QCPItemAnchor)
1564 QCPItemPosition(QCustomPlot *parentPlot,
QCPAbstractItem *parentItem,
const QString name);
1565 virtual ~QCPItemPosition();
1574 double key()
const {
return mKey; }
1576 QPointF
coords()
const {
return QPointF(mKey, mValue); }
1577 QCPAxis *
keyAxis()
const {
return mKeyAxis.data(); }
1580 virtual QPointF pixelPoint()
const;
1586 bool setParentAnchor(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1587 bool setParentAnchorX(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1588 bool setParentAnchorY(QCPItemAnchor *parentAnchor,
bool keepPixelPosition=
false);
1589 void setCoords(
double key,
double value);
1590 void setCoords(
const QPointF &coords);
1591 void setAxes(QCPAxis* keyAxis, QCPAxis* valueAxis);
1593 void setPixelPoint(
const QPointF &pixelPoint);
1607 Q_DISABLE_COPY(QCPItemPosition)
1616 Q_PROPERTY(
bool clipToAxisRect READ clipToAxisRect WRITE setClipToAxisRect)
1617 Q_PROPERTY(
QCPAxisRect* clipAxisRect READ clipAxisRect WRITE setClipAxisRect)
1618 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
1619 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
1632 void setClipToAxisRect(
bool clip);
1634 Q_SLOT
void setSelectable(
bool selectable);
1635 Q_SLOT
void setSelected(
bool selected);
1638 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const = 0;
1641 QList<QCPItemPosition*>
positions()
const {
return mPositions; }
1642 QList<QCPItemAnchor*>
anchors()
const {
return mAnchors; }
1645 bool hasAnchor(
const QString &name)
const;
1648 void selectionChanged(
bool selected);
1649 void selectableChanged(
bool selectable);
1661 virtual QRect clipRect()
const;
1662 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
1665 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
1666 virtual void deselectEvent(
bool *selectionStateChanged);
1669 virtual QPointF anchorPixelPoint(
int anchorId)
const;
1672 double distSqrToLine(
const QPointF &start,
const QPointF &end,
const QPointF &point)
const;
1673 double rectSelectTest(
const QRectF &rect,
const QPointF &pos,
bool filledRect)
const;
1675 QCPItemAnchor *createAnchor(
const QString &name,
int anchorId);
1680 friend class QCustomPlot;
1689 Q_PROPERTY(QRect viewport READ viewport WRITE setViewport)
1690 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
1691 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
1692 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
1694 Q_PROPERTY(
bool autoAddPlottableToLegend READ autoAddPlottableToLegend WRITE setAutoAddPlottableToLegend)
1695 Q_PROPERTY(
int selectionTolerance READ selectionTolerance WRITE setSelectionTolerance)
1696 Q_PROPERTY(
bool noAntialiasingOnDrag READ noAntialiasingOnDrag WRITE setNoAntialiasingOnDrag)
1697 Q_PROPERTY(Qt::KeyboardModifier multiSelectModifier READ multiSelectModifier WRITE setMultiSelectModifier)
1720 explicit QCustomPlot(QWidget *parent = 0);
1721 virtual ~QCustomPlot();
1739 void setViewport(
const QRect &rect);
1740 void setBackground(
const QPixmap &pm);
1741 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
1742 void setBackground(
const QBrush &brush);
1743 void setBackgroundScaled(
bool scaled);
1744 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
1745 void setAntialiasedElements(
const QCP::AntialiasedElements &antialiasedElements);
1747 void setNotAntialiasedElements(
const QCP::AntialiasedElements ¬AntialiasedElements);
1749 void setAutoAddPlottableToLegend(
bool on);
1750 void setInteractions(
const QCP::Interactions &interactions);
1751 void setInteraction(
const QCP::Interaction &interaction,
bool enabled=
true);
1752 void setSelectionTolerance(
int pixels);
1753 void setNoAntialiasingOnDrag(
bool enabled);
1754 void setPlottingHints(
const QCP::PlottingHints &hints);
1756 void setMultiSelectModifier(Qt::KeyboardModifier modifier);
1764 bool removePlottable(
int index);
1765 int clearPlottables();
1766 int plottableCount()
const;
1767 QList<QCPAbstractPlottable*> selectedPlottables()
const;
1776 bool removeGraph(
int index);
1778 int graphCount()
const;
1779 QList<QCPGraph*> selectedGraphs()
const;
1786 bool removeItem(
int index);
1788 int itemCount()
const;
1789 QList<QCPAbstractItem*> selectedItems()
const;
1790 QCPAbstractItem *itemAt(
const QPointF &pos,
bool onlySelectable=
false)
const;
1794 QCPLayer *layer(
const QString &name)
const;
1797 bool setCurrentLayer(
const QString &name);
1798 bool setCurrentLayer(
QCPLayer *layer);
1799 int layerCount()
const;
1805 int axisRectCount()
const;
1807 QList<QCPAxisRect*> axisRects()
const;
1809 Q_SLOT
void rescaleAxes(
bool onlyVisiblePlottables=
false);
1811 QList<QCPAxis*> selectedAxes()
const;
1812 QList<QCPLegend*> selectedLegends()
const;
1813 Q_SLOT
void deselectAll();
1815 bool savePdf(
const QString &fileName,
bool noCosmeticPen=
false,
int width=0,
int height=0,
const QString &pdfCreator=QString(),
const QString &pdfTitle=QString());
1816 bool savePng(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1817 bool saveJpg(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0,
int quality=-1);
1818 bool saveBmp(
const QString &fileName,
int width=0,
int height=0,
double scale=1.0);
1819 bool saveRastered(
const QString &fileName,
int width,
int height,
double scale,
const char *format,
int quality=-1);
1820 QPixmap toPixmap(
int width=0,
int height=0,
double scale=1.0);
1821 void toPainter(
QCPPainter *painter,
int width=0,
int height=0);
1828 void mouseDoubleClick(QMouseEvent *event);
1829 void mousePress(QMouseEvent *event);
1830 void mouseMove(QMouseEvent *event);
1831 void mouseRelease(QMouseEvent *event);
1832 void mouseWheel(QWheelEvent *event);
1842 void titleClick(QMouseEvent *event,
QCPPlotTitle *title);
1843 void titleDoubleClick(QMouseEvent *event,
QCPPlotTitle *title);
1845 void selectionChangedByUser();
1846 void beforeReplot();
1878 virtual QSize minimumSizeHint()
const;
1879 virtual QSize sizeHint()
const;
1880 virtual void paintEvent(QPaintEvent *event);
1881 virtual void resizeEvent(QResizeEvent *event);
1882 virtual void mouseDoubleClickEvent(QMouseEvent *event);
1883 virtual void mousePressEvent(QMouseEvent *event);
1884 virtual void mouseMoveEvent(QMouseEvent *event);
1885 virtual void mouseReleaseEvent(QMouseEvent *event);
1886 virtual void wheelEvent(QWheelEvent *event);
1890 virtual void axisRemoved(
QCPAxis *axis);
1891 virtual void legendRemoved(
QCPLegend *legend);
1894 void updateLayerIndices()
const;
1895 QCPLayerable *layerableAt(
const QPointF &pos,
bool onlySelectable, QVariant *selectionDetails=0)
const;
1994 void setLevelCount(
int n);
1995 void setColorStops(
const QMap<double, QColor> &colorStops);
1996 void setColorStopAt(
double position,
const QColor &color);
1998 void setPeriodic(
bool enabled);
2001 void colorize(
const double *data,
const QCPRange &range, QRgb *scanLine,
int n,
int dataIndexFactor=1,
bool logarithmic=
false);
2002 QRgb color(
double position,
const QCPRange &range,
bool logarithmic=
false);
2004 void clearColorStops();
2008 void updateColorBuffer();
2026 Q_PROPERTY(QPixmap background READ background WRITE setBackground)
2027 Q_PROPERTY(
bool backgroundScaled READ backgroundScaled WRITE setBackgroundScaled)
2028 Q_PROPERTY(Qt::AspectRatioMode backgroundScaledMode READ backgroundScaledMode WRITE setBackgroundScaledMode)
2029 Q_PROPERTY(Qt::Orientations rangeDrag READ rangeDrag WRITE setRangeDrag)
2030 Q_PROPERTY(Qt::Orientations rangeZoom READ rangeZoom WRITE setRangeZoom)
2033 explicit QCPAxisRect(QCustomPlot *parentPlot,
bool setupDefaultAxes=
true);
2042 QCPAxis *rangeDragAxis(Qt::Orientation orientation);
2043 QCPAxis *rangeZoomAxis(Qt::Orientation orientation);
2044 double rangeZoomFactor(Qt::Orientation orientation);
2047 void setBackground(
const QPixmap &pm);
2048 void setBackground(
const QPixmap &pm,
bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
2049 void setBackground(
const QBrush &brush);
2050 void setBackgroundScaled(
bool scaled);
2051 void setBackgroundScaledMode(Qt::AspectRatioMode mode);
2052 void setRangeDrag(Qt::Orientations orientations);
2053 void setRangeZoom(Qt::Orientations orientations);
2056 void setRangeZoomFactor(
double horizontalFactor,
double verticalFactor);
2057 void setRangeZoomFactor(
double factor);
2062 QList<QCPAxis*> axes(QCPAxis::AxisTypes types)
const;
2063 QList<QCPAxis*> axes()
const;
2065 QList<QCPAxis*> addAxes(QCPAxis::AxisTypes types);
2066 bool removeAxis(
QCPAxis *axis);
2069 void setupFullAxesBox(
bool connectRanges=
false);
2070 QList<QCPAbstractPlottable*> plottables()
const;
2071 QList<QCPGraph*> graphs()
const;
2072 QList<QCPAbstractItem*> items()
const;
2075 int left()
const {
return mRect.left(); }
2076 int right()
const {
return mRect.right(); }
2077 int top()
const {
return mRect.top(); }
2078 int bottom()
const {
return mRect.bottom(); }
2079 int width()
const {
return mRect.width(); }
2080 int height()
const {
return mRect.height(); }
2081 QSize
size()
const {
return mRect.size(); }
2082 QPoint
topLeft()
const {
return mRect.topLeft(); }
2086 QPoint
center()
const {
return mRect.center(); }
2090 virtual QList<QCPLayoutElement*> elements(
bool recursive)
const;
2108 QHash<QCPAxis::AxisType, QList<QCPAxis*> >
mAxes;
2111 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2115 virtual void mousePressEvent(QMouseEvent *event);
2116 virtual void mouseMoveEvent(QMouseEvent *event);
2117 virtual void mouseReleaseEvent(QMouseEvent *event);
2118 virtual void wheelEvent(QWheelEvent *event);
2127 friend class QCustomPlot;
2135 Q_PROPERTY(
QCPLegend* parentLegend READ parentLegend)
2136 Q_PROPERTY(QFont font READ font WRITE setFont)
2137 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2138 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2139 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2140 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectionChanged)
2141 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectableChanged)
2148 QFont
font()
const {
return mFont; }
2156 void setFont(
const QFont &font);
2157 void setTextColor(
const QColor &color);
2158 void setSelectedFont(
const QFont &font);
2159 void setSelectedTextColor(
const QColor &color);
2160 Q_SLOT
void setSelectable(
bool selectable);
2161 Q_SLOT
void setSelected(
bool selected);
2164 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2167 void selectionChanged(
bool selected);
2168 void selectableChanged(
bool selectable);
2181 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2182 virtual QRect clipRect()
const;
2185 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2186 virtual void deselectEvent(
bool *selectionStateChanged);
2210 virtual QSize minimumSizeHint()
const;
2213 QPen getIconBorderPen()
const;
2214 QColor getTextColor()
const;
2215 QFont getFont()
const;
2223 Q_PROPERTY(QPen borderPen READ borderPen WRITE setBorderPen)
2224 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
2225 Q_PROPERTY(QFont font READ font WRITE setFont)
2226 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2227 Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
2228 Q_PROPERTY(
int iconTextPadding READ iconTextPadding WRITE setIconTextPadding)
2229 Q_PROPERTY(QPen iconBorderPen READ iconBorderPen WRITE setIconBorderPen)
2230 Q_PROPERTY(SelectableParts selectableParts READ selectableParts WRITE setSelectableParts NOTIFY selectionChanged)
2231 Q_PROPERTY(SelectableParts selectedParts READ selectedParts WRITE setSelectedParts NOTIFY selectableChanged)
2232 Q_PROPERTY(QPen selectedBorderPen READ selectedBorderPen WRITE setSelectedBorderPen)
2233 Q_PROPERTY(QPen selectedIconBorderPen READ selectedIconBorderPen WRITE setSelectedIconBorderPen)
2234 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
2235 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2236 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2245 ,spLegendBox = 0x001
2252 virtual ~QCPLegend();
2255 QPen borderPen()
const {
return mBorderPen; }
2257 QFont
font()
const {
return mFont; }
2263 SelectableParts selectedParts()
const;
2271 void setBorderPen(
const QPen &pen);
2272 void setBrush(
const QBrush &brush);
2273 void setFont(
const QFont &font);
2274 void setTextColor(
const QColor &color);
2275 void setIconSize(
const QSize &size);
2276 void setIconSize(
int width,
int height);
2277 void setIconTextPadding(
int padding);
2278 void setIconBorderPen(
const QPen &pen);
2279 Q_SLOT
void setSelectableParts(
const SelectableParts &selectableParts);
2280 Q_SLOT
void setSelectedParts(
const SelectableParts &selectedParts);
2281 void setSelectedBorderPen(
const QPen &pen);
2282 void setSelectedIconBorderPen(
const QPen &pen);
2283 void setSelectedBrush(
const QBrush &brush);
2284 void setSelectedFont(
const QFont &font);
2285 void setSelectedTextColor(
const QColor &color);
2288 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2293 int itemCount()
const;
2297 bool removeItem(
int index);
2300 QList<QCPAbstractLegendItem*> selectedItems()
const;
2303 void selectionChanged(QCPLegend::SelectableParts parts);
2304 void selectableChanged(QCPLegend::SelectableParts parts);
2321 virtual void parentPlotInitialized(QCustomPlot *parentPlot);
2323 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2326 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2327 virtual void deselectEvent(
bool *selectionStateChanged);
2330 QPen getBorderPen()
const;
2331 QBrush getBrush()
const;
2336 friend class QCustomPlot;
2339 Q_DECLARE_OPERATORS_FOR_FLAGS(
QCPLegend::SelectableParts)
2347 Q_PROPERTY(QString text READ text WRITE setText)
2348 Q_PROPERTY(QFont font READ font WRITE setFont)
2349 Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
2350 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
2351 Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor)
2352 Q_PROPERTY(
bool selectable READ selectable WRITE setSelectable NOTIFY selectableChanged)
2353 Q_PROPERTY(
bool selected READ selected WRITE setSelected NOTIFY selectionChanged)
2357 explicit QCPPlotTitle(QCustomPlot *parentPlot,
const QString &text);
2360 QString
text()
const {
return mText; }
2361 QFont
font()
const {
return mFont; }
2369 void setText(
const QString &text);
2370 void setFont(
const QFont &font);
2371 void setTextColor(
const QColor &color);
2372 void setSelectedFont(
const QFont &font);
2373 void setSelectedTextColor(
const QColor &color);
2374 Q_SLOT
void setSelectable(
bool selectable);
2375 Q_SLOT
void setSelected(
bool selected);
2378 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2381 void selectionChanged(
bool selected);
2382 void selectableChanged(
bool selectable);
2395 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2397 virtual QSize minimumSizeHint()
const;
2398 virtual QSize maximumSizeHint()
const;
2400 virtual void selectEvent(QMouseEvent *event,
bool additive,
const QVariant &details,
bool *selectionStateChanged);
2401 virtual void deselectEvent(
bool *selectionStateChanged);
2404 QFont mainFont()
const;
2405 QColor mainTextColor()
const;
2429 void updateGradientImage();
2430 Q_SLOT
void axisSelectionChanged(QCPAxis::SelectableParts selectedParts);
2431 Q_SLOT
void axisSelectableChanged(QCPAxis::SelectableParts selectableParts);
2441 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
2442 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
2443 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
2444 Q_PROPERTY(QString label READ label WRITE setLabel)
2445 Q_PROPERTY(
int barWidth READ barWidth WRITE setBarWidth)
2446 Q_PROPERTY(
bool rangeDrag READ rangeDrag WRITE setRangeDrag)
2447 Q_PROPERTY(
bool rangeZoom READ rangeZoom WRITE setRangeZoom)
2459 QString label()
const;
2461 bool rangeDrag()
const;
2462 bool rangeZoom()
const;
2466 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
2469 void setLabel(
const QString &str);
2470 void setBarWidth(
int width);
2471 void setRangeDrag(
bool enabled);
2472 void setRangeZoom(
bool enabled);
2475 QList<QCPColorMap*> colorMaps()
const;
2476 void rescaleDataRange(
bool onlyVisibleMaps);
2482 void dataRangeChanged(
QCPRange newRange);
2499 virtual void applyDefaultAntialiasingHint(
QCPPainter *painter)
const;
2501 virtual void mousePressEvent(QMouseEvent *event);
2502 virtual void mouseMoveEvent(QMouseEvent *event);
2503 virtual void mouseReleaseEvent(QMouseEvent *event);
2504 virtual void wheelEvent(QWheelEvent *event);
2521 QCPData(
double key,
double value);
2544 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2545 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2546 Q_PROPERTY(
ErrorType errorType READ errorType WRITE setErrorType)
2547 Q_PROPERTY(QPen errorPen READ errorPen WRITE setErrorPen)
2548 Q_PROPERTY(
double errorBarSize READ errorBarSize WRITE setErrorBarSize)
2549 Q_PROPERTY(
bool errorBarSkipSymbol READ errorBarSkipSymbol WRITE setErrorBarSkipSymbol)
2550 Q_PROPERTY(
QCPGraph* channelFillGraph READ channelFillGraph WRITE setChannelFillGraph)
2551 Q_PROPERTY(
bool adaptiveSampling READ adaptiveSampling WRITE setAdaptiveSampling)
2582 QCPDataMap *data()
const {
return mData; }
2593 void setData(QCPDataMap *data,
bool copy=
false);
2594 void setData(
const QVector<double> &key,
const QVector<double> &value);
2595 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError);
2596 void setDataKeyError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyErrorMinus,
const QVector<double> &keyErrorPlus);
2597 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueError);
2598 void setDataValueError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &valueErrorMinus,
const QVector<double> &valueErrorPlus);
2599 void setDataBothError(
const QVector<double> &key,
const QVector<double> &value,
const QVector<double> &keyError,
const QVector<double> &valueError);
2600 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);
2604 void setErrorPen(
const QPen &pen);
2605 void setErrorBarSize(
double size);
2606 void setErrorBarSkipSymbol(
bool enabled);
2607 void setChannelFillGraph(
QCPGraph *targetGraph);
2608 void setAdaptiveSampling(
bool enabled);
2611 void addData(
const QCPDataMap &dataMap);
2612 void addData(
const QCPData &data);
2613 void addData(
double key,
double value);
2614 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2615 void removeDataBefore(
double key);
2616 void removeDataAfter(
double key);
2617 void removeData(
double fromKey,
double toKey);
2618 void removeData(
double key);
2621 virtual void clearData();
2622 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2626 void rescaleAxes(
bool onlyEnlarge,
bool includeErrorBars)
const;
2627 void rescaleKeyAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
2628 void rescaleValueAxis(
bool onlyEnlarge,
bool includeErrorBars)
const;
2644 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2645 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2646 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2647 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain,
bool includeErrors)
const;
2648 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain,
bool includeErrors)
const;
2651 virtual void drawFill(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
2652 virtual void drawScatterPlot(
QCPPainter *painter, QVector<QCPData> *scatterData)
const;
2653 virtual void drawLinePlot(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
2654 virtual void drawImpulsePlot(
QCPPainter *painter, QVector<QPointF> *lineData)
const;
2657 void getPreparedData(QVector<QCPData> *lineData, QVector<QCPData> *scatterData)
const;
2658 void getPlotData(QVector<QPointF> *lineData, QVector<QCPData> *scatterData)
const;
2659 void getScatterPlotData(QVector<QCPData> *scatterData)
const;
2660 void getLinePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2661 void getStepLeftPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2662 void getStepRightPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2663 void getStepCenterPlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2664 void getImpulsePlotData(QVector<QPointF> *linePixelData, QVector<QCPData> *scatterData)
const;
2665 void drawError(
QCPPainter *painter,
double x,
double y,
const QCPData &data)
const;
2666 void getVisibleDataBounds(QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper)
const;
2667 int countDataInBounds(
const QCPDataMap::const_iterator &lower,
const QCPDataMap::const_iterator &upper,
int maxCount)
const;
2668 void addFillBasePoints(QVector<QPointF> *lineData)
const;
2669 void removeFillBasePoints(QVector<QPointF> *lineData)
const;
2670 QPointF lowerFillBasePoint(
double lowerKey)
const;
2671 QPointF upperFillBasePoint(
double upperKey)
const;
2672 const QPolygonF getChannelFillPolygon(
const QVector<QPointF> *lineData)
const;
2673 int findIndexBelowX(
const QVector<QPointF> *data,
double x)
const;
2674 int findIndexAboveX(
const QVector<QPointF> *data,
double x)
const;
2675 int findIndexBelowY(
const QVector<QPointF> *data,
double y)
const;
2676 int findIndexAboveY(
const QVector<QPointF> *data,
double y)
const;
2677 double pointDistance(
const QPointF &pixelPoint)
const;
2679 friend class QCustomPlot;
2714 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
2715 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
2730 QCPCurveDataMap *
data()
const {
return mData; }
2735 void setData(QCPCurveDataMap *data,
bool copy=
false);
2736 void setData(
const QVector<double> &t,
const QVector<double> &key,
const QVector<double> &value);
2737 void setData(
const QVector<double> &key,
const QVector<double> &value);
2742 void addData(
const QCPCurveDataMap &dataMap);
2744 void addData(
double t,
double key,
double value);
2745 void addData(
double key,
double value);
2746 void addData(
const QVector<double> &ts,
const QVector<double> &keys,
const QVector<double> &values);
2747 void removeDataBefore(
double t);
2748 void removeDataAfter(
double t);
2749 void removeData(
double fromt,
double tot);
2750 void removeData(
double t);
2753 virtual void clearData();
2754 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2764 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2765 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2766 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2769 virtual void drawScatterPlot(
QCPPainter *painter,
const QVector<QPointF> *pointData)
const;
2772 void getCurveData(QVector<QPointF> *lineData)
const;
2773 int getRegion(
double x,
double y,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
2774 QPointF getOptimizedPoint(
int prevRegion,
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
2775 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
2776 bool mayTraverse(
int prevRegion,
int currentRegion)
const;
2777 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom, QPointF &crossA, QPointF &crossB)
const;
2778 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom, QVector<QPointF> &beforeTraverse, QVector<QPointF> &afterTraverse)
const;
2779 double pointDistance(
const QPointF &pixelPoint)
const;
2781 friend class QCustomPlot;
2794 Q_PROPERTY(
SpacingType spacingType READ spacingType WRITE setSpacingType)
2795 Q_PROPERTY(
double spacing READ spacing WRITE setSpacing)
2817 void setSpacing(
double spacing);
2820 QList<QCPBars*>
bars()
const {
return mBars; }
2821 QCPBars* bars(
int index)
const;
2822 int size()
const {
return mBars.size(); }
2827 void insert(
int i,
QCPBars *bars);
2838 void registerBars(
QCPBars *bars);
2839 void unregisterBars(
QCPBars *bars);
2842 double keyPixelOffset(
const QCPBars *bars,
double keyCoord);
2843 double getPixelSpacing(
const QCPBars *bars,
double keyCoord);
2856 QCPBarData(
double key,
double value);
2877 Q_PROPERTY(
double width READ width WRITE setWidth)
2878 Q_PROPERTY(
WidthType widthType READ widthType WRITE setWidthType)
2879 Q_PROPERTY(
QCPBarsGroup* barsGroup READ barsGroup WRITE setBarsGroup)
2880 Q_PROPERTY(
double baseValue READ baseValue WRITE setBaseValue)
2881 Q_PROPERTY(
QCPBars* barBelow READ barBelow)
2882 Q_PROPERTY(
QCPBars* barAbove READ barAbove)
2901 double width()
const {
return mWidth; }
2907 QCPBarDataMap *
data()
const {
return mData; }
2910 void setWidth(
double width);
2913 void setBaseValue(
double baseValue);
2914 void setData(QCPBarDataMap *data,
bool copy=
false);
2915 void setData(
const QVector<double> &key,
const QVector<double> &value);
2918 void moveBelow(
QCPBars *bars);
2919 void moveAbove(
QCPBars *bars);
2920 void addData(
const QCPBarDataMap &dataMap);
2922 void addData(
double key,
double value);
2923 void addData(
const QVector<double> &keys,
const QVector<double> &values);
2924 void removeDataBefore(
double key);
2925 void removeDataAfter(
double key);
2926 void removeData(
double fromKey,
double toKey);
2927 void removeData(
double key);
2930 virtual void clearData();
2931 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
2944 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
2945 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2946 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
2949 void getVisibleDataBounds(QCPBarDataMap::const_iterator &lower, QCPBarDataMap::const_iterator &upperEnd)
const;
2950 QPolygonF getBarPolygon(
double key,
double value)
const;
2951 void getPixelWidth(
double key,
double &lower,
double &upper)
const;
2952 double getStackedBaseValue(
double key,
bool positive)
const;
2955 friend class QCustomPlot;
2969 Q_PROPERTY(
double key READ key WRITE setKey)
2970 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum)
2971 Q_PROPERTY(
double lowerQuartile READ lowerQuartile WRITE setLowerQuartile)
2972 Q_PROPERTY(
double median READ median WRITE setMedian)
2973 Q_PROPERTY(
double upperQuartile READ upperQuartile WRITE setUpperQuartile)
2974 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum)
2975 Q_PROPERTY(QVector<double> outliers READ outliers WRITE setOutliers)
2976 Q_PROPERTY(
double width READ width WRITE setWidth)
2977 Q_PROPERTY(
double whiskerWidth READ whiskerWidth WRITE setWhiskerWidth)
2978 Q_PROPERTY(QPen whiskerPen READ whiskerPen WRITE setWhiskerPen)
2979 Q_PROPERTY(QPen whiskerBarPen READ whiskerBarPen WRITE setWhiskerBarPen)
2980 Q_PROPERTY(QPen medianPen READ medianPen WRITE setMedianPen)
2981 Q_PROPERTY(
QCPScatterStyle outlierStyle READ outlierStyle WRITE setOutlierStyle)
2987 double key()
const {
return mKey; }
3002 void setKey(
double key);
3003 void setMinimum(
double value);
3004 void setLowerQuartile(
double value);
3005 void setMedian(
double value);
3006 void setUpperQuartile(
double value);
3007 void setMaximum(
double value);
3008 void setOutliers(
const QVector<double> &values);
3009 void setData(
double key,
double minimum,
double lowerQuartile,
double median,
double upperQuartile,
double maximum);
3010 void setWidth(
double width);
3011 void setWhiskerWidth(
double width);
3012 void setWhiskerPen(
const QPen &pen);
3013 void setWhiskerBarPen(
const QPen &pen);
3014 void setMedianPen(
const QPen &pen);
3018 virtual void clearData();
3019 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3032 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
3033 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3034 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3037 virtual void drawQuartileBox(
QCPPainter *painter, QRectF *quartileBox=0)
const;
3038 virtual void drawMedian(
QCPPainter *painter)
const;
3039 virtual void drawWhiskers(
QCPPainter *painter)
const;
3040 virtual void drawOutliers(
QCPPainter *painter)
const;
3042 friend class QCustomPlot;
3061 double data(
double key,
double value);
3062 double cell(
int keyIndex,
int valueIndex);
3065 void setSize(
int keySize,
int valueSize);
3066 void setKeySize(
int keySize);
3067 void setValueSize(
int valueSize);
3069 void setKeyRange(
const QCPRange &keyRange);
3070 void setValueRange(
const QCPRange &valueRange);
3071 void setData(
double key,
double value,
double z);
3072 void setCell(
int keyIndex,
int valueIndex,
double z);
3075 void recalculateDataBounds();
3077 void fill(
double z);
3079 void coordToCell(
double key,
double value,
int *keyIndex,
int *valueIndex)
const;
3080 void cellToCoord(
int keyIndex,
int valueIndex,
double *key,
double *value)
const;
3100 Q_PROPERTY(
QCPRange dataRange READ dataRange WRITE setDataRange NOTIFY dataRangeChanged)
3101 Q_PROPERTY(
QCPAxis::ScaleType dataScaleType READ dataScaleType WRITE setDataScaleType NOTIFY dataScaleTypeChanged)
3102 Q_PROPERTY(
QCPColorGradient gradient READ gradient WRITE setGradient NOTIFY gradientChanged)
3103 Q_PROPERTY(
bool interpolate READ interpolate WRITE setInterpolate)
3104 Q_PROPERTY(
bool tightBoundary READ tightBoundary WRITE setTightBoundary)
3105 Q_PROPERTY(
QCPColorScale* colorScale READ colorScale WRITE setColorScale)
3122 Q_SLOT
void setDataRange(
const QCPRange &dataRange);
3125 void setInterpolate(
bool enabled);
3126 void setTightBoundary(
bool enabled);
3130 void rescaleDataRange(
bool recalculateDataBounds=
false);
3131 Q_SLOT
void updateLegendIcon(Qt::TransformationMode transformMode=Qt::SmoothTransformation,
const QSize &thumbSize=QSize(32, 18));
3134 virtual void clearData();
3135 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3138 void dataRangeChanged(
QCPRange newRange);
3157 virtual void updateMapImage();
3161 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
3162 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3163 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3165 friend class QCustomPlot;
3178 QCPFinancialData(
double key,
double open,
double high,
double low,
double close);
3179 double key,
open, high, low, close;
3199 Q_PROPERTY(
ChartStyle chartStyle READ chartStyle WRITE setChartStyle)
3200 Q_PROPERTY(
double width READ width WRITE setWidth)
3201 Q_PROPERTY(
bool twoColored READ twoColored WRITE setTwoColored)
3202 Q_PROPERTY(QBrush brushPositive READ brushPositive WRITE setBrushPositive)
3203 Q_PROPERTY(QBrush brushNegative READ brushNegative WRITE setBrushNegative)
3204 Q_PROPERTY(QPen penPositive READ penPositive WRITE setPenPositive)
3205 Q_PROPERTY(QPen penNegative READ penNegative WRITE setPenNegative)
3222 QCPFinancialDataMap *data()
const {
return mData; }
3233 void setData(QCPFinancialDataMap *data,
bool copy=
false);
3234 void setData(
const QVector<double> &key,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close);
3236 void setWidth(
double width);
3237 void setTwoColored(
bool twoColored);
3238 void setBrushPositive(
const QBrush &brush);
3239 void setBrushNegative(
const QBrush &brush);
3240 void setPenPositive(
const QPen &pen);
3241 void setPenNegative(
const QPen &pen);
3244 void addData(
const QCPFinancialDataMap &dataMap);
3246 void addData(
double key,
double open,
double high,
double low,
double close);
3247 void addData(
const QVector<double> &key,
const QVector<double> &open,
const QVector<double> &high,
const QVector<double> &low,
const QVector<double> &close);
3248 void removeDataBefore(
double key);
3249 void removeDataAfter(
double key);
3250 void removeData(
double fromKey,
double toKey);
3251 void removeData(
double key);
3254 virtual void clearData();
3255 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3258 static QCPFinancialDataMap timeSeriesToOhlc(
const QVector<double> &time,
const QVector<double> &value,
double timeBinSize,
double timeBinOffset = 0);
3271 virtual void drawLegendIcon(
QCPPainter *painter,
const QRectF &rect)
const;
3272 virtual QCPRange getKeyRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3273 virtual QCPRange getValueRange(
bool &foundRange,
SignDomain inSignDomain=sdBoth)
const;
3276 void drawOhlcPlot(
QCPPainter *painter,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end);
3277 void drawCandlestickPlot(
QCPPainter *painter,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end);
3278 double ohlcSelectTest(
const QPointF &pos,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end)
const;
3279 double candlestickSelectTest(
const QPointF &pos,
const QCPFinancialDataMap::const_iterator &begin,
const QCPFinancialDataMap::const_iterator &end)
const;
3280 void getVisibleDataBounds(QCPFinancialDataMap::const_iterator &lower, QCPFinancialDataMap::const_iterator &upper)
const;
3282 friend class QCustomPlot;
3291 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3292 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3299 QPen
pen()
const {
return mPen; }
3303 void setPen(
const QPen &pen);
3304 void setSelectedPen(
const QPen &pen);
3307 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3320 double distToStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QVector2D &point)
const;
3321 QLineF getRectClippedStraightLine(
const QVector2D &point1,
const QVector2D &vec,
const QRect &rect)
const;
3322 QPen mainPen()
const;
3330 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3331 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3340 QPen
pen()
const {
return mPen; }
3346 void setPen(
const QPen &pen);
3347 void setSelectedPen(
const QPen &pen);
3352 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3366 QLineF getRectClippedLine(
const QVector2D &start,
const QVector2D &end,
const QRect &rect)
const;
3367 QPen mainPen()
const;
3375 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3376 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3385 QPen
pen()
const {
return mPen; }
3391 void setPen(
const QPen &pen);
3392 void setSelectedPen(
const QPen &pen);
3397 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3413 QPen mainPen()
const;
3421 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3422 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3423 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3424 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3431 QPen
pen()
const {
return mPen; }
3437 void setPen(
const QPen &pen);
3438 void setSelectedPen(
const QPen &pen);
3439 void setBrush(
const QBrush &brush);
3440 void setSelectedBrush(
const QBrush &brush);
3443 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3455 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
3463 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3466 QPen mainPen()
const;
3467 QBrush mainBrush()
const;
3475 Q_PROPERTY(QColor color READ color WRITE setColor)
3476 Q_PROPERTY(QColor selectedColor READ selectedColor WRITE setSelectedColor)
3477 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3478 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3479 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3480 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3481 Q_PROPERTY(QFont font READ font WRITE setFont)
3482 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont)
3483 Q_PROPERTY(QString text READ text WRITE setText)
3484 Q_PROPERTY(Qt::Alignment positionAlignment READ positionAlignment WRITE setPositionAlignment)
3485 Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
3486 Q_PROPERTY(
double rotation READ rotation WRITE setRotation)
3487 Q_PROPERTY(QMargins padding READ padding WRITE setPadding)
3496 QPen
pen()
const {
return mPen; }
3500 QFont
font()
const {
return mFont; }
3502 QString
text()
const {
return mText; }
3509 void setColor(
const QColor &color);
3510 void setSelectedColor(
const QColor &color);
3511 void setPen(
const QPen &pen);
3512 void setSelectedPen(
const QPen &pen);
3513 void setBrush(
const QBrush &brush);
3514 void setSelectedBrush(
const QBrush &brush);
3515 void setFont(
const QFont &font);
3516 void setSelectedFont(
const QFont &font);
3517 void setText(
const QString &text);
3518 void setPositionAlignment(Qt::Alignment alignment);
3519 void setTextAlignment(Qt::Alignment alignment);
3520 void setRotation(
double degrees);
3521 void setPadding(
const QMargins &padding);
3524 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3537 enum AnchorIndex {aiTopLeft, aiTop, aiTopRight, aiRight, aiBottomRight, aiBottom, aiBottomLeft, aiLeft};
3552 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3555 QPointF getTextDrawPoint(
const QPointF &pos,
const QRectF &rect, Qt::Alignment positionAlignment)
const;
3556 QFont mainFont()
const;
3557 QColor mainColor()
const;
3558 QPen mainPen()
const;
3559 QBrush mainBrush()
const;
3567 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3568 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3569 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3570 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3577 QPen
pen()
const {
return mPen; }
3583 void setPen(
const QPen &pen);
3584 void setSelectedPen(
const QPen &pen);
3585 void setBrush(
const QBrush &brush);
3586 void setSelectedBrush(
const QBrush &brush);
3589 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3604 enum AnchorIndex {aiTopLeftRim, aiTop, aiTopRightRim, aiRight, aiBottomRightRim, aiBottom, aiBottomLeftRim, aiLeft, aiCenter};
3612 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3615 QPen mainPen()
const;
3616 QBrush mainBrush()
const;
3624 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
3625 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
3626 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
3627 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
3628 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3629 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3640 QPen
pen()
const {
return mPen; }
3644 void setPixmap(
const QPixmap &pixmap);
3645 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
3646 void setPen(
const QPen &pen);
3647 void setSelectedPen(
const QPen &pen);
3650 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3662 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
3674 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3677 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
3678 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
3679 QPen mainPen()
const;
3687 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3688 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3689 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
3690 Q_PROPERTY(QBrush selectedBrush READ selectedBrush WRITE setSelectedBrush)
3691 Q_PROPERTY(
double size READ size WRITE setSize)
3692 Q_PROPERTY(
TracerStyle style READ style WRITE setStyle)
3693 Q_PROPERTY(
QCPGraph* graph READ graph WRITE setGraph)
3694 Q_PROPERTY(
double graphKey READ graphKey WRITE setGraphKey)
3695 Q_PROPERTY(
bool interpolating READ interpolating WRITE setInterpolating)
3715 QPen pen()
const {
return mPen; }
3719 double size()
const {
return mSize; }
3726 void setPen(
const QPen &pen);
3727 void setSelectedPen(
const QPen &pen);
3728 void setBrush(
const QBrush &brush);
3729 void setSelectedBrush(
const QBrush &brush);
3730 void setSize(
double size);
3733 void setGraphKey(
double key);
3734 void setInterpolating(
bool enabled);
3737 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3740 void updatePosition();
3758 QPen mainPen()
const;
3759 QBrush mainBrush()
const;
3767 Q_PROPERTY(QPen pen READ pen WRITE setPen)
3768 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
3769 Q_PROPERTY(
double length READ length WRITE setLength)
3770 Q_PROPERTY(
BracketStyle style READ style WRITE setStyle)
3783 QPen
pen()
const {
return mPen; }
3789 void setPen(
const QPen &pen);
3790 void setSelectedPen(
const QPen &pen);
3791 void setLength(
double length);
3795 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
3810 virtual QPointF anchorPixelPoint(
int anchorId)
const;
3813 QPen mainPen()
const;
3816 #endif // QCUSTOMPLOT_H QList< QList< QCPLayoutElement * > > mElements
QCP::AntialiasedElements mNotAADragBackup
QCPLayoutGrid * plotLayout() const
A bracket for referencing/highlighting certain parts in the plot.
QCustomPlot * mParentPlot
A margin group allows synchronization of margin sides if working with multiple layout elements...
QList< QCPGraph * > mGraphs
bool operator==(const QCPRange &other) const
QList< QCPLayoutElement * > elements(QCP::MarginSide side) const
static const double maxRange
Whether to use immediate repaint or queued update depends on whether the plotting hint QCP::phForceRe...
bool isInvalidData(double value)
QCPColorGradient gradient() const
bool clipToAxisRect() const
QPen whiskerBarPen() const
QBrush brushNegative() const
QCPItemPosition *const end
QCPColorMapData * mMapData
bool subGridVisible() const
QCPLayout * mParentLayout
void drawLine(const QPointF &p1, const QPointF &p2)
PainterModes modes() const
QCPRange dataRange() const
QMap< double, QCPData > QCPDataMap
QCP::AntialiasedElements antialiasedElements() const
Holds the data of one single data point for QCPCurve.
QCPRange keyRange() const
QCPLineEnding tail() const
void rescaleKeyAxis(bool onlyEnlarge=false) const
bool mNumberBeautifulPowers
QCPItemAnchor *const center
A legend item representing a plottable with an icon and the plottable name.
QHash< QCP::MarginSide, QCPMarginGroup * > mMarginGroups
QBrush selectedBrush() const
QCPItemPosition *const start
int numberPrecision() const
QByteArray mLabelParameterHash
QCPAbstractPlottable * plottable()
PositionType typeX() const
QCPBarDataMap * data() const
EndingStyle style() const
virtual void mouseMoveEvent(QMouseEvent *event)
double errorBarSize() const
QCPItemPosition *const topLeft
SelectableParts mSelectedParts
QPen selectedBorderPen() const
The abstract base class for all entries in a QCPLegend.
QCPItemAnchor *const topRight
bool mAntialiasedZeroLine
0x0001 Axis base line and tick marks
QPainterPath customPath() const
Responsible for drawing the grid of a QCPAxis.
Qt::Alignment positionAlignment() const
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
QCPItemAnchor * parentAnchor() const
QVector< QString > tickLabels
Qt::AspectRatioMode backgroundScaledMode() const
QSize maximumSize() const
const QCPRange range() const
QCPColorGradient mGradient
QCPColorMapData * data() const
bool noAntialiasingOnDrag() const
QRect axisSelectionBox() const
QList< QCPItemPosition * > mPositions
QCP::PlottingHints plottingHints() const
QCustomPlot * mParentPlot
QColor mSelectedTextColor
virtual void applyDefaultAntialiasingHint(QCPPainter *painter) const
QColor labelColor() const
An anchor of an item to which positions can be attached to.
Qt::Orientations mRangeZoom
QCPItemAnchor *const bottomLeftRim
virtual int calculateAutoMargin(QCP::MarginSide side)
QHash< QCP::MarginSide, QCPMarginGroup * > marginGroups() const
QBrush selectedBrush() const
QCPAxis * keyAxis() const
QCache< QString, CachedLabel > mLabelCache
QCPItemPosition *const right
QCP::MarginSides autoMargins() const
QVector< double > subTickPositions
virtual void mouseReleaseEvent(QMouseEvent *event)
QCPFinancialDataMap * mData
QCPLineEnding head() const
QCPRange & operator*=(const double &value)
Base class for all drawable objects.
QPixmap mBackgroundPixmap
QPen selectedBasePen() const
bool antialiasedErrorBars() const
bool mGradientImageInvalidated
QCPAxis::ScaleType dataScaleType() const
QBrush brushPositive() const
A plottable representing a bar chart in a plot.
const QCP::Interactions interactions() const
QCPRange & operator+=(const double &value)
QVector< double > mTickVector
0x080 All other objects are selectable (e.g. your own derived layerables, the plot title...
T diff(const T &X, arma::uword deriv_order=1)
Vespucci::Math::diff.
A curved line from one point to another.
0x0080 Scatter symbols of plottables (excluding scatter symbols of type ssPixmap) ...
bool operator!=(const QCPRange &other) const
QFont selectedTickLabelFont() const
QColor mSelectedTextColor
QPointer< QCPBars > mBarBelow
QCustomPlot * mParentPlot
QList< QCPLayerable * > children() const
QCPScatterStyle mScatterStyle
A layout that arranges child elements in a grid.
virtual void mousePressEvent(QMouseEvent *event)
QPoint bottomLeft() const
QCPScatterStyle mOutlierStyle
QList< QCPLayer * > mLayers
QCP::AntialiasedElements mNotAntialiasedElements
QCPItemAnchor *const bottom
0x0040 Main lines of items
QCP::MarginSides mAutoMargins
The abstract base class for all data representing objects in a plot.
QCPScatterStyle outlierStyle() const
QVector< QString > tickVectorLabels() const
A plottable representing a single statistical box in a plot.
QColor tickLabelColor() const
Qt::Alignment textAlignment() const
Q_DECLARE_TYPEINFO(QCPScatterStyle, Q_MOVABLE_TYPE)
bool autoAddPlottableToLegend() const
QCPItemAnchor *const left
QPointer< QCPAxis > mValueAxis
QList< QCPBars * > bars() const
QPen selectedTickPen() const
QPointer< QCPAxis > mColorAxis
bool errorBarSkipSymbol() const
0x008 Plottables are selectable (e.g. graphs, curves, bars,... see QCPAbstractPlottable) ...
QCPItemAnchor * parentAnchorY() const
QMutableMapIterator< double, QCPBarData > QCPBarDataMutableMapIterator
QColor selectedColor() const
QCPItemPosition *const endDir
bool antialiasedSubGrid() const
QCPItemPosition *const bottomRight
QColor selectedTextColor() const
QCPColorGradient mGradient
bool antialiasedFill() const
Qt::AspectRatioMode aspectRatioMode() const
QCustomPlot * mParentPlot
QCPColorScale * colorScale() const
A plottable representing a graph in a plot.
QCPItemPosition *const start
int iconTextPadding() const
The abstract base class for all items in a plot.
QList< QRectF > mInsetRect
QCPLayoutInset * mInsetLayout
0x004 axis (tick) labels will be cached as pixmaps, increasing replot performance.
QRect tickLabelsSelectionBox() const
Item that sticks to QCPGraph data points.
QCPLegend * mParentLegend
QRect mTickLabelsSelectionBox
QCPItemAnchor *const right
bool mNoAntialiasingOnDrag
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
VESPUCCI_EXPORT void position(arma::uword index, arma::uword n_rows, arma::uword n_cols, arma::uword &i, arma::uword &j)
Vespucci::Math::position Find row and column numbers for index.
0x040 Items are selectable (Rectangles, Arrows, Textitems, etc. see QCPAbstractItem) ...
int columnSpacing() const
bool backgroundScaled() const
virtual void wheelEvent(QWheelEvent *event)
Manages a single axis inside a QCustomPlot.
QCPLineEnding tail() const
QList< QCPItemAnchor * > anchors() const
QCPAxis::AxisType type() const
double upperQuartile() const
QCPBarsGroup * barsGroup() const
bool isPenDefined() const
double lowerQuartile() const
QCPScatterStyle scatterStyle() const
QCPItemAnchor *const topRight
QCPColorScale * mParentColorScale
QCPItemAnchor *const topLeftRim
PositionType type() const
Represents the visual appearance of scatter points.
Manages a legend inside a QCustomPlot.
QList< QCPItemPosition * > positions() const
QList< QCPLayerable * > mChildren
QSet< QCPItemPosition * > mChildrenY
PositionType mPositionTypeY
QCPLayerable * parentLayerable() const
QPointer< QCPColorScaleAxisRectPrivate > mAxisRect
Qt::AspectRatioMode mBackgroundScaledMode
bool abbreviateDecimalPowers
0x0200 Borders of fills (e.g. under or between graphs)
QFont selectedFont() const
0x004 The user can select multiple objects by holding the modifier set by QCustomPlot::setMultiSelect...
QList< double > rowStretchFactors() const
QCPItemAnchor *const bottomRight
QCPItemAnchor *const bottomLeft
QPointer< QCPAxis > mValueAxis
QCPRange valueRange() const
QCPRange mDragStartVertRange
QVector< double > mSubTickVector
QCPItemAnchor *const topRightRim
A layer that may contain objects, to control the rendering order.
Qt::Orientation orientation() const
QCPItemPosition *const position
bool interpolating() const
SpacingType spacingType() const
The abstract base class for all objects that form the layout system.
QCPAxis * keyAxis() const
QList< InsetPlacement > mInsetPlacement
QCPColorGradient gradient() const
QCPLineEnding upperEnding
Qt::AspectRatioMode mAspectRatioMode
QPen selectedIconBorderPen() const
QCPItemAnchor * parentAnchorX() const
A straight line that spans infinitely in both directions.
QCPBarsGroup * mBarsGroup
QMap< double, QCPBarData > QCPBarDataMap
QCPItemAnchor *const left
QFont tickLabelFont() const
bool autoSubTicks() const
A layout that places child elements aligned to the border or arbitrarily positioned.
0x020 Legends are selectable (or their child items, see QCPLegend::setSelectableParts) ...
double scaleLogBase() const
Handles the different ending decorations for line-like items.
A color scale for use with color coding data such as QCPColorMap.
QCPDataMap * data() const
QCP::PlottingHints mPlottingHints
Holds the data of one single data point for QCPGraph.
QCPAxis * valueAxis() const
virtual QCPItemPosition * toQCPItemPosition()
QPointer< QCPAxisRect > mClipAxisRect
bool mAntialiasedScatters
QVector< QString > mTickVectorLabels
int getMarginValue(const QMargins &margins, QCP::MarginSide side)
QList< QCPAbstractPlottable * > mPlottables
QCustomPlot * parentPlot() const
QPainter subclass used internally.
Qt::TransformationMode transformationMode() const
Qt::KeyboardModifier multiSelectModifier() const
QCPCurveDataMap * data() const
QMutableMapIterator< double, QCPData > QCPDataMutableMapIterator
Qt::TimeSpec mDateTimeSpec
QCPScatterStyle scatterStyle() const
WidthType widthType() const
QFont selectedLabelFont() const
QCPItemAnchor *const bottom
QVector< double > outliers() const
QCPLineEnding head() const
SelectableParts mSelectedParts
virtual void mouseMoveEvent(QMouseEvent *event)
QVector< QRgb > mColorBuffer
QCPAxisRect * axisRect() const
QCPAbstractItem * mParentItem
int selectionTolerance() const
LineStyle lineStyle() const
QMargins minimumMargins() const
QCPRange & operator/=(const double &value)
Qt::Orientation mOrientation
QRect labelSelectionBox() const
static const double minRange
QVector< double > mOutliers
bool backgroundScaled() const
QPointer< QCPAxis > mRangeZoomVertAxis
QCPItemAnchor *const bottom
void rescaleAxes(bool onlyEnlarge=false) const
0x0020 Main lines of plottables (excluding error bars, see element aeErrorBars)
bool autoTickStep() const
LabelType tickLabelType() const
QBrush selectedBrush() const
Qt::Orientations rangeZoom() const
QFont selectedFont() const
QCPBars * barBelow() const
bool rangeReversed() const
QCPItemAnchor *const center
virtual QCPItemPosition * toQCPItemPosition()
A plottable representing a parametric curve in a plot.
QCPItemPosition *const topLeft
QMap< double, QCPFinancialData > QCPFinancialDataMap
QCPItemAnchor *const bottom
bool mAutoAddPlottableToLegend
QList< Qt::Alignment > mInsetAlignment
QCustomPlot * parentPlot() const
QVector< double > tickVector() const
void rescaleValueAxis(bool onlyEnlarge=false) const
QMapIterator< double, QCPBarData > QCPBarDataMapIterator
QList< double > mColumnStretchFactors
bool mMapImageInvalidated
BracketStyle style() const
A layout element displaying a plot title text.
QCPItemAnchor *const bottomRightRim
SelectableParts selectedParts() const
QPointer< QCPColorScale > mColorScale
QCPLayoutInset * insetLayout() const
QCPLegend * parentLegend() const
QColor selectedTickLabelColor() const
QMap< double, QColor > mColorStops
QStack< bool > mAntialiasingStack
double mScaleLogBaseLogInv
QCPItemPosition *const point1
QCPAxis::ScaleType mDataScaleType
virtual void mouseDoubleClickEvent(QMouseEvent *event)
QCPAxis::ScaleType mDataScaleType
QCPItemAnchor *const bottomLeft
QColor selectedTextColor() const
LineStyle lineStyle() const
QBrush selectedBrush() const
QHash< QCPAxis::AxisType, QList< QCPAxis * > > mAxes
QCPItemAnchor *const right
QPen selectedSubTickPen() const
QMapIterator< double, QCPData > QCPDataMapIterator
ChartStyle chartStyle() const
QCPItemPosition *const startDir
QMapIterator< double, QCPFinancialData > QCPFinancialDataMapIterator
ErrorType errorType() const
QColor selectedLabelColor() const
Holds the two-dimensional data of a QCPColorMap plottable.
virtual void update(UpdatePhase phase)
QList< QCPAbstractItem * > mItems
int autoTickCount() const
PositionType typeY() const
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
double mRangeZoomFactorVert
A plottable representing a financial stock chart.
TracerStyle style() const
QBrush selectedBrush() const
QMutableMapIterator< double, QCPFinancialData > QCPFinancialDataMutableMapIterator
void setMarginValue(QMargins &margins, QCP::MarginSide side, int value)
QCPAxisPainterPrivate * mAxisPainter
The abstract base class for layouts.
Holds the data of one single data point for QCPFinancial.
QPen mSelectedIconBorderPen
QCPItemPosition *const bottomRight
QCPItemAnchor *const left
QCPAbstractPlottable * mPlottable
ColorInterpolation mColorInterpolation
QCPBars * barAbove() const
QCPItemAnchor *const bottomLeft
A plottable representing a two-dimensional color map in a plot.
QHash< QCP::MarginSide, QList< QCPLayoutElement * > > mChildren
QCPAxis * valueAxis() const
QString dateTimeFormat() const
QCPItemPosition *const position
QCPAxis::LabelSide tickLabelSide
QPointer< QCPLayerable > mParentLayerable
QCPItemAnchor *const topLeft
virtual void mousePressEvent(QMouseEvent *event)
QCPItemAnchor *const right
QList< double > mRowStretchFactors
QPixmap mScaledBackgroundPixmap
Qt::TimeSpec dateTimeSpec() const
QPoint bottomRight() const
QPointer< QCPAxisRect > mAxisRect
QList< QCPLayoutElement * > mElements
Qt::TransformationMode mTransformationMode
QVector< double > tickPositions
QFont selectedFont() const
QCPRange dataBounds() const
A line from one point to another.
QColor mSelectedTextColor
bool contains(QCPBars *bars) const
SelectableParts selectableParts() const
QCPItemPosition *const point2
const QCPRange operator*(const QCPRange &range, double value)
bool autoTickLabels() const
QCPItemAnchor * mParentAnchorY
double whiskerWidth() const
0x0400 Zero-lines, see QCPGrid::setZeroLinePen
bool antialiasedScatters() const
Manages the position of an item.
QPen iconBorderPen() const
QCPItemPosition *const end
QCPAxis::ScaleType dataScaleType() const
bool tightBoundary() const
QPixmap mBackgroundPixmap
Defines a color gradient for use with e.g. QCPColorMap.
QPixmap background() const
QList< double > columnStretchFactors() const
QCPMarginGroup * marginGroup(QCP::MarginSide side) const
static Qt::Orientation orientation(AxisType type)
QPixmap mScaledBackgroundPixmap
QMap< double, QColor > colorStops() const
Represents the range an axis is encompassing.
QCPRange dataRange() const
QCPLayoutGrid * mPlotLayout
QList< QCPItemAnchor * > mAnchors
QCPScatterStyle mScatterStyle
Groups multiple QCPBars together so they appear side by side.
QPixmap background() const
ColorInterpolation colorInterpolation() const
0x010 Axes are selectable (or parts of them, see QCPAxis::setSelectableParts)
QBrush selectedBrush() const
bool adaptiveSampling() const
QMutableMapIterator< double, QCPCurveData > QCPCurveDataMutableMapIterator
QSize minimumSize() const
Qt::Orientations rangeDrag() const
ScaleType scaleType() const
QCPItemPosition *const topLeft
SelectableParts selectableParts() const
bool antialiasedZeroLine() const
Qt::Alignment mPositionAlignment
Holds multiple axes and arranges them in a rectangular shape.
Qt::AspectRatioMode backgroundScaledMode() const
QCPItemAnchor *const left
const QCPRange operator-(const QCPRange &range, double value)
Qt::KeyboardModifier mMultiSelectModifier
QFont selectedFont() const
QPointer< QCPLayoutElement > mMouseEventElement
QCP::AntialiasedElements notAntialiasedElements() const
QMap< double, QCPCurveData > QCPCurveDataMap
QCPRange & operator-=(const double &value)
const QCPRange operator/(const QCPRange &range, double value)
QCP::Interactions mInteractions
QCPItemAnchor *const topRight
Qt::Alignment mTextAlignment
QLatin1Char mNumberFormatChar
virtual void draw(QCPPainter *painter)
QCPItemPosition *const left
bool mColorBufferInvalidated
QCustomPlot * mParentPlot
QPointer< QCPGraph > mChannelFillGraph
QCustomPlot * mParentPlot
ScatterShape shape() const
const QCPRange operator+(const QCPRange &range, double value)
QCPItemPosition *const bottomRight
QCPItemAnchor *const right
QCPGraph * channelFillGraph() const
Qt::AspectRatioMode mBackgroundScaledMode
QColor selectedTextColor() const
virtual void wheelEvent(QWheelEvent *event)
QMapIterator< double, QCPCurveData > QCPCurveDataMapIterator
virtual void mouseReleaseEvent(QMouseEvent *event)
Holds the data of one single data point (one bar) for QCPBars.
QColor mSelectedLabelColor