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 > ItemAttributestypedef QFlags< ItemInterest > ItemIntereststypedef 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 () constvirtual 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 =0virtual QRectF boundingRect () const overridevirtual 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 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 () constvirtual int rtti () 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.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 &)=0virtual QRectF dataRect () const =0virtual 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. ThelayoutHint()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 multiplyinglayoutHint()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 inAutoAdjustSamplesmode ).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
- 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