QwtPlotMultiBarChart(3)

πŸ’– QwtPlotMultiBarChart(3) πŸ’–

From the Library Functions Manual, bestie. This is the whole page, full detail, no skips. 🫢

🌸 NAME 🌸

QwtPlotMultiBarChart β€” okay so this plot item displays a series of samples, and each sample consists of a set of values. That’s the vibe. πŸ’…

✨ SYNOPSIS ✨

#include <qwt_plot_multi_barchart.h>

Inherits QwtPlotAbstractBarChart, and QwtSeriesStore< QwtSetSample >.

πŸŽ€ Public Types πŸŽ€

  • enum ChartStyle { Grouped, Stacked } β€” chart styles, bestie.

πŸ¦‹ 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 > ItemAttributes
  • typedef QFlags< ItemInterest > ItemInterests
  • typedef QFlags< RenderHint > RenderHints

πŸ’… Public Member Functions πŸ’…

  • QwtPlotMultiBarChart (const QString &title=QString())
  • QwtPlotMultiBarChart (const QwtText &title)
  • virtual ~QwtPlotMultiBarChart () β€” destructor.
  • virtual int rtti () const override
  • void setBarTitles (const QList< QwtText > &) β€” sets the titles for the bars.
  • QList< QwtText > barTitles () const
  • void setSamples (const QVector< QwtSetSample > &)
  • void setSamples (const QVector< QVector< double > > &)
  • void setSamples (QwtSeriesData< QwtSetSample > *)
  • void setStyle (ChartStyle style)
  • ChartStyle style () const
  • void setSymbol (int valueIndex, QwtColumnSymbol *) β€” adds a symbol to the symbol map.
  • const QwtColumnSymbol * symbol (int valueIndex) const
  • void resetSymbolMap ()
  • virtual void drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override
  • virtual QRectF boundingRect () const override
  • virtual QList< QwtLegendData > legendData () const override
  • virtual QwtGraphic legendIcon (int index, const QSizeF &) const override

🌈 Public Member Functions inherited from QwtPlotAbstractBarChart

  • QwtPlotAbstractBarChart (const QwtText &title)
  • virtual ~QwtPlotAbstractBarChart () β€” destructor.
  • void setLayoutPolicy (LayoutPolicy)
  • LayoutPolicy layoutPolicy () const
  • void setLayoutHint (double)
  • double layoutHint () const
  • void setSpacing (int) β€” sets the spacing.
  • int spacing () const
  • void setMargin (int) β€” sets the margin.
  • int margin () const
  • void setBaseline (double) β€” sets the baseline.
  • double baseline () const
  • virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const override β€” calculates 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 () const
  • virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override β€” draws the complete series.
  • virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override β€” updates 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 () β€” destroys the QwtPlotItem.
  • void attach (QwtPlot *plot) β€” attaches the item to a plot.
  • void detach () β€” this method detaches a QwtPlotItem from any QwtPlot it has been associated with.
  • QwtPlot * plot () const β€” returns the attached plot.
  • void setTitle (const QString &title)
  • void setTitle (const QwtText &title)
  • const QwtText & title () const
  • void setItemAttribute (ItemAttribute, bool on=true)
  • bool testItemAttribute (ItemAttribute) const
  • void setItemInterest (ItemInterest, bool on=true)
  • bool testItemInterest (ItemInterest) const
  • void setRenderHint (RenderHint, bool on=true)
  • bool testRenderHint (RenderHint) const
  • void setRenderThreadCount (uint numThreads)
  • uint renderThreadCount () const
  • void setLegendIconSize (const QSize &)
  • QSize legendIconSize () const
  • double z () const
  • void setZ (double z) β€” sets the z value.
  • void show () β€” shows the item.
  • void hide () β€” hides the item.
  • virtual void setVisible (bool)
  • bool isVisible () const
  • void setAxes (QwtAxisId xAxis, QwtAxisId yAxis)
  • void setXAxis (QwtAxisId)
  • QwtAxisId xAxis () const β€” returns xAxis.
  • void setYAxis (QwtAxisId)
  • QwtAxisId yAxis () const β€” returns yAxis.
  • virtual void itemChanged ()
  • virtual void legendChanged ()
  • virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &) β€” updates the item to changes of the legend info.
  • QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) const β€” calculates the bounding scale rectangle of 2 maps.
  • QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) const β€” calculates the bounding paint rectangle of 2 maps.

🌈 Public Member Functions inherited from QwtAbstractSeriesStore

  • virtual ~QwtAbstractSeriesStore () β€” destructor.

🌈 Public Member Functions inherited from QwtSeriesStore< QwtSetSample >

  • QwtSeriesStore () β€” constructor. The store contains no series.
  • ~QwtSeriesStore () β€” destructor.
  • void setData (QwtSeriesData< QwtSetSample > *series)
  • QwtSeriesData< QwtSetSample > * data ()
  • QwtSetSample sample (int index) const
  • virtual size_t dataSize () const override
  • virtual QRectF dataRect () const override
  • virtual void setRectOfInterest (const QRectF &rect) override
  • QwtSeriesData< QwtSetSample > * swapData (QwtSeriesData< QwtSetSample > *series)

🧚 Protected Member Functions 🧚

  • QwtColumnSymbol * symbol (int valueIndex)
  • virtual QwtColumnSymbol * specialSymbol (int sampleIndex, int valueIndex) const β€” creates a symbol for special values.
  • virtual void drawSample (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, const QwtInterval &boundingInterval, int index, const QwtSetSample &) const
  • virtual void drawBar (QPainter *, int sampleIndex, int valueIndex, const QwtColumnRect &) const
  • void drawStackedBars (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &) const
  • void drawGroupedBars (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int index, double sampleWidth, const QwtSetSample &) const

πŸ“ 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 β€” returns a default icon from a brush.

🌟 Detailed Description 🌟

Okay so QwtPlotMultiBarChart displays a series of samples, and each sample consists of a set of values. Iconic. πŸ’–

Each value is displayed as a bar, and the bars of each set can be organized side by side or accumulated.

Each bar of a set is rendered by a QwtColumnSymbol, that is set by setSymbol(). The bars of different sets use the same symbols. Exceptions are possible by overloading specialSymbol() or overloading drawBar().

Depending on its orientation() the bars are displayed horizontally or vertically. The bars cover the interval between the baseline() and the value.

In opposite to most other plot items, QwtPlotMultiBarChart returns more than one entry for the legend β€” one for each symbol. Not me being extra, that’s literally the design. πŸ‘‘

See also: QwtPlotBarChart, QwtPlotHistogram QwtPlotSeriesItem::orientation(), QwtPlotAbstractBarChart::baseline() β€” go peek at those too.

Definition at line 41 of file qwt_plot_multi_barchart.h.

🏷️ Member Enumeration Documentation 🏷️

enum QwtPlotMultiBarChart::ChartStyle

Chart styles. The default setting is QwtPlotMultiBarChart::Grouped.

See also: setStyle(), style()

Enumerator

  • Grouped β€” the bars of a set are displayed side by side.
  • Stacked β€” the bars are displayed on top of each other accumulating to a single bar. All values of a set need to have the same sign.

Definition at line 52 of file qwt_plot_multi_barchart.h.

🧸 Constructor & Destructor Documentation 🧸

QwtPlotMultiBarChart::QwtPlotMultiBarChart (const QString & title = QString()) [explicit]

Constructor.

Parameters: title β€” title of the chart

Definition at line 62 of file qwt_plot_multi_barchart.cpp.

QwtPlotMultiBarChart::QwtPlotMultiBarChart (const QwtText & title) [explicit]

Constructor.

Parameters: title β€” title of the chart

Definition at line 52 of file qwt_plot_multi_barchart.cpp.

QwtPlotMultiBarChart::~QwtPlotMultiBarChart () [virtual]

Destructor.

Definition at line 69 of file qwt_plot_multi_barchart.cpp.

πŸ’… MEMBER FUNCTION DOCUMENTATION πŸ’…

πŸŽ€ QList< QwtText > QwtPlotMultiBarChart::barTitles () const πŸŽ€

okay bestie, this one just hands you the bar titles, no cap.

  • Returns: Bar titles
  • See also: setBarTitles(), legendData()
  • Definition at line 148 of file qwt_plot_multi_barchart.cpp.

πŸ¦‹ QRectF QwtPlotMultiBarChart::boundingRect () const [override], [virtual] πŸ¦‹

This gives you the bounding rectangle of, like, all the samples. For an empty series the rectangle is invalid β€” so if it’s empty, don’t expect a cute little box, bestie.

  • Returns: Bounding rectangle of all samples. For an empty series the rectangle is invalid.
  • Reimplemented from: QwtPlotSeriesItem
  • Definition at line 302 of file qwt_plot_multi_barchart.cpp.

🌸 void QwtPlotMultiBarChart::drawBar (QPainter * painter, int sampleIndex, int valueIndex, const QwtColumnRect & rect) const [protected], [virtual] 🌸

Draw a bar. Literally the bar-drawing moment. Iconic.

  • painter β€” Painter
  • sampleIndex β€” Index of the sample - might be -1 when the bar is painted for the legend
  • valueIndex β€” Index of a value in a set
  • rect β€” Directed target rectangle for the bar
  • See also: drawSeries()
  • Definition at line 652 of file qwt_plot_multi_barchart.cpp.

πŸ’– void QwtPlotMultiBarChart::drawGroupedBars (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int index, double sampleWidth, const QwtSetSample & sample) const [protected] πŸ’–

Draw a grouped sample. Group-chat energy but for bars, fr fr.

  • painter β€” Painter
  • xMap β€” x map
  • yMap β€” y map
  • canvasRect β€” Contents rectangle of the canvas
  • index β€” Index of the sample to be painted
  • sampleWidth β€” Bounding width for all bars of the sample
  • sample β€” Sample
  • See also: drawSeries(), sampleWidth()
  • Definition at line 461 of file qwt_plot_multi_barchart.cpp.

🌈 void QwtPlotMultiBarChart::drawSample (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, const QwtInterval & boundingInterval, int index, const QwtSetSample & sample) const [protected], [virtual] 🌈

Draw a sample. This is the main-character sample-painting function, periodt.

  • painter β€” Painter
  • xMap β€” x map
  • yMap β€” y map
  • canvasRect β€” Contents rectangle of the canvas
  • boundingInterval β€” Bounding interval of sample values
  • index β€” Index of the sample to be painted
  • sample β€” Sample value
  • See also: drawSeries()
  • Definition at line 415 of file qwt_plot_multi_barchart.cpp.

πŸ‘‘ void QwtPlotMultiBarChart::drawSeries (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from, int to) const [override], [virtual] πŸ‘‘

Draw an interval of the bar chart. The way this handles from and to is lowkey important, bestie.

  • painter β€” Painter
  • xMap β€” Maps x-values into pixel coordinates.
  • yMap β€” Maps y-values into pixel coordinates.
  • canvasRect β€” Contents rectangle of the canvas
  • from β€” Index of the first point to be painted
  • to β€” Index of the last point to be painted. If to < 0 the curve will be painted to its last point.
  • See also: drawSymbols()
  • Implements: QwtPlotSeriesItem
  • Definition at line 374 of file qwt_plot_multi_barchart.cpp.

πŸ’œ void QwtPlotMultiBarChart::drawStackedBars (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int index, double sampleWidth, const QwtSetSample & sample) const [protected] πŸ’œ

Draw a stacked sample. Stacked bars are giving structured chaos, and we love that for them.

  • painter β€” Painter
  • xMap β€” x map
  • yMap β€” y map
  • canvasRect β€” Contents rectangle of the canvas
  • index β€” Index of the sample to be painted
  • sampleWidth β€” Width of the bars
  • sample β€” Sample
  • See also: drawSeries(), sampleWidth()
  • Definition at line 541 of file qwt_plot_multi_barchart.cpp.

πŸ“ QList< QwtLegendData > QwtPlotMultiBarChart::legendData () const [override], [virtual] πŸ“

This returns the info that gets displayed on the legend. The chart is represented by a list of entries β€” one for each bar title. Each element contains a bar title and an icon showing its corresponding bar. Cute, useful, iconic.

  • Returns: Information to be displayed on the legend
  • See also: barTitles(), legendIcon(), legendIconSize()
  • Reimplemented from: QwtPlotItem
  • Definition at line 687 of file qwt_plot_multi_barchart.cpp.

🧚 QwtGraphic QwtPlotMultiBarChart::legendIcon (int index, const QSizeF & size) const [override], [virtual] 🧚

This is the icon that represents a bar on the legend. Tiny legend bar icon moment.

  • index β€” Index of the bar
  • size β€” Icon size
  • Returns: Icon for representing a bar on the legend
  • Returns: An icon showing a bar
  • See also: drawBar(), legendData()
  • Reimplemented from: QwtPlotItem
  • Definition at line 720 of file qwt_plot_multi_barchart.cpp.

🫢 void QwtPlotMultiBarChart::resetSymbolMap () 🫢

Remove all symbols from the symbol map. Clean slate, bestie. No leftover symbol clutter.

  • Definition at line 237 of file qwt_plot_multi_barchart.cpp.

πŸ’€ int QwtPlotMultiBarChart::rtti () const [override], [virtual] πŸ’€

Returns the runtime type info, and it’s QwtPlotItem::Rtti_PlotBarChart. Slay.

  • Returns: QwtPlotItem::Rtti_PlotBarChart
  • Reimplemented from: QwtPlotItem
  • Definition at line 82 of file qwt_plot_multi_barchart.cpp.

πŸŽ€ void QwtPlotMultiBarChart::setBarTitles (const QList< QwtText > & titles) πŸŽ€

Set the titles for the bars. The titles are used for the legend. So yes, this is where the legend gets its whole naming situation.

  • titles β€” Bar titles
  • See also: barTitles(), legendData()
  • Definition at line 138 of file qwt_plot_multi_barchart.cpp.

✨ void QwtPlotMultiBarChart::setSamples (const QVector< QVector< double > > & samples) ✨

Initialize data with an array of samples. Vector of points, vector of points β€” you know the vibe.

  • samples β€” Vector of points
  • Definition at line 101 of file qwt_plot_multi_barchart.cpp.

🌸 void QwtPlotMultiBarChart::setSamples (const QVector< QwtSetSample > & samples) 🌸

Initialize data with an array of samples. Same energy, different container, bestie.

  • samples β€” Vector of points
  • Definition at line 91 of file qwt_plot_multi_barchart.cpp.

πŸ¦‹ void QwtPlotMultiBarChart::setSamples (QwtSeriesData< QwtSetSample > * data) πŸ¦‹

Assign 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? Very findable. Very developer-friendly. Very that.

  • data β€” Data
Warning, bestie: The item takes ownership of the data object, deleting it when its not used anymore.
  • Definition at line 123 of file qwt_plot_multi_barchart.cpp.

πŸ’… void QwtPlotMultiBarChart::setStyle (ChartStyle style) πŸ’…

Set the style of the chart. Chart style is the whole aesthetic, okay?

  • style β€” Chart style
  • See also: style()
  • Definition at line 278 of file qwt_plot_multi_barchart.cpp.

πŸ”₯ void QwtPlotMultiBarChart::setSymbol (int valueIndex, QwtColumnSymbol * symbol) πŸ”₯

Add a symbol to the symbol map. Assign a default symbol for drawing the bar representing all values with the same index in a set. Symbol-map business, fr fr.

  • valueIndex β€” Index of a value in a set
  • symbol β€” Symbol used for drawing a bar
  • See also: symbol(), resetSymbolMap(), specialSymbol()
  • Definition at line 164 of file qwt_plot_multi_barchart.cpp.

🧚 QwtColumnSymbol * QwtPlotMultiBarChart::specialSymbol (int sampleIndex, int valueIndex) const [protected], [virtual] 🧚

Create a symbol for special values. Usually the symbols for displaying a bar are set by setSymbols() and common for all sets. By overloading specialSymbol() it is possible to create a temporary symbol() for displaying a special value.

The symbol has to be created by new each time specialSymbol() is called. As soon as the symbol is painted this symbol gets deleted. So like… temporary icon era.

When no symbol ( NULL ) is returned, the value will be displayed with the standard symbol that is used for all symbols with the same valueIndex.

  • sampleIndex β€” Index of the sample
  • valueIndex β€” Index of the value in the set
  • Returns: NULL, meaning that the value is not special
  • Definition at line 263 of file qwt_plot_multi_barchart.cpp.

πŸŽ€ QwtPlotMultiBarChart::ChartStyle QwtPlotMultiBarChart::style () const πŸŽ€

Returns the style of the chart. The aesthetic check, basically.

  • Returns: Style of the chart
  • See also: setStyle()
  • Definition at line 293 of file qwt_plot_multi_barchart.cpp.

🌈 QwtColumnSymbol * QwtPlotMultiBarChart::symbol (int valueIndex) [protected] 🌈

Find a symbol in the symbol map.

  • valueIndex β€” Index of a value in a set
  • Returns: The symbol, that had been set by setSymbol() or NULL.
  • See also: setSymbol(), specialSymbol(), drawBar()
  • Definition at line 226 of file qwt_plot_multi_barchart.cpp.

πŸ’œ const QwtColumnSymbol * QwtPlotMultiBarChart::symbol (int valueIndex) const πŸ’œ

Find a symbol in the symbol map β€” but make it const, bestie.

  • valueIndex β€” Index of a value in a set
  • Returns: The symbol, that had been set by setSymbol() or NULL.
  • See also: setSymbol(), specialSymbol(), drawBar()
  • Definition at line 210 of file qwt_plot_multi_barchart.cpp.

✨ AUTHOR ✨

Generated automatically by Doxygen for Qwt User's Guide from the source code.


πŸ’– Source: Qwt User's Guide; page/version: QwtPlotMultiBarChart(3); date: not listed on the footer, bestie β€” but this sign-off is still iconic. Mwah! πŸ’…

πŸ“¦ where this page comes from