qwt_plot_multi_barchart.h
Go to the documentation of this file.
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"
15 
16 class QwtColumnRect;
17 class QwtColumnSymbol;
18 template< typename T > class QwtSeriesData;
19 
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
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:36
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
QVector
Definition: qwt_clipper.h:23
qwt_global.h
QwtColumnSymbol
A drawing primitive for columns.
Definition: qwt_column_symbol.h:74
QList
Definition: qwt_abstract_legend.h:17
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:22
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtPlotMultiBarChart::PrivateData
Definition: qwt_plot_multi_barchart.cpp:35
QwtSetSample
A sample of the types (x1...xn, y) or (x, y1..yn)
Definition: qwt_samples.h:73
QwtSeriesData
Abstract interface for iterating over samples.
Definition: qwt_plot_barchart.h:18
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
QwtColumnRect
Directed rectangle representing bounding rectangle and orientation of a column.
Definition: qwt_column_symbol.h:26
QwtPlotMultiBarChart::Grouped
@ Grouped
The bars of a set are displayed side by side.
Definition: qwt_plot_multi_barchart.h:55
QwtPlotAbstractBarChart
Abstract base class for bar chart items.
Definition: qwt_plot_abstract_barchart.h:24
QWT_OVERRIDE
#define QWT_OVERRIDE
Definition: qwt_global.h:53
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38
qwt_plot_abstract_barchart.h
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition: qwt_series_store.h:66
QwtPlotMultiBarChart::ChartStyle
ChartStyle
Chart styles.
Definition: qwt_plot_multi_barchart.h:52
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:136
QwtPlotMultiBarChart
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values.
Definition: qwt_plot_multi_barchart.h:41


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46