Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_barchart.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_barchart.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_barchart.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 13 13 #include "qwt_global.h" 14 14 #include "qwt_plot_abstract_barchart.h" 15 #include "qwt_series_data.h"16 15 17 16 class QwtColumnRect; 18 17 class QwtColumnSymbol; 18 template< typename T > class QwtSeriesData; 19 19 20 20 /*! 21 \brief QwtPlotBarChart displays a series of a values as bars. 21 \brief QwtPlotBarChart displays a series of a values as bars. 22 22 23 Each bar might be customized individually by implementing 24 a specialSymbol(). Otherwise it is rendered using a default symbol. 23 Each bar might be customized individually by implementing 24 a specialSymbol(). Otherwise it is rendered using a default symbol. 25 25 26 Depending on its orientation() the bars are displayed horizontally 27 or vertically. The bars cover the interval between the baseline() 28 and the value. 26 Depending on its orientation() the bars are displayed horizontally 27 or vertically. The bars cover the interval between the baseline() 28 and the value. 29 29 30 By activating the LegendBarTitles mode each sample will have 31 its own entry on the legend. 30 By activating the LegendBarTitles mode each sample will have 31 its own entry on the legend. 32 32 33 The most common use case of a bar chart is to display a 34 list of y coordinates, where the x coordinate is simply the index 35 in the list. But for other situations ( f.e. when values are related 36 to dates ) it is also possible to set x coordinates explicitly. 33 The most common use case of a bar chart is to display a 34 list of y coordinates, where the x coordinate is simply the index 35 in the list. But for other situations ( f.e. when values are related 36 to dates ) it is also possible to set x coordinates explicitly. 37 37 38 \sa QwtPlotMultiBarChart, QwtPlotHistogram, QwtPlotCurve::Sticks, 38 \sa QwtPlotMultiBarChart, QwtPlotHistogram, QwtPlotCurve::Sticks, 39 39 QwtPlotSeriesItem::orientation(), QwtPlotAbstractBarChart::baseline() 40 40 */ 41 class QWT_EXPORT QwtPlotBarChart: 42 public QwtPlotAbstractBarChart, public QwtSeriesStore<QPointF> 41 class QWT_EXPORT QwtPlotBarChart 42 : public QwtPlotAbstractBarChart 43 , public QwtSeriesStore< QPointF > 43 44 { 44 public: 45 public: 45 46 /*! 46 \brief Legend modes. 47 \brief Legend modes. 47 48 48 The default setting is QwtPlotBarChart::LegendChartTitle. 49 \sa setLegendMode(), legendMode() 50 */ 49 The default setting is QwtPlotBarChart::LegendChartTitle. 50 \sa setLegendMode(), legendMode() 51 */ 51 52 enum LegendMode 52 53 { 53 54 /*! 54 One entry on the legend showing the default symbol 55 and the title() of the chart 55 One entry on the legend showing the default symbol 56 and the title() of the chart 56 57 57 \sa QwtPlotItem::title() 58 \sa QwtPlotItem::title() 58 59 */ 59 60 LegendChartTitle, 60 61 61 62 /*! 62 One entry for each value showing the individual symbol 63 of the corresponding bar and the bar title. 63 One entry for each value showing the individual symbol 64 of the corresponding bar and the bar title. 64 65 65 \sa specialSymbol(), barTitle() 66 \sa specialSymbol(), barTitle() 66 67 */ 67 68 LegendBarTitles 68 69 }; 69 70 70 explicit QwtPlotBarChart( const QString &title = QString() );71 explicit QwtPlotBarChart( const QwtText &title );71 explicit QwtPlotBarChart( const QString& title = QString() ); 72 explicit QwtPlotBarChart( const QwtText& title ); 72 73 73 74 virtual ~QwtPlotBarChart(); 74 75 75 virtual int rtti() const; 76 virtual int rtti() const QWT_OVERRIDE; 76 77 77 void setSamples( const QVector<QPointF >& );78 void setSamples( const QVector< double>& );79 void setSamples( QwtSeriesData<QPointF >* );78 void setSamples( const QVector< QPointF >& ); 79 void setSamples( const QVector< double >& ); 80 void setSamples( QwtSeriesData< QPointF >* ); 80 81 81 void setSymbol( QwtColumnSymbol * );82 const QwtColumnSymbol *symbol() const;82 void setSymbol( QwtColumnSymbol* ); 83 const QwtColumnSymbol* symbol() const; 83 84 84 85 void setLegendMode( LegendMode ); 85 86 LegendMode legendMode() const; 86 87 87 virtual void drawSeries( QPainter *painter,88 const QwtScaleMap &xMap, const QwtScaleMap&yMap,89 const QRectF &canvasRect, int from, int to ) const;88 virtual void drawSeries( QPainter*, 89 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 90 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE; 90 91 91 virtual QRectF boundingRect() const; 92 virtual QRectF boundingRect() const QWT_OVERRIDE; 92 93 93 virtual QwtColumnSymbol *specialSymbol(94 virtual QwtColumnSymbol* specialSymbol( 94 95 int sampleIndex, const QPointF& ) const; 95 96 96 97 virtual QwtText barTitle( int sampleIndex ) const; 97 98 98 protected: 99 virtual void drawSample( QPainter *painter,100 const QwtScaleMap &xMap, const QwtScaleMap&yMap,101 const QRectF &canvasRect, const QwtInterval&boundingInterval,99 protected: 100 virtual void drawSample( QPainter* painter, 101 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 102 const QRectF& canvasRect, const QwtInterval& boundingInterval, 102 103 int index, const QPointF& sample ) const; 103 104 104 virtual void drawBar( QPainter *,105 virtual void drawBar( QPainter*, 105 106 int sampleIndex, const QPointF& sample, 106 const QwtColumnRect & ) const;107 const QwtColumnRect& ) const; 107 108 108 QList<QwtLegendData> legendData() const; 109 QwtGraphic legendIcon( int index, const QSizeF & ) const; 109 QwtColumnRect columnRect( 110 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 111 const QRectF& canvasRect, const QwtInterval& boundingInterval, 112 const QPointF& sample ) const; 110 113 111 private: 114 QList< QwtLegendData > legendData() const QWT_OVERRIDE; 115 QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE; 116 117 private: 112 118 void init(); 113 119 114 120 class PrivateData; 115 PrivateData *d_data;121 PrivateData* m_data; 116 122 }; 117 123
Note:
See TracChangeset
for help on using the changeset viewer.
