Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_multi_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_MULTI_BAR_CHART_H
11#define QWT_PLOT_MULTI_BAR_CHART_H
12
13#include "qwt_global.h"
14#include "qwt_plot_abstract_barchart.h"
15
16class QwtColumnRect;
17class QwtColumnSymbol;
18template< typename T > class QwtSeriesData;
19
41class QWT_EXPORT QwtPlotMultiBarChart
43 , public QwtSeriesStore< QwtSetSample >
44{
45 public:
53 {
56
62 Stacked
63 };
64
65 explicit QwtPlotMultiBarChart( const QString& title = QString() );
66 explicit QwtPlotMultiBarChart( const QwtText& title );
67
68 virtual ~QwtPlotMultiBarChart();
69
70 virtual int rtti() const QWT_OVERRIDE;
71
72 void setBarTitles( const QList< QwtText >& );
73 QList< QwtText > barTitles() const;
74
75 void setSamples( const QVector< QwtSetSample >& );
76 void setSamples( const QVector< QVector< double > >& );
77 void setSamples( QwtSeriesData< QwtSetSample >* );
78
79 void setStyle( ChartStyle style );
80 ChartStyle style() const;
81
82 void setSymbol( int valueIndex, QwtColumnSymbol* );
83 const QwtColumnSymbol* symbol( int valueIndex ) const;
84
85 void resetSymbolMap();
86
87 virtual void drawSeries( QPainter*,
88 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
89 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
90
91 virtual QRectF boundingRect() const QWT_OVERRIDE;
92
93 virtual QList< QwtLegendData > legendData() const QWT_OVERRIDE;
94
95 virtual QwtGraphic legendIcon(
96 int index, const QSizeF& ) const QWT_OVERRIDE;
97
98 protected:
99 QwtColumnSymbol* symbol( int valueIndex );
100
101 virtual QwtColumnSymbol* specialSymbol(
102 int sampleIndex, int valueIndex ) const;
103
104 virtual void drawSample( QPainter*,
105 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
106 const QRectF& canvasRect, const QwtInterval& boundingInterval,
107 int index, const QwtSetSample& ) const;
108
109 virtual void drawBar( QPainter*, int sampleIndex,
110 int valueIndex, const QwtColumnRect& ) const;
111
112 void drawStackedBars( QPainter*,
113 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
114 const QRectF& canvasRect, int index,
115 double sampleWidth, const QwtSetSample& ) const;
116
117 void drawGroupedBars( QPainter*,
118 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
119 const QRectF& canvasRect, int index,
120 double sampleWidth, const QwtSetSample& ) const;
121
122 private:
123 void init();
124
125 class PrivateData;
126 PrivateData* m_data;
127};
128
129#endif
Directed rectangle representing bounding rectangle and orientation of a column.
A drawing primitive for columns.
A paint device for scalable graphics.
Definition qwt_graphic.h:76
A class representing an interval.
Attributes of an entry on a legend.
Abstract base class for bar chart items.
virtual int rtti() const
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values.
@ Grouped
The bars of a set are displayed side by side.
A scale map.
Abstract interface for iterating over samples.
Class storing a QwtSeriesData object.
A sample of the types (x1...xn, y) or (x, y1..yn)
Definition qwt_samples.h:74
A class representing a text.
Definition qwt_text.h:52