Qwt User's Guide 6.2.0

qwt_plot_barchart.h
1 /******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_PLOT_BAR_CHART_H
11 #define QWT_PLOT_BAR_CHART_H
12
13 #include "qwt_global.h"
14 #include "qwt_plot_abstract_barchart.h"
15
16 class QwtColumnRect;
17 class QwtColumnSymbol;
18 template< typename T > class QwtSeriesData;
19
41 class QWT_EXPORT QwtPlotBarChart
42 : public QwtPlotAbstractBarChart
43 , public QwtSeriesStore< QPointF >
44 {
45 public:
52 enum LegendMode
53 {
60 LegendChartTitle,
61
68 LegendBarTitles
69 };
70
71 explicit QwtPlotBarChart( const QString& title = QString() );
72 explicit QwtPlotBarChart( const QwtText& title );
73
74 virtual ~QwtPlotBarChart();
75
76 virtual int rtti() const QWT_OVERRIDE;
77
78 void setSamples( const QVector< QPointF >& );
79 void setSamples( const QVector< double >& );
80 void setSamples( QwtSeriesData< QPointF >* );
81
82 void setSymbol( QwtColumnSymbol* );
83 const QwtColumnSymbol* symbol() const;
84
85 void setLegendMode( LegendMode );
86 LegendMode legendMode() const;
87
88 virtual void drawSeries( QPainter*,
89 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
90 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
91
92 virtual QRectF boundingRect() const QWT_OVERRIDE;
93
94 virtual QwtColumnSymbol* specialSymbol(
95 int sampleIndex, const QPointF& ) const;
96
97 virtual QwtText barTitle( int sampleIndex ) const;
98
99 protected:
100 virtual void drawSample( QPainter* painter,
101 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
102 const QRectF& canvasRect, const QwtInterval& boundingInterval,
103 int index, const QPointF& sample ) const;
104
105 virtual void drawBar( QPainter*,
106 int sampleIndex, const QPointF& sample,
107 const QwtColumnRect& ) const;
108
109 QwtColumnRect columnRect(
110 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
111 const QRectF& canvasRect, const QwtInterval& boundingInterval,
112 const QPointF& sample ) const;
113
114 QList< QwtLegendData > legendData() const QWT_OVERRIDE;
115 QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE;
116
117 private:
118 void init();
119
120 class PrivateData;
121 PrivateData* m_data;
122 };
123
124 #endif
QList
Definition: qwt_abstract_legend.h:17
QVector
Definition: qwt_clipper.h:23
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition: qwt_column_symbol.h:27
QwtColumnSymbol
A drawing primitive for columns.
Definition: qwt_column_symbol.h:75
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:76
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:23
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:37
QwtPlotAbstractBarChart
Abstract base class for bar chart items.
Definition: qwt_plot_abstract_barchart.h:25
QwtPlotBarChart
QwtPlotBarChart displays a series of a values as bars.
Definition: qwt_plot_barchart.h:44
QwtPlotBarChart::LegendMode
LegendMode
Legend modes.
Definition: qwt_plot_barchart.h:53
QwtPlotBarChart::LegendChartTitle
@ LegendChartTitle
Definition: qwt_plot_barchart.h:60
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:136
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:27
QwtSeriesData
Abstract interface for iterating over samples.
Definition: qwt_series_data.h:50
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition: qwt_series_store.h:67
QwtText
A class representing a text.
Definition: qwt_text.h:52