File: QwtPlotBarChart.3

package info (click to toggle)
qwt 6.1.2-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,848 kB
  • ctags: 15,811
  • sloc: cpp: 57,382; makefile: 41
file content (451 lines) | stat: -rw-r--r-- 11,198 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
.TH "QwtPlotBarChart" 3 "Thu Dec 11 2014" "Version 6.1.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotBarChart \- 
.PP
\fBQwtPlotBarChart\fP displays a series of a values as bars\&.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_barchart\&.h>\fP
.PP
Inherits \fBQwtPlotAbstractBarChart\fP, and \fBQwtSeriesStore< QPointF >\fP\&.
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBLegendMode\fP { \fBLegendChartTitle\fP, \fBLegendBarTitles\fP }"
.br
.RI "\fILegend modes\&. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtPlotBarChart\fP (const QString &\fBtitle\fP=QString::null)"
.br
.ti -1c
.RI "\fBQwtPlotBarChart\fP (const \fBQwtText\fP &\fBtitle\fP)"
.br
.ti -1c
.RI "virtual \fB~QwtPlotBarChart\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "virtual int \fBrtti\fP () const "
.br
.ti -1c
.RI "void \fBsetSamples\fP (const QVector< QPointF > &)"
.br
.ti -1c
.RI "void \fBsetSamples\fP (const QVector< double > &)"
.br
.ti -1c
.RI "void \fBsetSamples\fP (\fBQwtSeriesData\fP< QPointF > *series)"
.br
.ti -1c
.RI "void \fBsetSymbol\fP (\fBQwtColumnSymbol\fP *)"
.br
.RI "\fIAssign a symbol\&. \fP"
.ti -1c
.RI "const \fBQwtColumnSymbol\fP * \fBsymbol\fP () const "
.br
.ti -1c
.RI "void \fBsetLegendMode\fP (\fBLegendMode\fP)"
.br
.ti -1c
.RI "\fBLegendMode\fP \fBlegendMode\fP () const "
.br
.ti -1c
.RI "virtual void \fBdrawSeries\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, int from, int to) const "
.br
.ti -1c
.RI "virtual QRectF \fBboundingRect\fP () const "
.br
.ti -1c
.RI "virtual \fBQwtColumnSymbol\fP * \fBspecialSymbol\fP (int sampleIndex, const QPointF &) const "
.br
.ti -1c
.RI "virtual \fBQwtText\fP \fBbarTitle\fP (int sampleIndex) const "
.br
.RI "\fIReturn the title of a bar\&. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBdrawSample\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, const \fBQwtInterval\fP &boundingInterval, int index, const QPointF &\fBsample\fP) const "
.br
.ti -1c
.RI "virtual void \fBdrawBar\fP (QPainter *, int sampleIndex, const QPointF &point, const \fBQwtColumnRect\fP &) const "
.br
.ti -1c
.RI "QList< \fBQwtLegendData\fP > \fBlegendData\fP () const "
.br
.RI "\fIReturn all information, that is needed to represent the item on the legend\&. \fP"
.ti -1c
.RI "\fBQwtGraphic\fP \fBlegendIcon\fP (int index, const QSizeF &) const "
.br
.in -1c
.SH "Detailed Description"
.PP 
\fBQwtPlotBarChart\fP displays a series of a values as bars\&. 

Each bar might be customized individually by implementing a \fBspecialSymbol()\fP\&. Otherwise it is rendered using a default symbol\&.
.PP
Depending on its \fBorientation()\fP the bars are displayed horizontally or vertically\&. The bars cover the interval between the \fBbaseline()\fP and the value\&.
.PP
By activating the LegendBarTitles mode each sample will have its own entry on the legend\&.
.PP
The most common use case of a bar chart is to display a list of y coordinates, where the x coordinate is simply the index in the list\&. But for other situations ( f\&.e\&. when values are related to dates ) it is also possible to set x coordinates explicitly\&.
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotMultiBarChart\fP, \fBQwtPlotHistogram\fP, \fBQwtPlotCurve::Sticks\fP, \fBQwtPlotSeriesItem::orientation()\fP, \fBQwtPlotAbstractBarChart::baseline()\fP 
.RE
.PP

.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBQwtPlotBarChart::LegendMode\fP"

.PP
Legend modes\&. The default setting is \fBQwtPlotBarChart::LegendChartTitle\fP\&. 
.PP
\fBSee Also:\fP
.RS 4
\fBsetLegendMode()\fP, \fBlegendMode()\fP 
.RE
.PP

.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fILegendChartTitle \fP\fP
One entry on the legend showing the default symbol and the \fBtitle()\fP of the chart
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotItem::title()\fP 
.RE
.PP

.TP
\fB\fILegendBarTitles \fP\fP
One entry for each value showing the individual symbol of the corresponding bar and the bar title\&.
.PP
\fBSee Also:\fP
.RS 4
\fBspecialSymbol()\fP, \fBbarTitle()\fP 
.RE
.PP

.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtPlotBarChart::QwtPlotBarChart (const QString &title = \fCQString::null\fP)\fC [explicit]\fP"
Constructor 
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title of the curve 
.RE
.PP

.SS "QwtPlotBarChart::QwtPlotBarChart (const \fBQwtText\fP &title)\fC [explicit]\fP"
Constructor 
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title of the curve 
.RE
.PP

.SH "Member Function Documentation"
.PP 
.SS "\fBQwtText\fP QwtPlotBarChart::barTitle (intsampleIndex) const\fC [virtual]\fP"

.PP
Return the title of a bar\&. In LegendBarTitles mode the title is displayed on the legend entry corresponding to a bar\&.
.PP
The default implementation is a dummy, that is intended to be overloaded\&.
.PP
\fBParameters:\fP
.RS 4
\fIsampleIndex\fP Index of the bar 
.RE
.PP
\fBReturns:\fP
.RS 4
An empty text 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBLegendBarTitles\fP 
.RE
.PP

.SS "QRectF QwtPlotBarChart::boundingRect () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
Bounding rectangle of all samples\&. For an empty series the rectangle is invalid\&. 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotSeriesItem\fP\&.
.SS "void QwtPlotBarChart::drawBar (QPainter *painter, intsampleIndex, const QPointF &sample, const \fBQwtColumnRect\fP &rect) const\fC [protected]\fP, \fC [virtual]\fP"
Draw a bar
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter 
.br
\fIsampleIndex\fP Index of the sample represented by the bar 
.br
\fIsample\fP Value of the sample 
.br
\fIrect\fP Bounding rectangle of the bar 
.RE
.PP

.SS "void QwtPlotBarChart::drawSample (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, const \fBQwtInterval\fP &boundingInterval, intindex, const QPointF &sample) const\fC [protected]\fP, \fC [virtual]\fP"
Draw a sample
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter 
.br
\fIxMap\fP x map 
.br
\fIyMap\fP y map 
.br
\fIcanvasRect\fP Contents rect of the canvas 
.br
\fIboundingInterval\fP Bounding interval of sample values 
.br
\fIindex\fP Index of the sample 
.br
\fIsample\fP Value of the sample
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBdrawSeries()\fP 
.RE
.PP

.SS "void QwtPlotBarChart::drawSeries (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, intfrom, intto) const\fC [virtual]\fP"
Draw an interval of the bar chart
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter 
.br
\fIxMap\fP Maps x-values into pixel coordinates\&. 
.br
\fIyMap\fP Maps y-values into pixel coordinates\&. 
.br
\fIcanvasRect\fP Contents rect of the canvas 
.br
\fIfrom\fP Index of the first point to be painted 
.br
\fIto\fP Index of the last point to be painted\&. If to < 0 the curve will be painted to its last point\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
drawSymbols() 
.RE
.PP

.PP
Implements \fBQwtPlotSeriesItem\fP\&.
.SS "QList< \fBQwtLegendData\fP > QwtPlotBarChart::legendData () const\fC [protected]\fP, \fC [virtual]\fP"

.PP
Return all information, that is needed to represent the item on the legend\&. In case of LegendBarTitles an entry for each bar is returned, otherwise the chart is represented like any other plot item from its \fBtitle()\fP and the \fBlegendIcon()\fP\&.
.PP
\fBReturns:\fP
.RS 4
Information, that is needed to represent the item on the legend 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtitle()\fP, \fBsetLegendMode()\fP, \fBbarTitle()\fP, \fBQwtLegend\fP, \fBQwtPlotLegendItem\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "\fBQwtGraphic\fP QwtPlotBarChart::legendIcon (intindex, const QSizeF &size) const\fC [protected]\fP, \fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
Icon representing a bar or the chart on the legend
.RE
.PP
When the \fBlegendMode()\fP is LegendBarTitles the icon shows the bar corresponding to index - otherwise the bar displays the default symbol\&.
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index of the legend entry 
.br
\fIsize\fP Icon size
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetLegendMode()\fP, \fBdrawBar()\fP, \fBQwtPlotItem::setLegendIconSize()\fP, \fBQwtPlotItem::legendData()\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "\fBQwtPlotBarChart::LegendMode\fP QwtPlotBarChart::legendMode () const"

.PP
\fBReturns:\fP
.RS 4
Legend mode 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetLegendMode()\fP 
.RE
.PP

.SS "int QwtPlotBarChart::rtti () const\fC [virtual]\fP"

.PP
\fBReturns:\fP
.RS 4
\fBQwtPlotItem::Rtti_PlotBarChart\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "void QwtPlotBarChart::setLegendMode (\fBLegendMode\fPmode)"
Set the mode that decides what to display on the legend
.PP
In case of LegendBarTitles \fBbarTitle()\fP needs to be overloaded to return individual titles for each bar\&.
.PP
\fBParameters:\fP
.RS 4
\fImode\fP New mode 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBlegendMode()\fP, \fBlegendData()\fP, \fBbarTitle()\fP, \fBQwtPlotItem::ItemAttribute\fP 
.RE
.PP

.SS "void QwtPlotBarChart::setSamples (const QVector< QPointF > &samples)"
Initialize data with an array of points
.PP
\fBParameters:\fP
.RS 4
\fIsamples\fP Vector of points 
.RE
.PP
\fBNote:\fP
.RS 4
QVector is implicitly shared 
.PP
QPolygonF is derived from QVector<QPointF> 
.RE
.PP

.SS "void QwtPlotBarChart::setSamples (const QVector< double > &samples)"
Initialize data with an array of doubles
.PP
The indices in the array are taken as x coordinate, while the doubles are interpreted as y values\&.
.PP
\fBParameters:\fP
.RS 4
\fIsamples\fP Vector of y coordinates 
.RE
.PP
\fBNote:\fP
.RS 4
QVector is implicitly shared 
.RE
.PP

.SS "void QwtPlotBarChart::setSamples (\fBQwtSeriesData\fP< QPointF > *data)"
Assign a series of samples
.PP
\fBsetSamples()\fP is just a wrapper for \fBsetData()\fP without any additional value - beside that it is easier to find for the developer\&.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP Data 
.RE
.PP
\fBWarning:\fP
.RS 4
The item takes ownership of the data object, deleting it when its not used anymore\&. 
.RE
.PP

.SS "void QwtPlotBarChart::setSymbol (\fBQwtColumnSymbol\fP *symbol)"

.PP
Assign a symbol\&. The bar chart will take the ownership of the symbol, hence the previously set symbol will be delete by setting a new one\&. If \fCsymbol\fP is \fCNULL\fP no symbol will be drawn\&.
.PP
\fBParameters:\fP
.RS 4
\fIsymbol\fP Symbol 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsymbol()\fP 
.RE
.PP

.SS "\fBQwtColumnSymbol\fP * QwtPlotBarChart::specialSymbol (intsampleIndex, const QPointF &sample) const\fC [virtual]\fP"
Needs to be overloaded to return a non default symbol for a specific sample
.PP
\fBParameters:\fP
.RS 4
\fIsampleIndex\fP Index of the sample represented by the bar 
.br
\fIsample\fP Value of the sample
.RE
.PP
\fBReturns:\fP
.RS 4
NULL, indicating to use the default symbol 
.RE
.PP

.SS "const \fBQwtColumnSymbol\fP * QwtPlotBarChart::symbol () const"

.PP
\fBReturns:\fP
.RS 4
Current symbol or NULL, when no symbol has been assigned 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetSymbol()\fP 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.