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 #include "qwt_series_data.h"
16 
17 class QwtColumnRect;
18 class QwtColumnSymbol;
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;
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;
125 };
126 
127 #endif
virtual QList< QwtLegendData > legendData() const
Return all information, that is needed to represent the item on the legend.
virtual int rtti() const
A class representing an interval.
Definition: qwt_interval.h:26
#define QWT_EXPORT
Definition: qwt_global.h:38
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:76
Class storing a QwtSeriesData object.
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
A class representing a text.
Definition: qwt_text.h:51
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
virtual QRectF boundingRect() const
A scale map.
Definition: qwt_scale_map.h:30
Directed rectangle representing bounding rectangle and orientation of a column.
The bars of a set are displayed side by side.


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17