Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_histogram.h
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_HISTOGRAM_H
11#define QWT_PLOT_HISTOGRAM_H
12
13#include "qwt_global.h"
14#include "qwt_plot_seriesitem.h"
15
16class QwtColumnSymbol;
17class QwtColumnRect;
18class QColor;
19class QPolygonF;
20
21#if QT_VERSION < 0x060000
22template< typename T > class QVector;
23#endif
24
41class QWT_EXPORT QwtPlotHistogram
42 : public QwtPlotSeriesItem
43 , public QwtSeriesStore< QwtIntervalSample >
44{
45 public:
53 {
61
68
73
79 UserStyle = 100
80 };
81
82 explicit QwtPlotHistogram( const QString& title = QString() );
83 explicit QwtPlotHistogram( const QwtText& title );
84 virtual ~QwtPlotHistogram();
85
86 virtual int rtti() const QWT_OVERRIDE;
87
88 void setPen( const QColor&,
89 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
90
91 void setPen( const QPen& );
92 const QPen& pen() const;
93
94 void setBrush( const QBrush& );
95 const QBrush& brush() const;
96
97 void setSamples( const QVector< QwtIntervalSample >& );
98 void setSamples( QwtSeriesData< QwtIntervalSample >* );
99
100 void setBaseline( double );
101 double baseline() const;
102
103 void setStyle( HistogramStyle style );
104 HistogramStyle style() const;
105
106 void setSymbol( const QwtColumnSymbol* );
107 const QwtColumnSymbol* symbol() const;
108
109 virtual void drawSeries( QPainter*,
110 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
111 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
112
113 virtual QRectF boundingRect() const QWT_OVERRIDE;
114
115 virtual QwtGraphic legendIcon(
116 int index, const QSizeF& ) const QWT_OVERRIDE;
117
118 protected:
119 virtual QwtColumnRect columnRect( const QwtIntervalSample&,
120 const QwtScaleMap&, const QwtScaleMap& ) const;
121
122 virtual void drawColumn( QPainter*, const QwtColumnRect&,
123 const QwtIntervalSample& ) const;
124
125 void drawColumns( QPainter*,
126 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
127 int from, int to ) const;
128
129 void drawOutline( QPainter*,
130 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
131 int from, int to ) const;
132
133 void drawLines( QPainter*,
134 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
135 int from, int to ) const;
136
137 private:
138 void init();
139 void flushPolygon( QPainter*, double baseLine, QPolygonF& ) const;
140
141 class PrivateData;
142 PrivateData* m_data;
143};
144
145#endif
Directed rectangle representing bounding rectangle and orientation of a column.
A drawing primitive for columns.
A paint device for scalable graphics.
Definition qwt_graphic.h:76
A sample of the types (x1-x2, y) or (x, y1-y2)
Definition qwt_samples.h:21
QwtPlotHistogram represents a series of samples, where an interval is associated with a value ( ).
virtual int rtti() const
Base class for plot items representing a series of samples.
A scale map.
Abstract interface for iterating over samples.
Class storing a QwtSeriesData object.
A class representing a text.
Definition qwt_text.h:52