A 2-D plotting widget. More...
#include <qwt_plot.h>
Classes | |
class | AxisData |
class | PrivateData |
Public Types | |
enum | Axis { yLeft, yRight, xBottom, xTop, axisCnt } |
Axis index. More... | |
enum | LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend } |
Public Slots | |
void | autoRefresh () |
Replots the plot if autoReplot() is true . More... | |
virtual void | replot () |
Redraw the plot. More... | |
Signals | |
void | itemAttached (QwtPlotItem *plotItem, bool on) |
void | legendDataChanged (const QVariant &itemInfo, const QList< QwtLegendData > &data) |
Public Member Functions | |
void | applyProperties (const QString &) |
bool | autoReplot () const |
bool | axisAutoScale (int axisId) const |
bool | axisEnabled (int axisId) const |
QFont | axisFont (int axisId) const |
QwtInterval | axisInterval (int axisId) const |
Return the current interval of the specified axis. More... | |
int | axisMaxMajor (int axisId) const |
int | axisMaxMinor (int axisId) const |
const QwtScaleDiv & | axisScaleDiv (int axisId) const |
Return the scale division of a specified axis. More... | |
const QwtScaleDraw * | axisScaleDraw (int axisId) const |
Return the scale draw of a specified axis. More... | |
QwtScaleDraw * | axisScaleDraw (int axisId) |
Return the scale draw of a specified axis. More... | |
QwtScaleEngine * | axisScaleEngine (int axisId) |
const QwtScaleEngine * | axisScaleEngine (int axisId) const |
double | axisStepSize (int axisId) const |
Return the step size parameter that has been set in setAxisScale. More... | |
QwtText | axisTitle (int axisId) const |
const QwtScaleWidget * | axisWidget (int axisId) const |
QwtScaleWidget * | axisWidget (int axisId) |
QWidget * | canvas () |
const QWidget * | canvas () const |
QBrush | canvasBackground () const |
virtual QwtScaleMap | canvasMap (int axisId) const |
virtual void | drawCanvas (QPainter *) |
virtual void | drawItems (QPainter *, const QRectF &, const QwtScaleMap maps[axisCnt]) const |
void | enableAxis (int axisId, bool tf=true) |
Enable or disable a specified axis. More... | |
virtual bool | event (QEvent *) |
Adds handling of layout requests. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Event filter. More... | |
QwtText | footer () const |
QwtTextLabel * | footerLabel () |
const QwtTextLabel * | footerLabel () const |
virtual void | getCanvasMarginsHint (const QwtScaleMap maps[], const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const |
Calculate the canvas margins. More... | |
QString | grabProperties () const |
virtual QwtPlotItem * | infoToItem (const QVariant &) const |
Identify the plot item according to an item info object, that has bee generated from itemToInfo(). More... | |
void | insertLegend (QwtAbstractLegend *, LegendPosition=QwtPlot::RightLegend, double ratio=-1.0) |
Insert a legend. More... | |
double | invTransform (int axisId, int pos) const |
virtual QVariant | itemToInfo (QwtPlotItem *) const |
Build an information, that can be used to identify a plot item on the legend. More... | |
QwtAbstractLegend * | legend () |
const QwtAbstractLegend * | legend () const |
virtual QSize | minimumSizeHint () const |
Return a minimum size hint. More... | |
QwtPlotLayout * | plotLayout () |
const QwtPlotLayout * | plotLayout () const |
QwtPlot (QWidget *=NULL) | |
Constructor. More... | |
QwtPlot (const QwtText &title, QWidget *=NULL) | |
Constructor. More... | |
void | setAutoReplot (bool=true) |
Set or reset the autoReplot option. More... | |
void | setAxisAutoScale (int axisId, bool on=true) |
Enable autoscaling for a specified axis. More... | |
void | setAxisFont (int axisId, const QFont &f) |
Change the font of an axis. More... | |
void | setAxisLabelAlignment (int axisId, Qt::Alignment) |
void | setAxisLabelRotation (int axisId, double rotation) |
void | setAxisMaxMajor (int axisId, int maxMajor) |
void | setAxisMaxMinor (int axisId, int maxMinor) |
void | setAxisScale (int axisId, double min, double max, double step=0) |
Disable autoscaling and specify a fixed scale for a selected axis. More... | |
void | setAxisScaleDiv (int axisId, const QwtScaleDiv &) |
Disable autoscaling and specify a fixed scale for a selected axis. More... | |
void | setAxisScaleDraw (int axisId, QwtScaleDraw *) |
Set a scale draw. More... | |
void | setAxisScaleEngine (int axisId, QwtScaleEngine *) |
void | setAxisTitle (int axisId, const QString &) |
Change the title of a specified axis. More... | |
void | setAxisTitle (int axisId, const QwtText &) |
Change the title of a specified axis. More... | |
void | setCanvas (QWidget *) |
Set the drawing canvas of the plot widget. More... | |
void | setCanvasBackground (const QBrush &) |
Change the background of the plotting area. More... | |
void | setFooter (const QString &) |
void | setFooter (const QwtText &t) |
void | setPlotLayout (QwtPlotLayout *) |
Assign a new plot layout. More... | |
void | setTitle (const QString &) |
void | setTitle (const QwtText &t) |
virtual QSize | sizeHint () const |
QwtText | title () const |
QwtTextLabel * | titleLabel () |
const QwtTextLabel * | titleLabel () const |
double | transform (int axisId, double value) const |
Transform a value into a coordinate in the plotting region. More... | |
void | updateAxes () |
Rebuild the axes scales. More... | |
void | updateCanvasMargins () |
Update the canvas margins. More... | |
virtual void | updateLayout () |
Adjust plot content to its current size. More... | |
void | updateLegend () |
void | updateLegend (const QwtPlotItem *) |
virtual | ~QwtPlot () |
Destructor. More... | |
Public Member Functions inherited from QwtPlotDict | |
bool | autoDelete () const |
void | detachItems (int rtti=QwtPlotItem::Rtti_PlotItem, bool autoDelete=true) |
const QwtPlotItemList & | itemList () const |
A QwtPlotItemList of all attached plot items. More... | |
QwtPlotItemList | itemList (int rtti) const |
QwtPlotDict () | |
void | setAutoDelete (bool) |
virtual | ~QwtPlotDict () |
Protected Member Functions | |
virtual void | resizeEvent (QResizeEvent *e) |
Protected Member Functions inherited from QwtPlotDict | |
void | insertItem (QwtPlotItem *) |
void | removeItem (QwtPlotItem *) |
Static Protected Member Functions | |
static bool | axisValid (int axisId) |
Properties | |
bool | autoReplot |
QBrush | canvasBackground |
Private Slots | |
void | updateLegendItems (const QVariant &itemInfo, const QList< QwtLegendData > &data) |
Update all plot items interested in legend attributes. More... | |
Private Member Functions | |
void | attachItem (QwtPlotItem *, bool) |
Attach/Detach a plot item. More... | |
void | deleteAxesData () |
void | initAxesData () |
Initialize axes. More... | |
void | initPlot (const QwtText &title) |
Initializes a QwtPlot instance. More... | |
void | updateScaleDiv () |
Private Attributes | |
AxisData * | d_axisData [axisCnt] |
PrivateData * | d_data |
Friends | |
class | QwtPlotItem |
A 2-D plotting widget.
QwtPlot is a widget for plotting two-dimensional graphs. An unlimited number of plot items can be displayed on its canvas. Plot items might be curves (QwtPlotCurve), markers (QwtPlotMarker), the grid (QwtPlotGrid), or anything else derived from QwtPlotItem. A plot can have up to four axes, with each plot item attached to an x- and a y axis. The scales at the axes can be explicitly set (QwtScaleDiv), or are calculated from the plot items, using algorithms (QwtScaleEngine) which can be configured separately for each axis.
The simpleplot example is a good starting point to see how to set up a plot widget.
#include <qwt_plot.h> #include <qwt_plot_curve.h> QwtPlot *myPlot = new QwtPlot("Two Curves", parent); // add curves QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2"); // connect or copy the data to the curves curve1->setData(...); curve2->setData(...); curve1->attach(myPlot); curve2->attach(myPlot); // finally, refresh the plot myPlot->replot();
Definition at line 74 of file qwt_plot.h.
enum QwtPlot::Axis |
Axis index.
Enumerator | |
---|---|
yLeft |
Y axis left of the canvas. |
yRight |
Y axis right of the canvas. |
xBottom |
X axis below the canvas. |
xTop |
X axis above the canvas. |
axisCnt |
Number of axes. |
Definition at line 93 of file qwt_plot.h.
Position of the legend, relative to the canvas.
Enumerator | |
---|---|
LeftLegend |
The legend will be left from the QwtPlot::yLeft axis. |
RightLegend |
The legend will be right from the QwtPlot::yRight axis. |
BottomLegend |
The legend will be below the footer. |
TopLegend |
The legend will be above the title. |
Definition at line 116 of file qwt_plot.h.
|
explicit |
|
explicit |
Constructor.
title | Title text |
parent | Parent widget |
Definition at line 121 of file qwt_plot.cpp.
|
virtual |
Destructor.
Definition at line 128 of file qwt_plot.cpp.
void QwtPlot::applyProperties | ( | const QString & | ) |
This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin.
Definition at line 18 of file qwt_plot_xml.cpp.
|
private |
Attach/Detach a plot item.
plotItem | Plot item |
on | When true attach the item, otherwise detach it |
Definition at line 1079 of file qwt_plot.cpp.
|
slot |
Replots the plot if autoReplot() is true
.
Definition at line 293 of file qwt_plot.cpp.
bool QwtPlot::autoReplot | ( | ) | const |
bool QwtPlot::axisAutoScale | ( | int | axisId | ) | const |
True
, if autoscaling is enabled axisId | Axis index |
Definition at line 186 of file qwt_plot_axis.cpp.
bool QwtPlot::axisEnabled | ( | int | axisId | ) | const |
True
, if a specified axis is enabled axisId | Axis index |
Definition at line 198 of file qwt_plot_axis.cpp.
QFont QwtPlot::axisFont | ( | int | axisId | ) | const |
axisId | Axis index |
Definition at line 210 of file qwt_plot_axis.cpp.
QwtInterval QwtPlot::axisInterval | ( | int | axisId | ) | const |
Return the current interval of the specified axis.
This is only a convenience function for axisScaleDiv( axisId )->interval();
axisId | Axis index |
Definition at line 317 of file qwt_plot_axis.cpp.
int QwtPlot::axisMaxMajor | ( | int | axisId | ) | const |
axisId | Axis index |
Definition at line 224 of file qwt_plot_axis.cpp.
int QwtPlot::axisMaxMinor | ( | int | axisId | ) | const |
axisId | Axis index |
Definition at line 237 of file qwt_plot_axis.cpp.
const QwtScaleDiv & QwtPlot::axisScaleDiv | ( | int | axisId | ) | const |
Return the scale division of a specified axis.
axisScaleDiv(axisId).lowerBound(), axisScaleDiv(axisId).upperBound() are the current limits of the axis scale.
axisId | Axis index |
Definition at line 256 of file qwt_plot_axis.cpp.
const QwtScaleDraw * QwtPlot::axisScaleDraw | ( | int | axisId | ) | const |
Return the scale draw of a specified axis.
axisId | Axis index |
Definition at line 267 of file qwt_plot_axis.cpp.
QwtScaleDraw * QwtPlot::axisScaleDraw | ( | int | axisId | ) |
Return the scale draw of a specified axis.
axisId | Axis index |
Definition at line 281 of file qwt_plot_axis.cpp.
QwtScaleEngine * QwtPlot::axisScaleEngine | ( | int | axisId | ) |
axisId | Axis index |
Definition at line 163 of file qwt_plot_axis.cpp.
const QwtScaleEngine * QwtPlot::axisScaleEngine | ( | int | axisId | ) | const |
axisId | Axis index |
Definition at line 175 of file qwt_plot_axis.cpp.
double QwtPlot::axisStepSize | ( | int | axisId | ) | const |
Return the step size parameter that has been set in setAxisScale.
This doesn't need to be the step size of the current scale.
axisId | Axis index |
Definition at line 299 of file qwt_plot_axis.cpp.
QwtText QwtPlot::axisTitle | ( | int | axisId | ) | const |
axisId | Axis index |
Definition at line 329 of file qwt_plot_axis.cpp.
|
staticprotected |
true
if the specified axis exists, otherwise false
axisId | axis index |
Definition at line 886 of file qwt_plot.cpp.
const QwtScaleWidget * QwtPlot::axisWidget | ( | int | axisId | ) | const |
axisId | Axis index |
Definition at line 113 of file qwt_plot_axis.cpp.
QwtScaleWidget * QwtPlot::axisWidget | ( | int | axisId | ) |
axisId | Axis index |
Definition at line 125 of file qwt_plot_axis.cpp.
QWidget * QwtPlot::canvas | ( | ) |
Definition at line 467 of file qwt_plot.cpp.
const QWidget * QwtPlot::canvas | ( | ) | const |
Definition at line 475 of file qwt_plot.cpp.
QBrush QwtPlot::canvasBackground | ( | ) | const |
|
virtual |
axisId | Axis |
Definition at line 790 of file qwt_plot.cpp.
|
private |
Definition at line 99 of file qwt_plot_axis.cpp.
|
virtual |
Redraw the canvas.
painter | Painter used for drawing |
Definition at line 735 of file qwt_plot.cpp.
|
virtual |
Redraw the canvas items.
painter | Painter used for drawing |
canvasRect | Bounding rectangle where to paint |
maps | QwtPlot::axisCnt maps, mapping between plot and paint device coordinates |
Definition at line 757 of file qwt_plot.cpp.
void QwtPlot::enableAxis | ( | int | axisId, |
bool | tf = true |
||
) |
Enable or disable a specified axis.
When an axis is disabled, this only means that it is not visible on the screen. Curves, markers and can be attached to disabled axes, and transformation of screen coordinates into values works as normal.
Only xBottom and yLeft are enabled by default.
axisId | Axis index |
tf | true (enabled) or false (disabled) |
Definition at line 350 of file qwt_plot_axis.cpp.
|
virtual |
Adds handling of layout requests.
event | Event |
Definition at line 241 of file qwt_plot.cpp.
|
virtual |
Event filter.
The plot handles the following events for the canvas:
object | Object to be filtered |
event | Event |
Reimplemented in PlotWidget.
Definition at line 275 of file qwt_plot.cpp.
QwtText QwtPlot::footer | ( | ) | const |
Definition at line 399 of file qwt_plot.cpp.
QwtTextLabel * QwtPlot::footerLabel | ( | ) |
Definition at line 405 of file qwt_plot.cpp.
const QwtTextLabel * QwtPlot::footerLabel | ( | ) | const |
Definition at line 411 of file qwt_plot.cpp.
|
virtual |
Calculate the canvas margins.
maps | QwtPlot::axisCnt maps, mapping between plot and paint device coordinates |
canvasRect | Bounding rectangle where to paint |
left | Return parameter for the left margin |
top | Return parameter for the top margin |
right | Return parameter for the right margin |
bottom | Return parameter for the bottom margin |
Plot items might indicate, that they need some extra space at the borders of the canvas by the QwtPlotItem::Margins flag.
updateCanvasMargins(), QwtPlotItem::getCanvasMarginHint()
Definition at line 667 of file qwt_plot.cpp.
QString QwtPlot::grabProperties | ( | ) | const |
This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin.
Definition at line 34 of file qwt_plot_xml.cpp.
|
virtual |
Identify the plot item according to an item info object, that has bee generated from itemToInfo().
The default implementation simply tries to unwrap a QwtPlotItem pointer:
itemInfo | Plot item |
Definition at line 1165 of file qwt_plot.cpp.
|
private |
Initialize axes.
Definition at line 37 of file qwt_plot_axis.cpp.
|
private |
Initializes a QwtPlot instance.
title | Title text |
Definition at line 142 of file qwt_plot.cpp.
void QwtPlot::insertLegend | ( | QwtAbstractLegend * | legend, |
QwtPlot::LegendPosition | pos = QwtPlot::RightLegend , |
||
double | ratio = -1.0 |
||
) |
Insert a legend.
If the position legend is QwtPlot::LeftLegend
or QwtPlot::RightLegend
the legend will be organized in one column from top to down. Otherwise the legend items will be placed in a table with a best fit number of columns from left to right.
insertLegend() will set the plot widget as parent for the legend. The legend will be deleted in the destructor of the plot or when another legend is inserted.
Legends, that are not inserted into the layout of the plot widget need to connect to the legendDataChanged() signal. Calling updateLegend() initiates this signal for an initial update. When the application code wants to implement its own layout this also needs to be done for rendering plots to a document ( see QwtPlotRenderer ).
legend | Legend |
pos | The legend's position. For top/left position the number of columns will be limited to 1, otherwise it will be set to unlimited. |
ratio | Ratio between legend and the bounding rectangle of title, canvas and axes. The legend will be shrunk if it would need more space than the given ratio. The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0 it will be reset to the default ratio. The default vertical/horizontal ratio is 0.33/0.5. |
Definition at line 924 of file qwt_plot.cpp.
double QwtPlot::invTransform | ( | int | axisId, |
int | pos | ||
) | const |
Transform the x or y coordinate of a position in the drawing region into a value.
axisId | Axis index |
pos | position |
Definition at line 371 of file qwt_plot_axis.cpp.
|
signal |
A signal indicating, that an item has been attached/detached
plotItem | Plot item |
on | Attached/Detached |
|
virtual |
Build an information, that can be used to identify a plot item on the legend.
The default implementation simply wraps the plot item into a QVariant object. When overloading itemToInfo() usually infoToItem() needs to reimplemeted too.
plotItem | Plot item |
Definition at line 1142 of file qwt_plot.cpp.
QwtAbstractLegend * QwtPlot::legend | ( | ) |
const QwtAbstractLegend * QwtPlot::legend | ( | ) | const |
|
signal |
A signal with the attributes how to update the legend entries for a plot item.
itemInfo | Info about a plot item, build from itemToInfo() |
data | Attributes of the entries ( usually <= 1 ) for the plot item. |
|
virtual |
Return a minimum size hint.
Definition at line 519 of file qwt_plot.cpp.
QwtPlotLayout * QwtPlot::plotLayout | ( | ) |
Definition at line 434 of file qwt_plot.cpp.
const QwtPlotLayout * QwtPlot::plotLayout | ( | ) | const |
Definition at line 440 of file qwt_plot.cpp.
|
virtualslot |
Redraw the plot.
If the autoReplot option is not set (which is the default) or if any curves are attached to raw data, the plot has to be refreshed explicitly in order to make changes visible.
Definition at line 546 of file qwt_plot.cpp.
|
protectedvirtual |
Resize and update internal layout
e | Resize event |
Reimplemented in PlotWidget.
Definition at line 531 of file qwt_plot.cpp.
void QwtPlot::setAutoReplot | ( | bool | tf = true | ) |
Set or reset the autoReplot option.
If the autoReplot option is set, the plot will be updated implicitly by manipulating member functions. Since this may be time-consuming, it is recommended to leave this option switched off and call replot() explicitly if necessary.
The autoReplot option is set to false by default, which means that the user has to call replot() in order to make changes visible.
tf | true or false . Defaults to true . |
Definition at line 314 of file qwt_plot.cpp.
void QwtPlot::setAxisAutoScale | ( | int | axisId, |
bool | on = true |
||
) |
Enable autoscaling for a specified axis.
This member function is used to switch back to autoscaling mode after a fixed scale has been set. Autoscaling is enabled by default.
axisId | Axis index |
on | On/Off |
Definition at line 423 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisFont | ( | int | axisId, |
const QFont & | font | ||
) |
Change the font of an axis.
axisId | Axis index |
font | Font |
Definition at line 404 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisLabelAlignment | ( | int | axisId, |
Qt::Alignment | alignment | ||
) |
Change the alignment of the tick labels
axisId | Axis index |
alignment | Or'd Qt::AlignmentFlags see <qnamespace.h> |
Definition at line 523 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisLabelRotation | ( | int | axisId, |
double | rotation | ||
) |
Rotate all tick labels
axisId | Axis index |
rotation | Angle in degrees. When changing the label rotation, the label alignment might be adjusted too. |
Definition at line 538 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisMaxMajor | ( | int | axisId, |
int | maxMajor | ||
) |
Set the maximum number of major scale intervals for a specified axis
axisId | Axis index |
maxMajor | Maximum number of major steps |
Definition at line 576 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisMaxMinor | ( | int | axisId, |
int | maxMinor | ||
) |
Set the maximum number of minor scale intervals for a specified axis
axisId | Axis index |
maxMinor | Maximum number of minor steps |
Definition at line 552 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisScale | ( | int | axisId, |
double | min, | ||
double | max, | ||
double | stepSize = 0 |
||
) |
Disable autoscaling and specify a fixed scale for a selected axis.
In updateAxes() the scale engine calculates a scale division from the specified parameters, that will be assigned to the scale widget. So updates of the scale widget usually happen delayed with the next replot.
axisId | Axis index |
min | Minimum of the scale |
max | Maximum of the scale |
stepSize | Major step size. If step == 0 , the step size is calculated automatically using the maxMajor setting. |
Definition at line 447 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisScaleDiv | ( | int | axisId, |
const QwtScaleDiv & | scaleDiv | ||
) |
Disable autoscaling and specify a fixed scale for a selected axis.
The scale division will be stored locally only until the next call of updateAxes(). So updates of the scale widget usually happen delayed with the next replot.
axisId | Axis index |
scaleDiv | Scale division |
Definition at line 476 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisScaleDraw | ( | int | axisId, |
QwtScaleDraw * | scaleDraw | ||
) |
Set a scale draw.
axisId | Axis index |
scaleDraw | Object responsible for drawing scales. |
By passing scaleDraw it is possible to extend QwtScaleDraw functionality and let it take place in QwtPlot. Please note that scaleDraw has to be created with new and will be deleted by the corresponding QwtScale member ( like a child object ).
Definition at line 506 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisScaleEngine | ( | int | axisId, |
QwtScaleEngine * | scaleEngine | ||
) |
Change the scale engine for an axis
axisId | Axis index |
scaleEngine | Scale engine |
Definition at line 141 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisTitle | ( | int | axisId, |
const QString & | title | ||
) |
Change the title of a specified axis.
axisId | Axis index |
title | axis title |
Definition at line 598 of file qwt_plot_axis.cpp.
void QwtPlot::setAxisTitle | ( | int | axisId, |
const QwtText & | title | ||
) |
Change the title of a specified axis.
axisId | Axis index |
title | Axis title |
Definition at line 610 of file qwt_plot_axis.cpp.
void QwtPlot::setCanvas | ( | QWidget * | canvas | ) |
Set the drawing canvas of the plot widget.
QwtPlot invokes methods of the canvas as meta methods ( see QMetaObject ). In opposite to using conventional C++ techniques like virtual methods they allow to use canvas implementations that are derived from QWidget or QGLWidget.
The following meta methods could be implemented:
The default canvas is a QwtPlotCanvas
canvas | Canvas Widget |
Definition at line 217 of file qwt_plot.cpp.
void QwtPlot::setCanvasBackground | ( | const QBrush & | brush | ) |
Change the background of the plotting area.
Sets brush to QPalette::Window of all color groups of the palette of the canvas. Using canvas()->setPalette() is a more powerful way to set these colors.
brush | New background brush |
Definition at line 861 of file qwt_plot.cpp.
void QwtPlot::setFooter | ( | const QString & | text | ) |
Change the text the footer
text | New text of the footer |
Definition at line 376 of file qwt_plot.cpp.
void QwtPlot::setFooter | ( | const QwtText & | text | ) |
Change the text the footer
text | New text of the footer |
Definition at line 389 of file qwt_plot.cpp.
void QwtPlot::setPlotLayout | ( | QwtPlotLayout * | layout | ) |
Assign a new plot layout.
layout | Layout() |
Definition at line 422 of file qwt_plot.cpp.
void QwtPlot::setTitle | ( | const QString & | title | ) |
void QwtPlot::setTitle | ( | const QwtText & | title | ) |
|
virtual |
Definition at line 484 of file qwt_plot.cpp.
QwtText QwtPlot::title | ( | ) | const |
Definition at line 355 of file qwt_plot.cpp.
QwtTextLabel * QwtPlot::titleLabel | ( | ) |
Definition at line 361 of file qwt_plot.cpp.
const QwtTextLabel * QwtPlot::titleLabel | ( | ) | const |
Definition at line 367 of file qwt_plot.cpp.
double QwtPlot::transform | ( | int | axisId, |
double | value | ||
) | const |
Transform a value into a coordinate in the plotting region.
axisId | Axis index |
value | value |
Definition at line 388 of file qwt_plot_axis.cpp.
void QwtPlot::updateAxes | ( | ) |
Rebuild the axes scales.
In case of autoscaling the boundaries of a scale are calculated from the bounding rectangles of all plot items, having the QwtPlotItem::AutoScale flag enabled ( QwtScaleEngine::autoScale() ). Then a scale division is calculated ( QwtScaleEngine::didvideScale() ) and assigned to scale widget.
When the scale boundaries have been assigned with setAxisScale() a scale division is calculated ( QwtScaleEngine::didvideScale() ) for this interval and assigned to the scale widget.
When the scale has been set explicitly by setAxisScaleDiv() the locally stored scale division gets assigned to the scale widget.
The scale widget indicates modifications by emitting a QwtScaleWidget::scaleDivChanged() signal.
updateAxes() is usually called by replot().
Definition at line 640 of file qwt_plot_axis.cpp.
void QwtPlot::updateCanvasMargins | ( | ) |
Update the canvas margins.
Plot items might indicate, that they need some extra space at the borders of the canvas by the QwtPlotItem::Margins flag.
getCanvasMarginsHint(), QwtPlotItem::getCanvasMarginHint()
Definition at line 701 of file qwt_plot.cpp.
|
virtual |
Adjust plot content to its current size.
Reimplemented in PlotWidget.
Definition at line 578 of file qwt_plot.cpp.
void QwtPlot::updateLegend | ( | ) |
Emit legendDataChanged() for all plot item
Definition at line 1014 of file qwt_plot.cpp.
void QwtPlot::updateLegend | ( | const QwtPlotItem * | plotItem | ) |
Emit legendDataChanged() for a plot item
plotItem | Plot item |
Definition at line 1030 of file qwt_plot.cpp.
|
privateslot |
Update all plot items interested in legend attributes.
Call QwtPlotItem::updateLegend(), when the QwtPlotItem::LegendInterest flag is set.
itemInfo | Info about the plot item |
legendData | Entries to be displayed for the plot item ( usually 1 ) |
Definition at line 1056 of file qwt_plot.cpp.
|
private |
|
friend |
Definition at line 296 of file qwt_plot.h.
Definition at line 305 of file qwt_plot.h.
|
private |
Definition at line 308 of file qwt_plot.h.
|
readwrite |
Definition at line 80 of file qwt_plot.h.
|
readwrite |
Nothing else than: canvas()->palette().brush( QPalette::Normal, QPalette::Window);
Definition at line 79 of file qwt_plot.h.