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 
16 class QwtColumnSymbol;
17 class QwtColumnRect;
18 class QColor;
19 class QPolygonF;
20 template <typename T> class QVector;
21 
39  public QwtPlotSeriesItem, public QwtSeriesStore<QwtIntervalSample>
40 {
41 public:
49  {
57 
64 
69 
75  UserStyle = 100
76  };
77 
78  explicit QwtPlotHistogram( const QString &title = QString() );
79  explicit QwtPlotHistogram( const QwtText &title );
80  virtual ~QwtPlotHistogram();
81 
82  virtual int rtti() const QWT_OVERRIDE;
83 
84  void setPen( const QColor &,
85  qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
86 
87  void setPen( const QPen & );
88  const QPen &pen() const;
89 
90  void setBrush( const QBrush & );
91  const QBrush &brush() const;
92 
93  void setSamples( const QVector<QwtIntervalSample> & );
94  void setSamples( QwtSeriesData<QwtIntervalSample> * );
95 
96  void setBaseline( double );
97  double baseline() const;
98 
99  void setStyle( HistogramStyle style );
100  HistogramStyle style() const;
101 
102  void setSymbol( const QwtColumnSymbol * );
103  const QwtColumnSymbol *symbol() const;
104 
105  virtual void drawSeries( QPainter *,
106  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
107  const QRectF &canvasRect, int from, int to ) const QWT_OVERRIDE;
108 
109  virtual QRectF boundingRect() const QWT_OVERRIDE;
110 
111  virtual QwtGraphic legendIcon(
112  int index, const QSizeF & ) const QWT_OVERRIDE;
113 
114 protected:
115  virtual QwtColumnRect columnRect( const QwtIntervalSample &,
116  const QwtScaleMap &, const QwtScaleMap & ) const;
117 
118  virtual void drawColumn( QPainter *, const QwtColumnRect &,
119  const QwtIntervalSample & ) const;
120 
121  void drawColumns( QPainter *,
122  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
123  int from, int to ) const;
124 
125  void drawOutline( QPainter *,
126  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
127  int from, int to ) const;
128 
129  void drawLines( QPainter *,
130  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
131  int from, int to ) const;
132 
133 private:
134  void init();
135  void flushPolygon( QPainter *, double baseLine, QPolygonF & ) const;
136 
137  class PrivateData;
138  PrivateData *d_data;
139 };
140 
141 #endif
virtual int rtti() const
#define QWT_EXPORT
Definition: qwt_global.h:38
Abstract interface for iterating over samples.
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:20
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
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.
#define QWT_OVERRIDE
Definition: qwt_global.h:53


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