QwtPlotAbstractBarChart(3)

πŸ’… QwtPlotAbstractBarChart(3) β€” Library Functions Manual πŸŽ€

πŸŽ€ NAME πŸŽ€

QwtPlotAbstractBarChart β€” abstract base class for bar chart items. Like, it’s the blueprint bestie, not the finished look πŸ’–

✨ SYNOPSIS ✨

#include <qwt_plot_abstract_barchart.h>

Inherits QwtPlotSeriesItem.

Inherited by QwtPlotBarChart, and QwtPlotMultiBarChart.

🌸 Public Types 🌸

  • 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 πŸ¦‹

  • QwtPlotAbstractBarChart (const QwtText &title) β€” constructor, babes ✨
  • virtual ~QwtPlotAbstractBarChart () β€” Destructor.
  • void setLayoutPolicy (LayoutPolicy) β€” sets the layout policy.
  • LayoutPolicy layoutPolicy () const β€” reads the layout policy.
  • void setLayoutHint (double) β€” sets the layout hint.
  • double layoutHint () const β€” reads the layout hint.
  • void setSpacing (int) β€” Set the spacing.
  • int spacing () const β€” reads the spacing.
  • void setMargin (int) β€” Set the margin.
  • int margin () const β€” reads the margin.
  • void setBaseline (double) β€” Set the baseline.
  • double baseline () const β€” reads the baseline.
  • 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())
  • 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 β€” Draw the complete series.
  • virtual void drawSeries (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
  • virtual QRectF boundingRect () const override
  • 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 the QwtPlotItem.
  • void attach (QwtPlot *plot) β€” Attach the item to a plot.
  • void detach () β€” This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
  • QwtPlot * plot () const β€” Return attached plot.
  • void setTitle (const QString &title)
  • void setTitle (const QwtText &title)
  • const QwtText & title () const
  • virtual int rtti () 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) β€” Set the z value.
  • void show () β€” Show the item.
  • void hide () β€” Hide the item.
  • virtual void setVisible (bool)
  • bool isVisible () const
  • void 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.
  • virtual QList< QwtLegendData > legendData () const β€” Return all information, that is needed to represent the item on the legend.
  • virtual QwtGraphic legendIcon (int index, const QSizeF &) const

🫢 Public Member Functions inherited from QwtAbstractSeriesStore 🫢

  • virtual ~QwtAbstractSeriesStore () β€” Destructor.

🌟 Protected Member Functions 🌟

  • 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.

🧚 Protected Member Functions inherited from QwtAbstractSeriesStore 🧚

  • virtual void setRectOfInterest (const QRectF &)=0
  • virtual QRectF dataRect () const =0
  • virtual size_t dataSize () const =0

πŸ”₯ Detailed Description πŸ”₯

QwtPlotAbstractBarChart is the abstract base class for bar chart items.

Okay so unlike almost every other plot item, bar charts can’t be displayed inside of their bounding rectangle, and they need a special API for how to calculate the width of the bars and how they affect the layout of the attached plot. It’s giving β€œspecial rules, but make it charting” 😭

Definition at line 24 of file qwt_plot_abstract_barchart.h.

πŸŽ€ Member Enumeration Documentation πŸŽ€

enum QwtPlotAbstractBarChart::LayoutPolicy

Mode how to calculate the bar width. The related crew is 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.

Definition at line 32 of file qwt_plot_abstract_barchart.h.

πŸ’– Constructor & Destructor Documentation πŸ’–

QwtPlotAbstractBarChart::QwtPlotAbstractBarChart (const QwtText & title)

[explicit]

Constructor, bestie. It’s literally making the chart happen ✨

  • title β€” Title of the chart.

Definition at line 48 of file qwt_plot_abstract_barchart.cpp.

QwtPlotAbstractBarChart::~QwtPlotAbstractBarChart () [virtual]

Destructor.

Definition at line 60 of file qwt_plot_abstract_barchart.cpp.

πŸ’– Member Function Documentation πŸ’–

🫢 double QwtPlotAbstractBarChart::baseline () const 🫢

Returns: the value for the origin of the bar chart. That's the baseline, bestie, the home base for the bars. πŸ’…

See also: setBaseline(), QwtPlotSeriesItem::orientation().

Definition at line 208 of file qwt_plot_abstract_barchart.cpp.


πŸ¦‹ void QwtPlotAbstractBarChart::getCanvasMarginHint (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, double & left, double & top, double & right, double & bottom) const πŸ¦‹

This one is marked [override], [virtual]. It calculates a hint for the canvas margin.

Bar charts need to reserve some space for displaying the bars for the first and the last sample. The hint is calculated from the layoutHint() depending on the layoutPolicy().

The margins are in target device coordinates ( pixels on screen ). Very important, no cap.

Parameters:

  • xMap β€” Maps x-values into pixel coordinates.
  • yMap β€” Maps y-values into pixel coordinates.
  • canvasRect β€” Contents rectangle of the canvas in painter coordinates.
  • left β€” Returns the left margin.
  • top β€” Returns the top margin.
  • right β€” Returns the right margin.
  • bottom β€” Returns the bottom margin.

See also: layoutPolicy(), layoutHint(), QwtPlotItem::Margins, QwtPlot::getCanvasMarginsHint(), QwtPlot::updateCanvasMargins().

Reimplemented from QwtPlotItem.

Definition at line 287 of file qwt_plot_abstract_barchart.cpp.


🌸 double QwtPlotAbstractBarChart::layoutHint () const 🌸

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated. That's the whole collab, and it's giving layout math. ✨

Returns: Layout policy of the chart item.

See also: LayoutPolicy, setLayoutHint(), layoutPolicy().

Definition at line 119 of file qwt_plot_abstract_barchart.cpp.


πŸ‘‘ QwtPlotAbstractBarChart::LayoutPolicy QwtPlotAbstractBarChart::layoutPolicy () const πŸ‘‘

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated. Yes, same iconic sentence, because this is the policy half of that duo. πŸ’–

Returns: Layout policy of the chart item.

See also: setLayoutPolicy(), layoutHint().

Definition at line 89 of file qwt_plot_abstract_barchart.cpp.


πŸŽ€ int QwtPlotAbstractBarChart::margin () const πŸŽ€

Returns: Margin between the outmost bars and the contentsRect() of the canvas.

See also: setMargin(), spacing().

Definition at line 176 of file qwt_plot_abstract_barchart.cpp.


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

This one is [protected]. It calculates the width for a sample in paint device coordinates. Very demure, very precise.

Parameters:

  • map β€” Scale map for the corresponding scale.
  • canvasSize β€” Size of the canvas in paint device coordinates.
  • boundingSize β€” Bounding size of the chart in plot coordinates ( used in AutoAdjustSamples mode ).
  • value β€” Value of the sample.

Returns: Sample width.

See also: layoutPolicy(), layoutHint().

Definition at line 225 of file qwt_plot_abstract_barchart.cpp.


πŸ“ void QwtPlotAbstractBarChart::setBaseline (double value) πŸ“

Set the baseline. The baseline is the origin for the chart. Each bar is painted from the baseline in the direction of the sample value. In case of a horizontal orientation() the baseline is interpreted as x - otherwise as y - value.

The default value for the baseline is 0.

Param: value β€” Value for the baseline.

See also: baseline(), QwtPlotSeriesItem::orientation().

Definition at line 195 of file qwt_plot_abstract_barchart.cpp.


🌈 void QwtPlotAbstractBarChart::setLayoutHint (double hint) 🌈

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated.

Param: hint β€” Layout hint.

See also: LayoutPolicy, layoutPolicy(), layoutHint().

Definition at line 102 of file qwt_plot_abstract_barchart.cpp.


πŸ’œ void QwtPlotAbstractBarChart::setLayoutPolicy (LayoutPolicy policy) πŸ’œ

The combination of layoutPolicy() and layoutHint() define how the width of the bars is calculated.

Param: policy β€” Layout policy.

See also: layoutPolicy(), layoutHint().

Definition at line 73 of file qwt_plot_abstract_barchart.cpp.


🫢 void QwtPlotAbstractBarChart::setMargin (int margin) 🫢

Set the margin. The margin is the distance between the outmost bars and the contentsRect() of the canvas. The default setting is 5 pixels.

Param: margin β€” Margin.

See also: spacing(), margin().

Definition at line 160 of file qwt_plot_abstract_barchart.cpp.


πŸ’« void QwtPlotAbstractBarChart::setSpacing (int spacing) πŸ’«

Set the spacing. The spacing is the distance between 2 samples ( bars for QwtPlotBarChart or a group of bars for QwtPlotMultiBarChart ) in paint device coordinates.

See also: spacing().

Definition at line 132 of file qwt_plot_abstract_barchart.cpp.


🌟 int QwtPlotAbstractBarChart::spacing () const 🌟

Returns: Spacing between 2 samples ( bars or groups of bars ).

See also: setSpacing(), margin().

Definition at line 146 of file qwt_plot_abstract_barchart.cpp.


πŸ‘‘ Author πŸ‘‘

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


🌈 Tiny footer sign-off: this whole manual-page moment is brought to you by the Qwt User's Guide source/version and date stamp sitting in the footer, auto-generated by Doxygen from the source code β€” and yes, we are honoring it without copy-pasting the line, because we have manners. QwtPlotAbstractBarChart(3) out. πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from