|
rock_widget_collection
0.1
|
A plottable representing a graph in a plot. More...
#include <qcustomplot.h>
Inherits QCPAbstractPlottable.
Public Types | |
| enum | LineStyle { LSNone, LSLine, LSStepLeft, LSStepRight, LSStepCenter, LSImpulse } |
| enum | ScatterStyle { SSNone, SSDot, SSCross, SSPlus, SSCircle, SSDisc, SSSquare, SSStar, SSTriangle, SSTriangleInverted, SSCrossSquare, SSPlusSquare, SSCrossCircle, SSPlusCircle, SSPeace, SSPixmap } |
| enum | ErrorType { ETNone, ETKey, ETValue, ETBoth } |
Public Slots | |
| const QCPDataMap * | data () const |
| LineStyle | lineStyle () const |
| ScatterStyle | scatterStyle () const |
| double | scatterSize () const |
| const QPixmap | scatterPixmap () const |
| ErrorType | errorType () const |
| QPen | errorPen () const |
| double | errorBarSize () const |
| bool | errorBarSkipSymbol () const |
| QCPGraph * | channelFillGraph () const |
| void | setData (QCPDataMap *data, bool copy=false) |
| void | setData (const QVector< double > &key, const QVector< double > &value) |
| void | setDataKeyError (const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyError) |
| void | setDataKeyError (const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyErrorMinus, const QVector< double > &keyErrorPlus) |
| void | setDataValueError (const QVector< double > &key, const QVector< double > &value, const QVector< double > &valueError) |
| void | setDataValueError (const QVector< double > &key, const QVector< double > &value, const QVector< double > &valueErrorMinus, const QVector< double > &valueErrorPlus) |
| void | setDataBothError (const QVector< double > &key, const QVector< double > &value, const QVector< double > &keyError, const QVector< double > &valueError) |
| 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) |
| void | setLineStyle (int ls) |
| void | setScatterStyle (int ss) |
| void | setScatterSize (double size) |
| void | setScatterPixmap (const QPixmap &pixmap) |
| void | setErrorType (ErrorType errorType) |
| void | setErrorPen (const QPen &pen) |
| void | setErrorBarSize (double size) |
| void | setErrorBarSkipSymbol (bool enabled) |
| void | setChannelFillGraph (QCPGraph *targetGraph) |
| void | addData (const QCPDataMap &dataMap) |
| void | addData (const QCPData &data) |
| void | addData (double key, double value) |
| void | addData (const QVector< double > &keys, const QVector< double > &values) |
| void | removeDataBefore (double key) |
| void | removeDataAfter (double key) |
| void | removeData (double fromKey, double toKey) |
| void | removeData (double key) |
| virtual void | clearData () |
Public Slots inherited from QCPAbstractPlottable | |
| QCustomPlot * | parentPlot () const |
| QString | name () const |
| bool | visible () const |
| QPen | pen () const |
| QBrush | brush () const |
| QCPAxis * | keyAxis () const |
| QCPAxis * | valueAxis () const |
| void | setName (const QString &name) |
| void | setVisible (bool visible) |
| void | setPen (const QPen &pen) |
| void | setBrush (const QBrush &brush) |
| void | setKeyAxis (QCPAxis *axis) |
| void | setValueAxis (QCPAxis *axis) |
| void | rescaleAxes (bool onlyEnlarge=false) const |
| void | rescaleKeyAxis (bool onlyEnlarge=false) const |
| void | rescaleValueAxis (bool onlyEnlarge=false) const |
| virtual void | clearData ()=0 |
| virtual bool | addToLegend () const |
| virtual bool | removeFromLegend () const |
Public Member Functions | |
| QCPGraph (QCPAxis *keyAxis, QCPAxis *valueAxis) | |
| virtual | ~QCPGraph () |
| virtual void | rescaleAxes (bool onlyEnlarge, bool includeErrorBars) const |
| virtual void | rescaleKeyAxis (bool onlyEnlarge, bool includeErrorBars) const |
| virtual void | rescaleValueAxis (bool onlyEnlarge, bool includeErrorBars) const |
Public Member Functions inherited from QCPAbstractPlottable | |
| QCPAbstractPlottable (QCPAxis *keyAxis, QCPAxis *valueAxis) | |
| virtual | ~QCPAbstractPlottable () |
Protected Member Functions | |
| virtual void | draw (QPainter *painter) const |
| virtual void | drawLegendIcon (QPainter *painter, const QRect &rect) const |
| void | getPlotData (QVector< QPointF > *lineData, QVector< QCPData > *pointData) const |
| void | getScatterPlotData (QVector< QCPData > *pointData) const |
| void | getLinePlotData (QVector< QPointF > *lineData, QVector< QCPData > *pointData) const |
| void | getStepLeftPlotData (QVector< QPointF > *lineData, QVector< QCPData > *pointData) const |
| void | getStepRightPlotData (QVector< QPointF > *lineData, QVector< QCPData > *pointData) const |
| void | getStepCenterPlotData (QVector< QPointF > *lineData, QVector< QCPData > *pointData) const |
| void | getImpulsePlotData (QVector< QPointF > *lineData, QVector< QCPData > *pointData) const |
| void | drawFill (QPainter *painter, QVector< QPointF > *lineData) const |
| void | drawScatterPlot (QPainter *painter, QVector< QCPData > *pointData) const |
| void | drawLinePlot (QPainter *painter, QVector< QPointF > *lineData) const |
| void | drawImpulsePlot (QPainter *painter, QVector< QPointF > *lineData) const |
| void | drawScatter (QPainter *painter, double x, double y, ScatterStyle style) const |
| void | drawError (QPainter *painter, double x, double y, const QCPData &data) const |
| void | getVisibleDataBounds (QCPDataMap::const_iterator &lower, QCPDataMap::const_iterator &upper, int &count) const |
| void | addFillBasePoints (QVector< QPointF > *lineData) const |
| void | removeFillBasePoints (QVector< QPointF > *lineData) const |
| QPointF | lowerFillBasePoint (double lowerKey) const |
| QPointF | upperFillBasePoint (double upperKey) const |
| const QPolygonF | getChannelFillPolygon (const QVector< QPointF > *lineData) const |
| int | findIndexBelowX (const QVector< QPointF > *data, double x) const |
| int | findIndexAboveX (const QVector< QPointF > *data, double x) const |
| int | findIndexBelowY (const QVector< QPointF > *data, double y) const |
| int | findIndexAboveY (const QVector< QPointF > *data, double y) const |
| virtual QCPRange | getKeyRange (bool &validRange, SignDomain inSignDomain=SDBoth) const |
| virtual QCPRange | getValueRange (bool &validRange, SignDomain inSignDomain=SDBoth) const |
| virtual QCPRange | getKeyRange (bool &validRange, SignDomain inSignDomain, bool includeErrors) const |
| virtual QCPRange | getValueRange (bool &validRange, SignDomain inSignDomain, bool includeErrors) const |
Protected Member Functions inherited from QCPAbstractPlottable | |
| void | coordsToPixels (double key, double value, double &x, double &y) const |
| const QPointF | coordsToPixels (double key, double value) const |
Protected Attributes | |
| QCPDataMap * | mData |
| QPen | mErrorPen |
| LineStyle | mLineStyle |
| ScatterStyle | mScatterStyle |
| double | mScatterSize |
| QPixmap | mScatterPixmap |
| ErrorType | mErrorType |
| double | mErrorBarSize |
| bool | mErrorBarSkipSymbol |
| QCPGraph * | mChannelFillGraph |
Protected Attributes inherited from QCPAbstractPlottable | |
| QCustomPlot * | mParentPlot |
| QString | mName |
| bool | mVisible |
| QPen | mPen |
| QBrush | mBrush |
| QCPAxis * | mKeyAxis |
| QCPAxis * | mValueAxis |
Friends | |
| class | QCustomPlot |
| class | QCPLegend |
Additional Inherited Members | |
Protected Types inherited from QCPAbstractPlottable | |
| enum | SignDomain { SDNegative, SDBoth, SDPositive } |
A plottable representing a graph in a plot.
Usually QCustomPlot creates it internally via QCustomPlot::addGraph and the resulting instance is accessed via QCustomPlot::graph.
To plot data, assign it with the setData or addData functions.
The appearance of the graph is mainly determined by the line style, scatter style, brush and pen of the graph (setLineStyle, setScatterStyle, setBrush, setPen).
QCPGraph knows two types of fills: Normal graph fills towards the zero-value-line parallel to the key axis of the graph, and fills between two graphs, called channel fills. To enable a fill, just set a brush with setBrush which is neither Qt::NoBrush nor fully transparent.
By default, a normal fill towards the zero-value-line will be drawn. To set up a channel fill between this graph and another one, call setChannelFillGraph with the other graph as parameter.
Definition at line 171 of file qcustomplot.h.
| enum QCPGraph::ErrorType |
Defines what kind of error bars are drawn for each data point
Definition at line 216 of file qcustomplot.h.
| enum QCPGraph::LineStyle |
Defines how the graph's line is represented visually in the plot. The line is drawn with the current pen of the graph (setPen).
| Enumerator | |
|---|---|
| LSNone |
data points are not connected with any lines (e.g. data only represented with symbols according to the scatter style, see setScatterStyle) |
| LSLine |
data points are connected by a straight line |
| LSStepLeft |
line is drawn as steps where the step height is the value of the left data point |
| LSStepRight |
line is drawn as steps where the step height is the value of the right data point |
| LSStepCenter |
line is drawn as steps where the step is in between two data points |
| LSImpulse |
data points are represented by a straight line parallel to the value axis, which ranges down/up to the key axis |
Definition at line 180 of file qcustomplot.h.
This defines the visual appearance of the points, which are all drawn with the pen of the graph (setPen). The sizes of these visualizations (with exception of SSDot and SSPixmap) can be set with setScatterSize.
| Enumerator | |
|---|---|
| SSNone |
no scatter symbols are drawn (e.g. data only represented with lines, see setLineStyle) |
| SSDot |
a single pixel, setScatterSize has no influence on its size. |
| SSCross |
a cross (x) |
| SSPlus |
a plus (+) |
| SSCircle |
a circle which is not filled |
| SSDisc |
a circle which is filled with the color of the graph's pen (not the brush!) |
| SSSquare |
a square which is not filled |
| SSStar |
a star with eight arms, i.e. a combination of cross and plus |
| SSTriangle |
an equilateral triangle which is not filled, standing on baseline |
| SSTriangleInverted |
an equilateral triangle which is not filled, standing on corner |
| SSCrossSquare |
a square which is not filled, with a cross inside |
| SSPlusSquare |
a square which is not filled, with a plus inside |
| SSCrossCircle |
a circle which is not filled, with a cross inside |
| SSPlusCircle |
a circle which is not filled, with a plus inside |
| SSPeace |
a circle which is not filled, with one vertical and two downward diagonal lines |
| SSPixmap |
a custom pixmap specified by setScatterPixmap, centered on the data point coordinates. setScatterSize has no influence on its size. |
Definition at line 195 of file qcustomplot.h.
Constructs a graph which uses keyAxis as its key axis ("x") and valueAxis as its value axis ("y"). keyAxis and valueAxis must both reside in the same QCustomPlot.
The constructed QCPGraph can be added to the plot with QCustomPlot::addPlottable, QCustomPlot then takes ownership of the graph.
To directly create a graph inside a plot, you can also use the simpler QCustomPlot::addGraph function.
Definition at line 256 of file qcustomplot.cc.
|
virtual |
Definition at line 274 of file qcustomplot.cc.
|
slot |
Adds the provided data points in dataMap to the current data.
Definition at line 602 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds the provided single data point in data to the current data.
Definition at line 611 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds the provided single data point as key and value pair to the current data.
Definition at line 620 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds the provided data points as key and value pairs to the current data.
Definition at line 632 of file qcustomplot.cc.
|
protected |
Definition at line 1703 of file qcustomplot.cc.
|
inlineslot |
Definition at line 237 of file qcustomplot.h.
|
virtualslot |
Removes all data points.
Definition at line 700 of file qcustomplot.cc.
|
inlineslot |
Definition at line 228 of file qcustomplot.h.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 779 of file qcustomplot.cc.
|
protected |
Definition at line 1559 of file qcustomplot.cc.
|
protected |
Definition at line 1322 of file qcustomplot.cc.
|
protected |
Definition at line 1411 of file qcustomplot.cc.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 816 of file qcustomplot.cc.
|
protected |
Definition at line 1393 of file qcustomplot.cc.
|
protected |
Definition at line 1431 of file qcustomplot.cc.
|
protected |
Definition at line 1352 of file qcustomplot.cc.
|
inlineslot |
Definition at line 235 of file qcustomplot.h.
|
inlineslot |
Definition at line 236 of file qcustomplot.h.
|
inlineslot |
Definition at line 234 of file qcustomplot.h.
|
inlineslot |
Definition at line 233 of file qcustomplot.h.
|
protected |
Definition at line 1990 of file qcustomplot.cc.
|
protected |
Definition at line 2034 of file qcustomplot.cc.
|
protected |
Definition at line 2012 of file qcustomplot.cc.
|
protected |
Definition at line 2056 of file qcustomplot.cc.
|
protected |
Definition at line 1856 of file qcustomplot.cc.
|
protected |
Definition at line 1248 of file qcustomplot.cc.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 2072 of file qcustomplot.cc.
|
protectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Allows to specify whether the error bars should be included in the range calculation.
Definition at line 2092 of file qcustomplot.cc.
|
protected |
Definition at line 936 of file qcustomplot.cc.
|
protected |
Definition at line 868 of file qcustomplot.cc.
|
protected |
Definition at line 891 of file qcustomplot.cc.
|
protected |
Definition at line 1145 of file qcustomplot.cc.
|
protected |
Definition at line 991 of file qcustomplot.cc.
|
protected |
Definition at line 1068 of file qcustomplot.cc.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 2080 of file qcustomplot.cc.
|
protectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Allows to specify whether the error bars should be included in the range calculation.
Definition at line 2197 of file qcustomplot.cc.
|
protected |
Definition at line 1669 of file qcustomplot.cc.
|
inlineslot |
Definition at line 229 of file qcustomplot.h.
|
protected |
Definition at line 1740 of file qcustomplot.cc.
|
slot |
Removes all data points with keys between fromKey and toKey. if fromKey is greater or equal to toKey, the function does nothing. To remove a single data point with known key, use removeData(double key).
Definition at line 674 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Removes a single data point at key. If the position is not known with absolute precision, consider using removeData(double fromKey, double toKey) with a small fuzziness interval around the suspected position, depeding on the precision with which the key is known.
Definition at line 691 of file qcustomplot.cc.
|
slot |
|
slot |
|
protected |
Definition at line 1722 of file qcustomplot.cc.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Allows to define whether error bars are taken into consideration when determining the new axis range.
Definition at line 710 of file qcustomplot.cc.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Allows to define whether error bars (of kind QCPGraph::etKey) are taken into consideration when determining the new axis range.
Definition at line 721 of file qcustomplot.cc.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Allows to define whether error bars (of kind QCPGraph::ETValue) are taken into consideration when determining the new axis range.
Definition at line 752 of file qcustomplot.cc.
|
inlineslot |
Definition at line 232 of file qcustomplot.h.
|
inlineslot |
Definition at line 231 of file qcustomplot.h.
|
inlineslot |
Definition at line 230 of file qcustomplot.h.
|
slot |
Sets the target graph for filling the area between this graph and targetGraph with the current brush (setBrush).
When targetGraph is set to 0, a normal graph fill will be produced. This means, when the brush is not Qt::NoBrush or fully transparent, a fill all the way to the zero-value-line parallel to the key axis of this graph will be drawn. To disable any filling, set the brush to Qt::NoBrush.
Definition at line 578 of file qcustomplot.cc.
|
slot |
Replaces the current data with the provided data.
If copy is set to true, data points in data will only be copied. if false, the plottable takes ownership of the passed data and replaces the internal data pointer with it. This is significantly faster than copying for large datasets.
Definition at line 295 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Replaces the current data with the provided points in key and value pairs. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 313 of file qcustomplot.cc.
|
slot |
Replaces the current data with the provided points in key and value pairs. Additionally the symmetrical key and value errors of the data points are set to the values in keyError and valueError. For error bars to show appropriately, see setErrorType. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 436 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Replaces the current data with the provided points in key and value pairs. Additionally the negative key and value errors of the data points are set to the values in keyErrorMinus and valueErrorMinus. The positive key and value errors are set to the values in keyErrorPlus valueErrorPlus. For error bars to show appropriately, see setErrorType. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 465 of file qcustomplot.cc.
|
slot |
Replaces the current data with the provided points in key and value pairs. Additionally the symmetrical key error of the data points are set to the values in keyError. For error bars to show appropriately, see setErrorType. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 385 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Replaces the current data with the provided points in key and value pairs. Additionally the negative key error of the data points are set to the values in keyErrorMinus, the positive key error to keyErrorPlus. For error bars to show appropriately, see setErrorType. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 411 of file qcustomplot.cc.
|
slot |
Replaces the current data with the provided points in key and value pairs. Additionally the symmetrical value error of the data points are set to the values in valueError. For error bars to show appropriately, see setErrorType. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 334 of file qcustomplot.cc.
|
slot |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Replaces the current data with the provided points in key and value pairs. Additionally the negative value error of the data points are set to the values in valueErrorMinus, the positive value error to valueErrorPlus. For error bars to show appropriately, see setErrorType. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 360 of file qcustomplot.cc.
|
slot |
Sets the width of the handles at both ends of an error bar in pixels.
Definition at line 550 of file qcustomplot.cc.
|
slot |
If enabled is set to true, the error bar will not be drawn as a solid line under the scatter symbol but leave some free space around the symbol.
This feature uses the current scatter size (setScatterSize) to determine the size of the area to leave blank. So when drawing Pixmaps as scatter points (SSPixmap), the scatter size must be set manually to a value corresponding to the size of the Pixmap, if the error bars should leave gaps to its boundaries.
Definition at line 564 of file qcustomplot.cc.
|
slot |
Sets the pen with which the error bars will be drawn.
Definition at line 542 of file qcustomplot.cc.
|
slot |
|
slot |
Sets how the single data points are connected in the plot or how they are represented visually apart from the scatter symbol. For scatter-only plots, set ls to LSNone and setScatterStyle to the desired scatter style.
Definition at line 494 of file qcustomplot.cc.
|
slot |
If the scatter style (setScatterStyle) is set to SSPixmap, this function defines the QPixmap that will be drawn centered on the data point coordinate.
Definition at line 525 of file qcustomplot.cc.
|
slot |
This defines how big (in pixels) single scatters are drawn, if scatter style (setScatterStyle) isn't SSNone, SSDot or SSPixmap. Floating point values are allowed for fine grained control over optical appearance with antialiased painting.
Definition at line 515 of file qcustomplot.cc.
|
slot |
Sets the visual appearance of single data points in the plot. If set to SSNone, no scatter points are drawn (e.g. for line-only-plots with appropriate line style).
Definition at line 504 of file qcustomplot.cc.
|
protected |
Definition at line 1800 of file qcustomplot.cc.
|
friend |
Definition at line 327 of file qcustomplot.h.
|
friend |
Definition at line 326 of file qcustomplot.h.
|
protected |
Definition at line 287 of file qcustomplot.h.
|
protected |
Definition at line 278 of file qcustomplot.h.
|
protected |
Definition at line 285 of file qcustomplot.h.
|
protected |
Definition at line 286 of file qcustomplot.h.
|
protected |
Definition at line 279 of file qcustomplot.h.
|
protected |
Definition at line 284 of file qcustomplot.h.
|
protected |
Definition at line 280 of file qcustomplot.h.
|
protected |
Definition at line 283 of file qcustomplot.h.
|
protected |
Definition at line 282 of file qcustomplot.h.
|
protected |
Definition at line 281 of file qcustomplot.h.
1.8.6