Qwt User's Guide 6.1.0

- Main Page
- Related Pages
- Classes

All Classes Functions Variables Typedefs Enumerations Enumerator Pages
qwt_plot_multi_barchart.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 #include "qwt_series_data.h"
16
17 class QwtColumnRect;
18 class QwtColumnSymbol;
19
41 class QWT_EXPORT QwtPlotMultiBarChart:
42 public QwtPlotAbstractBarChart, public QwtSeriesStore<QwtSetSample>
43 {
44 public:
51 enum ChartStyle
52 {
54 Grouped,
55
61 Stacked
62 };
63
64 explicit QwtPlotMultiBarChart( const QString &title = QString::null );
65 explicit QwtPlotMultiBarChart( const QwtText &title );
66
67 virtual ~QwtPlotMultiBarChart();
68
69 virtual int rtti() const;
70
71 void setBarTitles( const QList<QwtText> & );
72 QList<QwtText> barTitles() const;
73
74 void setSamples( const QVector<QwtSetSample> & );
75 void setSamples( const QVector< QVector<double> > & );
76 void setSamples( QwtSeriesData<QwtSetSample> * );
77
78 void setStyle( ChartStyle style );
79 ChartStyle style() const;
80
81 void setSymbol( int barIndex, QwtColumnSymbol *symbol );
82 const QwtColumnSymbol *symbol( int barIndex ) const;
83
84 void resetSymbolMap();
85
86 virtual void drawSeries( QPainter *painter,
87 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
88 const QRectF &canvasRect, int from, int to ) const;
89
90 virtual QRectF boundingRect() const;
91
92 virtual QList<QwtLegendData> legendData() const;
93
94 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
95
96 protected:
97 QwtColumnSymbol *symbol( int barIndex );
98
99 virtual QwtColumnSymbol *specialSymbol(
100 int sampleIndex, int valueIndex ) const;
101
102 virtual void drawSample( QPainter *painter,
103 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
104 const QRectF &canvasRect, const QwtInterval &boundingInterval,
105 int index, const QwtSetSample& sample ) const;
106
107 virtual void drawBar( QPainter *, int sampleIndex,
108 int barIndex, const QwtColumnRect & ) const;
109
110 void drawStackedBars( QPainter *painter,
111 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
112 const QRectF &canvasRect, int index,
113 double sampleWidth, const QwtSetSample& sample ) const;
114
115 void drawGroupedBars( QPainter *painter,
116 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
117 const QRectF &canvasRect, int index,
118 double sampleWidth, const QwtSetSample& sample ) const;
119
120 private:
121 void init();
122
123 class PrivateData;
124 PrivateData *d_data;
125 };
126
127 #endif