qwt_plot_histogram.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_HISTOGRAM_H
11 #define QWT_PLOT_HISTOGRAM_H
12 
13 #include "qwt_global.h"
14 #include "qwt_plot_seriesitem.h"
15 #include "qwt_column_symbol.h"
16 #include <qcolor.h>
17 #include <qvector.h>
18 
19 class QwtIntervalData;
20 class QString;
21 class QPolygonF;
22 
40  public QwtPlotSeriesItem, public QwtSeriesStore<QwtIntervalSample>
41 {
42 public:
50  {
58 
65 
70 
76  UserStyle = 100
77  };
78 
79  explicit QwtPlotHistogram( const QString &title = QString() );
80  explicit QwtPlotHistogram( const QwtText &title );
81  virtual ~QwtPlotHistogram();
82 
83  virtual int rtti() const;
84 
85  void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
86  void setPen( const QPen & );
87  const QPen &pen() const;
88 
89  void setBrush( const QBrush & );
90  const QBrush &brush() const;
91 
92  void setSamples( const QVector<QwtIntervalSample> & );
93  void setSamples( QwtSeriesData<QwtIntervalSample> * );
94 
95  void setBaseline( double reference );
96  double baseline() const;
97 
98  void setStyle( HistogramStyle style );
99  HistogramStyle style() const;
100 
101  void setSymbol( const QwtColumnSymbol * );
102  const QwtColumnSymbol *symbol() const;
103 
104  virtual void drawSeries( QPainter *p,
105  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
106  const QRectF &canvasRect, int from, int to ) const;
107 
108  virtual QRectF boundingRect() const;
109 
110  virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
111 
112 protected:
113  virtual QwtColumnRect columnRect( const QwtIntervalSample &,
114  const QwtScaleMap &, const QwtScaleMap & ) const;
115 
116  virtual void drawColumn( QPainter *, const QwtColumnRect &,
117  const QwtIntervalSample & ) const;
118 
119  void drawColumns( QPainter *,
120  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
121  int from, int to ) const;
122 
123  void drawOutline( QPainter *,
124  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
125  int from, int to ) const;
126 
127  void drawLines( QPainter *,
128  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
129  int from, int to ) const;
130 
131 private:
132  void init();
133  void flushPolygon( QPainter *, double baseLine, QPolygonF & ) const;
134 
135  class PrivateData;
137 };
138 
139 #endif
PrivateData * d_data
virtual int rtti() const
#define QWT_EXPORT
Definition: qwt_global.h:38
A drawing primitive for columns.
Class storing a QwtSeriesData object.
A sample of the types (x1-x2, y) or (x, y1-y2)
Definition: qwt_samples.h:19
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
QwtPlotHistogram represents a series of samples, where an interval is associated with a value ( )...
Directed rectangle representing bounding rectangle and orientation of a column.
Base class for plot items representing a series of samples.


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