QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QwtPlotAbstractBarChart Class Reference

Abstract base class for bar chart items. More...

#include <qwt_plot_abstract_barchart.h>

Inheritance diagram for QwtPlotAbstractBarChart:
QwtPlotSeriesItem QwtPlotItem QwtAbstractSeriesStore QwtPlotBarChart QwtPlotMultiBarChart

Classes

class  PrivateData
 

Public Types

enum  LayoutPolicy { AutoAdjustSamples , ScaleSamplesToAxes , ScaleSampleToCanvas , FixedSampleSize }
 Mode how to calculate the bar width. More...
 
- Public Types inherited from QwtPlotItem
enum  RttiValues {
  Rtti_PlotItem = 0 , Rtti_PlotGrid , Rtti_PlotScale , Rtti_PlotLegend ,
  Rtti_PlotMarker , Rtti_PlotCurve , Rtti_PlotSpectroCurve , Rtti_PlotIntervalCurve ,
  Rtti_PlotHistogram , Rtti_PlotSpectrogram , Rtti_PlotGraphic , Rtti_PlotTradingCurve ,
  Rtti_PlotBarChart , Rtti_PlotMultiBarChart , Rtti_PlotShape , Rtti_PlotTextLabel ,
  Rtti_PlotZone , Rtti_PlotVectorField , Rtti_PlotArrowMarker , Rtti_PlotBoxChart ,
  Rtti_PlotUserItem = 1000
}
 Runtime type information. More...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 , Margins = 0x04 }
 Plot Item Attributes. More...
 
enum  ItemInterest { ScaleInterest = 0x01 , LegendInterest = 0x02 }
 Plot Item Interests. More...
 
enum  RenderHint { RenderAntialiased = 0x1 }
 Render hints . More...
 

Public Member Functions

 QwtPlotAbstractBarChart (const QwtText &title)
 Constructor.
 
virtual ~QwtPlotAbstractBarChart ()
 Destructor .
 
void setLayoutPolicy (LayoutPolicy)
 Set the layout policy.
 
LayoutPolicy layoutPolicy () const
 Get the layout policy.
 
void setLayoutHint (double)
 Set the layout hint.
 
double layoutHint () const
 Get the layout hint.
 
void setSpacing (int)
 Set the spacing between bars.
 
int spacing () const
 Get the spacing between bars.
 
void setMargin (int)
 Set the margin around the bars.
 
int margin () const
 Get the margin around the bars.
 
void setBaseline (double)
 Set the baseline value.
 
double baseline () const
 Get the baseline value.
 
virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const override
 Calculate a hint for the canvas margin.
 
- Public Member Functions inherited from QwtPlotSeriesItem
 QwtPlotSeriesItem (const QString &title=QString())
 Constructor.
 
 QwtPlotSeriesItem (const QwtText &title)
 Constructor.
 
virtual ~QwtPlotSeriesItem ()
 Destructor .
 
void setOrientation (Qt::Orientation)
 Set the orientation of the item.
 
Qt::Orientation orientation () const
 Get the orientation of the plot item.
 
virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
 Draw the complete series.
 
virtual void drawSeries (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
 Draw a subset of the samples.
 
virtual QRectF boundingRect () const override
 Get the bounding rectangle.
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override
 Update the scale divisions.
 
- Public Member Functions inherited from QwtPlotItem
 QwtPlotItem ()
 Default constructor.
 
 QwtPlotItem (const QString &title)
 Constructor with title as QString.
 
 QwtPlotItem (const QwtText &title)
 Constructor with title as QwtText.
 
virtual ~QwtPlotItem ()
 Destructor.
 
void attach (QwtPlot *plot)
 Attach the item to a plot.
 
void detach ()
 Detach the item from the plot.
 
QwtPlotplot () const
 Get the plot the item is attached to.
 
void setTitle (const QString &title)
 Set the title using a QString.
 
void setTitle (const QwtText &title)
 Set the title using a QwtText.
 
const QwtTexttitle () const
 Get the title.
 
virtual int rtti () const
 Runtime type information.
 
void setItemAttribute (ItemAttribute, bool on=true)
 Set an item attribute.
 
bool testItemAttribute (ItemAttribute) const
 Test an item attribute.
 
void setItemInterest (ItemInterest, bool on=true)
 Set an item interest.
 
bool testItemInterest (ItemInterest) const
 Test an item interest.
 
void setRenderHint (RenderHint, bool on=true)
 Set a render hint.
 
bool testRenderHint (RenderHint) const
 Test a render hint.
 
void setRenderThreadCount (uint numThreads)
 Set the number of render threads.
 
uint renderThreadCount () const
 Get the number of render threads.
 
void setLegendIconSize (const QSize &)
 Set the legend icon size.
 
QSize legendIconSize () const
 Get the legend icon size.
 
double z () const
 Get the z-value.
 
void setZ (double z)
 Set the z-value.
 
void show ()
 Show the item.
 
void hide ()
 Hide the item.
 
virtual void setVisible (bool)
 Set the visibility.
 
bool isVisible () const
 Check if the item is visible.
 
void setAxes (QwtAxisId xAxis, QwtAxisId yAxis)
 Set both axes.
 
void setXAxis (QwtAxisId)
 Set the x-axis.
 
QwtAxisId xAxis () const
 Get the x-axis.
 
void setYAxis (QwtAxisId)
 Set the y-axis.
 
QwtAxisId yAxis () const
 Get the y-axis.
 
virtual void itemChanged ()
 Notify the plot that the item has changed.
 
virtual void legendChanged ()
 Notify the item that the legend has changed.
 
virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)
 Update the item with changes of the legend.
 
QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the scale rectangle.
 
QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) const
 Calculate the paint rectangle.
 
virtual QList< QwtLegendDatalegendData () const
 Return legend data.
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const
 Return a legend icon.
 

Protected Member Functions

double sampleWidth (const QwtScaleMap &map, double canvasSize, double boundingSize, double value) const
 Calculate the width for a sample in paint device coordinates.
 
- Protected Member Functions inherited from QwtPlotSeriesItem
virtual void dataChanged () override
 dataChanged() indicates, that the series has been changed.
 
- Protected Member Functions inherited from QwtPlotItem
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) const
 Create a default icon.
 
- Protected Member Functions inherited from QwtAbstractSeriesStore
virtual void setRectOfInterest (const QRectF &)=0
 Set a the "rectangle of interest" for the stored series.
 
virtual QRectF dataRect () const =0
 
virtual size_t dataSize () const =0
 

Detailed Description

Abstract base class for bar chart items.

Member Enumeration Documentation

◆ LayoutPolicy

Mode how to calculate the bar width.

setLayoutPolicy(), setLayoutHint(), barWidthHint()

Enumerator
AutoAdjustSamples 

The sample width is calculated by dividing the bounding rectangle by the number of samples.

The layoutHint() is used as a minimum width in paint device coordinates.

See also
boundingRectangle()
ScaleSamplesToAxes 

layoutHint() defines an interval in axis coordinates

ScaleSampleToCanvas 

The bar width is calculated by multiplying layoutHint() with the height or width of the canvas.

See also
boundingRectangle()
FixedSampleSize 

layoutHint() defines a fixed width in paint device coordinates.

Constructor & Destructor Documentation

◆ QwtPlotAbstractBarChart()

QwtPlotAbstractBarChart::QwtPlotAbstractBarChart ( const QwtText title)
explicit

Constructor.

◆ ~QwtPlotAbstractBarChart()

QwtPlotAbstractBarChart::~QwtPlotAbstractBarChart ( )
virtual

Destructor .

Member Function Documentation

◆ baseline()

double QwtPlotAbstractBarChart::baseline ( ) const

Get the baseline value.

◆ getCanvasMarginHint()

void QwtPlotAbstractBarChart::getCanvasMarginHint ( const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect,
double &  left,
double &  top,
double &  right,
double &  bottom 
) const
overridevirtual

Calculate a hint for the canvas margin.

Reimplemented from QwtPlotItem.

◆ layoutHint()

double QwtPlotAbstractBarChart::layoutHint ( ) const

Get the layout hint.

◆ layoutPolicy()

QwtPlotAbstractBarChart::LayoutPolicy QwtPlotAbstractBarChart::layoutPolicy ( ) const

Get the layout policy.

◆ margin()

int QwtPlotAbstractBarChart::margin ( ) const

Get the margin around the bars.

◆ sampleWidth()

double QwtPlotAbstractBarChart::sampleWidth ( const QwtScaleMap map,
double  canvasSize,
double  boundingSize,
double  value 
) const
protected

Calculate the width for a sample in paint device coordinates.

Parameters
mapScale map for the corresponding scale
canvasSizeSize of the canvas in paint device coordinates
boundingSizeBounding size of the chart in plot coordinates ( used in AutoAdjustSamples mode )
valueValue of the sample
Returns
Sample width
See also
layoutPolicy(), layoutHint()

◆ setBaseline()

void QwtPlotAbstractBarChart::setBaseline ( double  value)

Set the baseline value.

◆ setLayoutHint()

void QwtPlotAbstractBarChart::setLayoutHint ( double  hint)

Set the layout hint.

◆ setLayoutPolicy()

void QwtPlotAbstractBarChart::setLayoutPolicy ( LayoutPolicy  policy)

Set the layout policy.

◆ setMargin()

void QwtPlotAbstractBarChart::setMargin ( int  margin)

Set the margin around the bars.

◆ setSpacing()

void QwtPlotAbstractBarChart::setSpacing ( int  spacing)

Set the spacing between bars.

◆ spacing()

int QwtPlotAbstractBarChart::spacing ( ) const

Get the spacing between bars.


The documentation for this class was generated from the following files: