qwt_plot_multi_barchart.h
Go to the documentation of this file.
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_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 
42  public QwtPlotAbstractBarChart, public QwtSeriesStore<QwtSetSample>
43 {
44 public:
52  {
55 
61  Stacked
62  };
63 
64  explicit QwtPlotMultiBarChart( const QString &title = QString() );
65  explicit QwtPlotMultiBarChart( const QwtText &title );
66 
67  virtual ~QwtPlotMultiBarChart();
68 
69  virtual int rtti() const QWT_OVERRIDE;
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 valueIndex, QwtColumnSymbol * );
82  const QwtColumnSymbol *symbol( int valueIndex ) const;
83 
84  void resetSymbolMap();
85 
86  virtual void drawSeries( QPainter *,
87  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
88  const QRectF &canvasRect, int from, int to ) const QWT_OVERRIDE;
89 
90  virtual QRectF boundingRect() const QWT_OVERRIDE;
91 
92  virtual QList<QwtLegendData> legendData() const QWT_OVERRIDE;
93 
94  virtual QwtGraphic legendIcon(
95  int index, const QSizeF & ) const QWT_OVERRIDE;
96 
97 protected:
98  QwtColumnSymbol *symbol( int valueIndex );
99 
100  virtual QwtColumnSymbol *specialSymbol(
101  int sampleIndex, int valueIndex ) const;
102 
103  virtual void drawSample( QPainter *,
104  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
105  const QRectF &canvasRect, const QwtInterval &boundingInterval,
106  int index, const QwtSetSample& ) const;
107 
108  virtual void drawBar( QPainter *, int sampleIndex,
109  int valueIndex, const QwtColumnRect & ) const;
110 
111  void drawStackedBars( QPainter *,
112  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
113  const QRectF &canvasRect, int index,
114  double sampleWidth, const QwtSetSample& ) const;
115 
116  void drawGroupedBars( QPainter *,
117  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
118  const QRectF &canvasRect, int index,
119  double sampleWidth, const QwtSetSample& ) const;
120 
121 private:
122  void init();
123 
124  class PrivateData;
125  PrivateData *d_data;
126 };
127 
128 #endif
virtual int rtti() const
A class representing an interval.
Definition: qwt_interval.h:22
#define QWT_EXPORT
Definition: qwt_global.h:38
Abstract interface for iterating over samples.
A drawing primitive for columns.
QwtPlotMultiBarChart displays a series of a samples that consist each of a set of values...
Abstract base class for bar chart items.
A sample of the types (x1...xn, y) or (x, y1..yn)
Definition: qwt_samples.h:77
Class storing a QwtSeriesData object.
A class representing a text.
Definition: qwt_text.h:51
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
A scale map.
Definition: qwt_scale_map.h:26
Directed rectangle representing bounding rectangle and orientation of a column.
The bars of a set are displayed side by side.
Attributes of an entry on a legend.
#define QWT_OVERRIDE
Definition: qwt_global.h:53


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10