Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_barchart.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_BAR_CHART_H
11#define QWT_PLOT_BAR_CHART_H
12
13#include "qwt_global.h"
14#include "qwt_plot_abstract_barchart.h"
15
16class QwtColumnRect;
17class QwtColumnSymbol;
18template< typename T > class QwtSeriesData;
19
41class QWT_EXPORT QwtPlotBarChart
43 , public QwtSeriesStore< QPointF >
44{
45 public:
53 {
61
68 LegendBarTitles
69 };
70
71 explicit QwtPlotBarChart( const QString& title = QString() );
72 explicit QwtPlotBarChart( const QwtText& title );
73
74 virtual ~QwtPlotBarChart();
75
76 virtual int rtti() const QWT_OVERRIDE;
77
78 void setSamples( const QVector< QPointF >& );
79 void setSamples( const QVector< double >& );
80 void setSamples( QwtSeriesData< QPointF >* );
81
82 void setSymbol( QwtColumnSymbol* );
83 const QwtColumnSymbol* symbol() const;
84
85 void setLegendMode( LegendMode );
86 LegendMode legendMode() const;
87
88 virtual void drawSeries( QPainter*,
89 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
90 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
91
92 virtual QRectF boundingRect() const QWT_OVERRIDE;
93
94 virtual QwtColumnSymbol* specialSymbol(
95 int sampleIndex, const QPointF& ) const;
96
97 virtual QwtText barTitle( int sampleIndex ) const;
98
99 protected:
100 virtual void drawSample( QPainter* painter,
101 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
102 const QRectF& canvasRect, const QwtInterval& boundingInterval,
103 int index, const QPointF& sample ) const;
104
105 virtual void drawBar( QPainter*,
106 int sampleIndex, const QPointF& sample,
107 const QwtColumnRect& ) const;
108
109 QwtColumnRect columnRect(
110 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
111 const QRectF& canvasRect, const QwtInterval& boundingInterval,
112 const QPointF& sample ) const;
113
114 QList< QwtLegendData > legendData() const QWT_OVERRIDE;
115 QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE;
116
117 private:
118 void init();
119
120 class PrivateData;
121 PrivateData* m_data;
122};
123
124#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 class representing an interval.
Attributes of an entry on a legend.
Abstract base class for bar chart items.
QwtPlotBarChart displays a series of a values as bars.
LegendMode
Legend modes.
virtual int rtti() const
A scale map.
Abstract interface for iterating over samples.
Class storing a QwtSeriesData object.
A class representing a text.
Definition qwt_text.h:52