QwtPlotBarChart(3)
π QwtPlotBarChart(3) β Library Functions Manual π
πΈ NAME πΈ
QwtPlotBarChart β QwtPlotBarChart displays a series of a values as bars.
This is the manual page for QwtPlotBarChart(3), so the manual name is folded in right here, bestie.
π¦ SYNOPSIS π¦
#include <qwt_plot_barchart.h>
Inherits QwtPlotAbstractBarChart, and QwtSeriesStore< QPointF >.
π Public Types π
enum LegendMode { LegendChartTitle, LegendBarTitles }β Legend modes.
π§ Public Types inherited from QwtPlotAbstractBarChart π§
enum LayoutPolicy { AutoAdjustSamples, ScaleSamplesToAxes, ScaleSampleToCanvas, FixedSampleSize }β Mode how to calculate the bar width.
π 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_PlotUserItem = 1000 }β Runtime type information.enum ItemAttribute { Legend = 0x01, AutoScale = 0x02, Margins = 0x04 }β Plot Item Attributes.enum ItemInterest { ScaleInterest = 0x01, LegendInterest = 0x02 }β Plot Item Interests.enum RenderHint { RenderAntialiased = 0x1 }β Render hints.typedef QFlags< ItemAttribute > ItemAttributestypedef QFlags< ItemInterest > ItemIntereststypedef QFlags< RenderHint > RenderHints
π Public Member Functions π
QwtPlotBarChart (const QString &title=QString())QwtPlotBarChart (const QwtText &title)virtual ~QwtPlotBarChart ()β Destructor.virtual int rtti () const overridevoid setSamples (const QVector< QPointF > &)void setSamples (const QVector< double > &)void setSamples (QwtSeriesData< QPointF > *)void setSymbol (QwtColumnSymbol *)β Assign a symbol.const QwtColumnSymbol * symbol () constvoid setLegendMode (LegendMode)LegendMode legendMode () constvirtual void drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const overridevirtual QRectF boundingRect () const overridevirtual QwtColumnSymbol * specialSymbol (int sampleIndex, const QPointF &) constvirtual QwtText barTitle (int sampleIndex) constβ Return the title of a bar.
π¦ Public Member Functions inherited from QwtPlotAbstractBarChart π¦
QwtPlotAbstractBarChart (const QwtText &title)virtual ~QwtPlotAbstractBarChart ()β Destructor.void setLayoutPolicy (LayoutPolicy)LayoutPolicy layoutPolicy () constvoid setLayoutHint (double)double layoutHint () constvoid setSpacing (int)β Set the spacing.int spacing () constvoid setMargin (int)β Set the margin.int margin () constvoid setBaseline (double)β Set the baseline.double baseline () constvirtual 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())QwtPlotSeriesItem (const QwtText &title)virtual ~QwtPlotSeriesItem ()β Destructor.void setOrientation (Qt::Orientation)Qt::Orientation orientation () constvirtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const overrideβ Draw the complete series.virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) overrideβ Update the item to changes of the axes scale division.
π Public Member Functions inherited from QwtPlotItem π
QwtPlotItem ()QwtPlotItem (const QString &title)QwtPlotItem (const QwtText &title)virtual ~QwtPlotItem ()β Destroy theQwtPlotItem.void attach (QwtPlot *plot)β Attach the item to a plot.void detach ()β This method detaches aQwtPlotItemfrom anyQwtPlotit has been associated with.QwtPlot * plot () constβ Return attached plot.void setTitle (const QString &title)void setTitle (const QwtText &title)const QwtText & title () constvoid setItemAttribute (ItemAttribute, bool on=true)bool testItemAttribute (ItemAttribute) constvoid setItemInterest (ItemInterest, bool on=true)bool testItemInterest (ItemInterest) constvoid setRenderHint (RenderHint, bool on=true)bool testRenderHint (RenderHint) constvoid setRenderThreadCount (uint numThreads)uint renderThreadCount () constvoid setLegendIconSize (const QSize &)QSize legendIconSize () constdouble z () constvoid setZ (double z)β Set the z value.void show ()β Show the item.void hide ()β Hide the item.virtual void setVisible (bool)bool isVisible () constvoid setAxes (QwtAxisId xAxis, QwtAxisId yAxis)void setXAxis (QwtAxisId)QwtAxisId xAxis () constβ Return xAxis.void setYAxis (QwtAxisId)QwtAxisId yAxis () constβ Return yAxis.virtual void itemChanged ()virtual void legendChanged ()virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)β Update the item to changes of the legend info.QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) constβ Calculate the bounding scale rectangle of 2 maps.QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) constβ Calculate the bounding paint rectangle of 2 maps.
π Public Member Functions inherited from QwtAbstractSeriesStore π
virtual ~QwtAbstractSeriesStore ()β Destructor.
π Public Member Functions inherited from QwtSeriesStore< QPointF > π
QwtSeriesStore ()β Constructor The store contains no series.~QwtSeriesStore ()β Destructor.void setData (QwtSeriesData< QPointF > *series)QwtSeriesData< QPointF > * data ()QPointF sample (int index) constvirtual size_t dataSize () const overridevirtual QRectF dataRect () const overridevirtual void setRectOfInterest (const QRectF &rect) overrideQwtSeriesData< QPointF > * swapData (QwtSeriesData< QPointF > *series)
π§ Protected Member Functions π§
virtual void drawSample (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, int index, const QPointF &sample) constvirtual void drawBar (QPainter *, int sampleIndex, const QPointF &sample, const QwtColumnRect &) constQwtColumnRect columnRect (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, const QPointF &sample) constQList< QwtLegendData > legendData () const overrideβ Return all information, that is needed to represent the item on the legend.QwtGraphic legendIcon (int index, const QSizeF &) const override
πΏ Protected Member Functions inherited from QwtPlotAbstractBarChart πΏ
double sampleWidth (const QwtScaleMap &map, double canvasSize, double boundingSize, double value) const
π± 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β Return a default icon from a brush.
π Detailed Description π
QwtPlotBarChart displays a series of a values as bars. That's the whole assignment, bestie.
Each bar might be customized individually by implementing a specialSymbol(). Otherwise it is rendered using a default symbol.
Depending on its orientation() the bars are displayed horizontally or vertically. The bars cover the interval between the baseline() and the value.
By activating the LegendBarTitles mode each sample will have its own entry on the legend.
The most common use case of a bar chart is literally a list of y coordinates, where the x coordinate is simply the index in the list. But for other situations ( f.e. when values are related to dates ) it is also possible to set x coordinates explicitly.
See also: QwtPlotMultiBarChart, QwtPlotHistogram, QwtPlotCurve::Sticks, QwtPlotSeriesItem::orientation(), QwtPlotAbstractBarChart::baseline().
Source: Definition at line 41 of file qwt_plot_barchart.h.
π Member Enumeration Documentation π
π
enum QwtPlotBarChart::LegendMode π
Legend modes. The default setting is QwtPlotBarChart::LegendChartTitle.
See also: setLegendMode(), legendMode().
β¨ Enumerator β¨
LegendChartTitleβ One entry on the legend showing the default symbol and thetitle()of the chart. See also:QwtPlotItem::title().LegendBarTitlesβ One entry for each value showing the individual symbol of the corresponding bar and the bar title. See also:specialSymbol(),barTitle().
Source: Definition at line 52 of file qwt_plot_barchart.h.
π Constructor & Destructor Documentation π
π¦ QwtPlotBarChart::QwtPlotBarChart (const QString & title = QString()) π¦
[explicit] Constructor
Parameters: title β Title of the curve.
Source: Definition at line 51 of file qwt_plot_barchart.cpp.
πΈ QwtPlotBarChart::QwtPlotBarChart (const QwtText & title) πΈ
[explicit] Constructor
Parameters: title β Title of the curve.
Source: Definition at line 41 of file qwt_plot_barchart.cpp.
π QwtPlotBarChart::~QwtPlotBarChart () π
[virtual] Destructor.
Source: Definition at line 58 of file qwt_plot_barchart.cpp.
π MEMBER FUNCTION DOCUMENTATION π
okay bestie, this is the big one β every single member function, laid out one by one. no skipping, no "you get the idea". we're doing all of them. grab a snack π
π barTitle π
QwtText QwtPlotBarChart::barTitle (int sampleIndex) const [virtual]
Returns the title of a bar. In LegendBarTitles mode that title is what shows up on the legend entry matching that bar.
The default implementation is literally just a dummy β it's intended to be overloaded by you, the main character. so if you want real titles, you're gonna have to do the work yourself π
Parameters
sampleIndexβ Index of the bar
Returns
An empty text
See also
LegendBarTitles
Definition at line399of fileqwt_plot_barchart.cpp.
π¦ boundingRect π¦
QRectF QwtPlotBarChart::boundingRect () const [override], [virtual]
Returns
Bounding rectangle of all samples. For an empty series the rectangle is invalid β so like, no samples, no rectangle, that's just how it is π
Reimplemented from QwtPlotSeriesItem.
Definition at line186of fileqwt_plot_barchart.cpp.
β¨ columnRect β¨
QwtColumnRect QwtPlotBarChart::columnRect (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, const QwtInterval & boundingInterval, const QPointF & sample) const [protected]
Calculates the geometry of a bar in widget coordinates. this is the "where does the bar physically go" function, lowkey iconic.
Parameters
xMapβ x mapyMapβ y mapcanvasRectβ Contents rect of the canvasboundingIntervalβ Bounding interval of sample valuessampleβ Value of the sample
Returns
Geometry of the column
Definition at line262of fileqwt_plot_barchart.cpp.
πΈ drawBar πΈ
void QwtPlotBarChart::drawBar (QPainter * painter, int sampleIndex, const QPointF & sample, const QwtColumnRect & rect) const [protected], [virtual]
Draws a bar. one bar. that's the whole vibe.
Parameters
painterβ PaintersampleIndexβ Index of the sample represented by the barsampleβ Value of the samplerectβ Bounding rectangle of the bar
Definition at line341of fileqwt_plot_barchart.cpp.
π§ drawSample π§
void QwtPlotBarChart::drawSample (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, const QwtInterval & boundingInterval, int index, const QPointF & sample) const [protected], [virtual]
Draws a sample. β¨
Parameters
painterβ PainterxMapβ x mapyMapβ y mapcanvasRectβ Contents rect of the canvasboundingIntervalβ Bounding interval of sample valuesindexβ Index of the samplesampleβ Value of the sample
See also
drawSeries()
Definition at line322of fileqwt_plot_barchart.cpp.
π₯ drawSeries π₯
void QwtPlotBarChart::drawSeries (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from, int to) const [override], [virtual]
Draws an interval of the bar chart. this is the group-chat-wide version of drawing, not just one little bar.
Parameters
painterβ PainterxMapβ Maps x-values into pixel coordinates.yMapβ Maps y-values into pixel coordinates.canvasRectβ Contents rect of the canvasfromβ Index of the first point to be paintedtoβ Index of the last point to be painted. Ifto<0the curve will be painted to its last point.
See also
drawSymbols()
Implements QwtPlotSeriesItem.
Definition at line223of fileqwt_plot_barchart.cpp.
π legendData π
QList< QwtLegendData > QwtPlotBarChart::legendData () const [override], [protected], [virtual]
Returns all the info needed to represent the item on the legend. In case of LegendBarTitles you get an entry for each bar β otherwise the chart is represented like any other plot item from its title() and the legendIcon(). slay.
Returns
Information, that is needed to represent the item on the legend
See also
title(), setLegendMode(), barTitle(), QwtLegend, QwtPlotLegendItem
Reimplemented from QwtPlotItem.
Definition at line416of fileqwt_plot_barchart.cpp.
π legendIcon π
QwtGraphic QwtPlotBarChart::legendIcon (int index, const QSizeF & size) const [override], [protected], [virtual]
Returns
Icon representing a bar or the chart on the legend
When the legendMode() is LegendBarTitles the icon shows the bar corresponding to index β otherwise the bar displays the default symbol. iykyk π«Ά
Parameters
indexβ Index of the legend entrysizeβ Icon size
See also
setLegendMode(), drawBar(), QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()
Reimplemented from QwtPlotItem.
Definition at line462of fileqwt_plot_barchart.cpp.
π legendMode π
QwtPlotBarChart::LegendMode QwtPlotBarChart::legendMode () const
Returns
Legend mode
See also
setLegendMode()
Definition at line177of fileqwt_plot_barchart.cpp.
β rtti β
int QwtPlotBarChart::rtti () const [override], [virtual]
Returns
QwtPlotItem::Rtti_PlotBarChart
Reimplemented from QwtPlotItem.
Definition at line70of fileqwt_plot_barchart.cpp.
π setLegendMode π
void QwtPlotBarChart::setLegendMode (LegendMode mode)
Sets the mode that decides what to display on the legend.
Heads up bestie: in case of LegendBarTitles, barTitle() needs to be overloaded to return individual titles for each bar. no overload, no cute per-bar titles π
Parameters
modeβ New mode
See also
legendMode(), legendData(), barTitle(), QwtPlotItem::ItemAttribute
Definition at line164of fileqwt_plot_barchart.cpp.
π setSamples (the doubles one) π
void QwtPlotBarChart::setSamples (const QVector< double > & samples)
Initializes data with an array of doubles.
The indices in the array are taken as the x coordinate, while the doubles are interpreted as y values. so like, position = index, height = the value. periodt.
Parameters
samplesβ Vector of y coordinates
Note
QVector is implicitly shared
Definition at line97of fileqwt_plot_barchart.cpp.
π¦ setSamples (the points one) π¦
void QwtPlotBarChart::setSamples (const QVector< QPointF > & samples)
Initializes data with an array of points.
Parameters
samplesβ Vector of points
Note
QVector is implicitly shared
QPolygonF is derived from QVector<QPointF>
Definition at line82of fileqwt_plot_barchart.cpp.
π setSamples (the data object one) π
void QwtPlotBarChart::setSamples (QwtSeriesData< QPointF > * data)
Assigns a series of samples.
setSamples() is just a wrapper for setData() without any additional value β beside that it is easier to find for the developer. honestly? relatable. naming things is hard π
Parameters
dataβ Data
Warning π¨ the item takes ownership of the data object, deleting it when it's not used anymore. so don't go deleting it yourself or you'll have a bad time.
Definition at line119of fileqwt_plot_barchart.cpp.
πΈ setSymbol πΈ
void QwtPlotBarChart::setSymbol (QwtColumnSymbol * symbol)
Assigns a symbol. The bar chart will take the ownership of the symbol, hence the previously set symbol will be delete by setting a new one. If symbol is NULL no symbol will be drawn.
Parameters
symbolβ Symbol
See also
symbol()
Definition at line134of fileqwt_plot_barchart.cpp.
π§ specialSymbol π§
QwtColumnSymbol * QwtPlotBarChart::specialSymbol (int sampleIndex, const QPointF & sample) const [virtual]
Needs to be overloaded to return a non default symbol for a specific sample. so like, if one bar deserves its own look, this is your moment β¨
Parameters
sampleIndexβ Index of the sample represented by the barsampleβ Value of the sample
Returns
NULL, indicating to use the default symbol
Definition at line377of fileqwt_plot_barchart.cpp.
π symbol π
const QwtColumnSymbol * QwtPlotBarChart::symbol () const
Returns
Current symbol or NULL, when no symbol has been assigned
See also
setSymbol()
Definition at line150of fileqwt_plot_barchart.cpp.
π AUTHOR π
Generated automatically by Doxygen for Qwt User's Guide from the source code. so no, a human didn't hand-write this one β the robot did it for us π«Ά
aaaand that's the whole page, bestie! π this was the Qwt User's Guide rendition of QwtPlotBarChart(3) β go forth and draw some iconic bars. no cap, you've got this πβ¨
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms