File: classQCPBarsGroup.html

package info (click to toggle)
qcustomplot 1.3.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,112 kB
  • ctags: 2,361
  • sloc: cpp: 17,354; sh: 1,555; makefile: 2
file content (544 lines) | stat: -rw-r--r-- 35,606 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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="author" content="Emanuel Eichhammer" />
<meta name="copyright" content="(C) 2013-2015 Emanuel Eichhammer" />
<title>QCPBarsGroup Class Reference</title>
<link href="qt.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top">
<a class="headerLink"  href="index.html">Main Page</a> &middot;
<a class="headerLink"  href="classoverview.html">Class Overview</a> &middot;
<a class="headerLink"  href="hierarchy.html">Hierarchy</a> &middot;
<a class="headerLink"  href="annotated.html">All Classes</a> &middot;
<a class="headerLink"  href="pages.html">Special Pages</a>
<!-- Generated by Doxygen 1.8.6 -->
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Functions</a> &#124;
<a href="#pro-methods">Protected Functions</a>  </div>
  <div class="headertitle">
<div class="title">QCPBarsGroup Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Groups multiple <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> together so they appear side by side.  
 <a href="classQCPBarsGroup.html#details">More...</a></p>

<p>Inherits QObject.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a4c0521120a97e60bbca37677a37075b6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a> </td></tr>
<tr class="separator:a4c0521120a97e60bbca37677a37075b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Functions</h2></td></tr>
<tr class="memitem:aa4e043b9a22c6c5ea0f93740aca063e1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#aa4e043b9a22c6c5ea0f93740aca063e1">QCPBarsGroup</a> (<a class="el" href="classQCustomPlot.html">QCustomPlot</a> *parentPlot)</td></tr>
<tr class="separator:aa4e043b9a22c6c5ea0f93740aca063e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bb562f669d47bd7d3cdd2da1f7d8f00"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1bb562f669d47bd7d3cdd2da1f7d8f00"></a>
<a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>&#160;</td><td class="memItemRight" valign="bottom"><b>spacingType</b> () const </td></tr>
<tr class="separator:a1bb562f669d47bd7d3cdd2da1f7d8f00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a730bffefcac6c97aaf60e6f64dd3bcd9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a730bffefcac6c97aaf60e6f64dd3bcd9"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>spacing</b> () const </td></tr>
<tr class="separator:a730bffefcac6c97aaf60e6f64dd3bcd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c7e2d61b10594a4555b615e1fcaf49e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a2c7e2d61b10594a4555b615e1fcaf49e">setSpacingType</a> (<a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a> spacingType)</td></tr>
<tr class="separator:a2c7e2d61b10594a4555b615e1fcaf49e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa553d327479d72a0c3dafcc724a190e2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a> (double spacing)</td></tr>
<tr class="separator:aa553d327479d72a0c3dafcc724a190e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c72ed1f8cd962c93b8c42ab96cd91ec"><td class="memItemLeft" align="right" valign="top">QList&lt; <a class="el" href="classQCPBars.html">QCPBars</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a> () const </td></tr>
<tr class="separator:a7c72ed1f8cd962c93b8c42ab96cd91ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72d022790b7c93151c95c28eefaf51b4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a72d022790b7c93151c95c28eefaf51b4">bars</a> (int index) const </td></tr>
<tr class="separator:a72d022790b7c93151c95c28eefaf51b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af07364189c5717a158ec95b609687532"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#af07364189c5717a158ec95b609687532">size</a> () const </td></tr>
<tr class="separator:af07364189c5717a158ec95b609687532"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d89da4e9176f4f77105e9a4afd44e2b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a1d89da4e9176f4f77105e9a4afd44e2b">isEmpty</a> () const </td></tr>
<tr class="separator:a1d89da4e9176f4f77105e9a4afd44e2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ddf23928c6cd89530bd34ab7ba7b177"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a3ddf23928c6cd89530bd34ab7ba7b177">clear</a> ()</td></tr>
<tr class="separator:a3ddf23928c6cd89530bd34ab7ba7b177"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb4837894167e629e42e200db056fac3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#adb4837894167e629e42e200db056fac3">contains</a> (<a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>) const </td></tr>
<tr class="separator:adb4837894167e629e42e200db056fac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a809ed63cc4ff7cd5b0b8c96b470163d3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a809ed63cc4ff7cd5b0b8c96b470163d3">append</a> (<a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>)</td></tr>
<tr class="separator:a809ed63cc4ff7cd5b0b8c96b470163d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a309a5f7233db189f3ea9c2d04ece6c13"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a309a5f7233db189f3ea9c2d04ece6c13">insert</a> (int i, <a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>)</td></tr>
<tr class="separator:a309a5f7233db189f3ea9c2d04ece6c13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a215e28a5944f1159013a0e19169220e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a215e28a5944f1159013a0e19169220e7">remove</a> (<a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>)</td></tr>
<tr class="separator:a215e28a5944f1159013a0e19169220e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Functions</h2></td></tr>
<tr class="memitem:a7b00514f19ad58d0bb3fd5246a67fae2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a7b00514f19ad58d0bb3fd5246a67fae2">registerBars</a> (<a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>)</td></tr>
<tr class="separator:a7b00514f19ad58d0bb3fd5246a67fae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7073cdd7b1a40c6cb4b5f908145f8c4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#ac7073cdd7b1a40c6cb4b5f908145f8c4">unregisterBars</a> (<a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>)</td></tr>
<tr class="separator:ac7073cdd7b1a40c6cb4b5f908145f8c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e2ca6002e7bab49670144d048a2bcc9"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a8e2ca6002e7bab49670144d048a2bcc9">keyPixelOffset</a> (const <a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>, double keyCoord)</td></tr>
<tr class="separator:a8e2ca6002e7bab49670144d048a2bcc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0beccd41bc3841a4c5b284823bc7d2de"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classQCPBarsGroup.html#a0beccd41bc3841a4c5b284823bc7d2de">getPixelSpacing</a> (const <a class="el" href="classQCPBars.html">QCPBars</a> *<a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a>, double keyCoord)</td></tr>
<tr class="separator:a0beccd41bc3841a4c5b284823bc7d2de"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Groups multiple <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> together so they appear side by side. </p>
<div class="image">
<img src="QCPBarsGroup.png" alt="QCPBarsGroup.png"/>
</div>
<p>When showing multiple <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> in one plot which have bars at identical keys, it may be desirable to have them appearing next to each other at each key. This is what adding the respective <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> plottables to a <a class="el" href="classQCPBarsGroup.html" title="Groups multiple QCPBars together so they appear side by side. ">QCPBarsGroup</a> achieves. (An alternative approach is to stack them on top of each other, see <a class="el" href="classQCPBars.html#ac22e00a6a41509538c21b04f0a57318c">QCPBars::moveAbove</a>.)</p>
<h1><a class="anchor" id="qcpbarsgroup-usage"></a>
Usage</h1>
<p>To add a <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> plottable to the group, create a new group and then add the respective bars intances: </p>
<div class="fragment"><div class="line">  <a class="code" href="classQCPBarsGroup.html">QCPBarsGroup</a> *group = <span class="keyword">new</span> <a class="code" href="classQCPBarsGroup.html#aa4e043b9a22c6c5ea0f93740aca063e1">QCPBarsGroup</a>(customPlot);</div>
<div class="line">  group-&gt;<a class="code" href="classQCPBarsGroup.html#a809ed63cc4ff7cd5b0b8c96b470163d3">append</a>(bars1);</div>
<div class="line">  group-&gt;<a class="code" href="classQCPBarsGroup.html#a809ed63cc4ff7cd5b0b8c96b470163d3">append</a>(bars2);</div>
</div><!-- fragment --><p>Alternatively to appending to the group like shown above, you can also set the group on the <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> plottable via <a class="el" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">QCPBars::setBarsGroup</a>.</p>
<p>The spacing between the bars can be configured via <a class="el" href="classQCPBarsGroup.html#a2c7e2d61b10594a4555b615e1fcaf49e">setSpacingType</a> and <a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a>. The bars in this group appear in the plot in the order they were appended. To insert a bars plottable at a certain index position, or to reposition a bars plottable which is already in the group, use <a class="el" href="classQCPBarsGroup.html#a309a5f7233db189f3ea9c2d04ece6c13">insert</a>.</p>
<p>To remove specific bars from the group, use either <a class="el" href="classQCPBarsGroup.html#a215e28a5944f1159013a0e19169220e7">remove</a> or call <a class="el" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">QCPBars::setBarsGroup(0)</a> on the respective bars plottable.</p>
<p>To clear the entire group, call <a class="el" href="classQCPBarsGroup.html#a3ddf23928c6cd89530bd34ab7ba7b177">clear</a>, or simply delete the group.</p>
<h1><a class="anchor" id="qcpbarsgroup-example"></a>
Example</h1>
<p>The image above is generated with the following code: </p>
<div class="fragment"><div class="line">  QVector&lt;double&gt; datax = QVector&lt;double&gt;() &lt;&lt; 1 &lt;&lt; 2 &lt;&lt; 3 &lt;&lt; 4;</div>
<div class="line">  QVector&lt;double&gt; datay1 = QVector&lt;double&gt;() &lt;&lt; 0.6 &lt;&lt; 0.5 &lt;&lt; 0.3 &lt;&lt; 0.15;</div>
<div class="line">  QVector&lt;double&gt; datay2 = QVector&lt;double&gt;() &lt;&lt; 0.3 &lt;&lt; 0.28 &lt;&lt; 0.2 &lt;&lt; 0.1;</div>
<div class="line">  QVector&lt;double&gt; datay3 = QVector&lt;double&gt;() &lt;&lt; 0.33 &lt;&lt; 0.31 &lt;&lt; 0.27 &lt;&lt; 0.13;</div>
<div class="line">  </div>
<div class="line">  <a class="code" href="classQCPBarsGroup.html">QCPBarsGroup</a> *group1 = <span class="keyword">new</span> <a class="code" href="classQCPBarsGroup.html#aa4e043b9a22c6c5ea0f93740aca063e1">QCPBarsGroup</a>(customPlot);</div>
<div class="line">  <a class="code" href="classQCPBars.html">QCPBars</a> *<a class="code" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars</a> = <span class="keyword">new</span> <a class="code" href="classQCPBars.html">QCPBars</a>(customPlot-&gt;xAxis, customPlot-&gt;yAxis);</div>
<div class="line">  customPlot-&gt;addPlottable(bars);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#aa3435aab19e0a49e4e7b41bd36a8d96b">setData</a>(datax, datay1);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#a7a4b92144dca6453a1f0f210e27edc74">setBrush</a>(QColor(0, 0, 255, 50));</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#ab74b09ae4c0e7e13142fe4b5bf46cac7">setPen</a>(QColor(0, 0, 255));</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#afec6116579d44d5b706e0fa5e5332507">setWidth</a>(0.15);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">setBarsGroup</a>(group1);</div>
<div class="line">  bars = <span class="keyword">new</span> <a class="code" href="classQCPBars.html">QCPBars</a>(customPlot-&gt;xAxis, customPlot-&gt;yAxis);</div>
<div class="line">  customPlot-&gt;addPlottable(bars);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#aa3435aab19e0a49e4e7b41bd36a8d96b">setData</a>(datax, datay2);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#a7a4b92144dca6453a1f0f210e27edc74">setBrush</a>(QColor(180, 00, 120, 50));</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#ab74b09ae4c0e7e13142fe4b5bf46cac7">setPen</a>(QColor(180, 00, 120));</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#afec6116579d44d5b706e0fa5e5332507">setWidth</a>(0.15);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">setBarsGroup</a>(group1);</div>
<div class="line">  bars = <span class="keyword">new</span> <a class="code" href="classQCPBars.html">QCPBars</a>(customPlot-&gt;xAxis, customPlot-&gt;yAxis);</div>
<div class="line">  customPlot-&gt;addPlottable(bars);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#aa3435aab19e0a49e4e7b41bd36a8d96b">setData</a>(datax, datay3);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#a7a4b92144dca6453a1f0f210e27edc74">setBrush</a>(QColor(255, 154, 0, 50));</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#ab74b09ae4c0e7e13142fe4b5bf46cac7">setPen</a>(QColor(255, 154, 0));</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#afec6116579d44d5b706e0fa5e5332507">setWidth</a>(0.15);</div>
<div class="line">  bars-&gt;<a class="code" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">setBarsGroup</a>(group1);</div>
<div class="line"></div>
<div class="line">  customPlot-&gt;xAxis-&gt;setRange(0.1, 4.9);</div>
<div class="line">  customPlot-&gt;yAxis-&gt;setRange(0, 0.7);</div>
<div class="line">  customPlot-&gt;xAxis-&gt;setAutoTickStep(<span class="keyword">false</span>);</div>
<div class="line">  customPlot-&gt;xAxis-&gt;setTickStep(1);</div>
</div><!-- fragment --></div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a4c0521120a97e60bbca37677a37075b6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">QCPBarsGroup::SpacingType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Defines the ways the spacing between bars in the group can be specified. Thus it defines what the number passed to <a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a> actually means.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a2c7e2d61b10594a4555b615e1fcaf49e">setSpacingType</a>, <a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a4c0521120a97e60bbca37677a37075b6ab53fa3efaf14867dd0f14d41d64e42ac"></a>stAbsolute</em>&#160;</td><td class="fielddoc">
<p>Bar spacing is in absolute pixels. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a4c0521120a97e60bbca37677a37075b6ae94b05c27bc985dcdd8b1e1b7f163d26"></a>stAxisRectRatio</em>&#160;</td><td class="fielddoc">
<p>Bar spacing is given by a fraction of the axis rect size. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a4c0521120a97e60bbca37677a37075b6ad369cee6287e0a86e8c2b643a3168c54"></a>stPlotCoords</em>&#160;</td><td class="fielddoc">
<p>Bar spacing is in key coordinates and thus scales with the key axis range. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa4e043b9a22c6c5ea0f93740aca063e1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPBarsGroup::QCPBarsGroup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCustomPlot.html">QCustomPlot</a> *&#160;</td>
          <td class="paramname"><em>parentPlot</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructs a new bars group for the specified <a class="el" href="classQCustomPlot.html" title="The central class of the library. This is the QWidget which displays the plot and interacts with the ...">QCustomPlot</a> instance. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a2c7e2d61b10594a4555b615e1fcaf49e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::setSpacingType </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>&#160;</td>
          <td class="paramname"><em>spacingType</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets how the spacing between adjacent bars is interpreted. See <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>.</p>
<p>The actual spacing can then be specified with <a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa553d327479d72a0c3dafcc724a190e2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::setSpacing </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>spacing</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the spacing between adjacent bars. What the number passed as <em>spacing</em> actually means, is defined by the current <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>, which can be set with <a class="el" href="classQCPBarsGroup.html#a2c7e2d61b10594a4555b615e1fcaf49e">setSpacingType</a>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a2c7e2d61b10594a4555b615e1fcaf49e">setSpacingType</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7c72ed1f8cd962c93b8c42ab96cd91ec"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QList&lt; <a class="el" href="classQCPBars.html">QCPBars</a> * &gt; QCPBarsGroup::bars </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns all bars currently in this group.</p>
<dl class="section see"><dt>See Also</dt><dd>bars(int index) </dd></dl>

</div>
</div>
<a class="anchor" id="a72d022790b7c93151c95c28eefaf51b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classQCPBars.html">QCPBars</a> * QCPBarsGroup::bars </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> instance with the specified <em>index</em> in this group. If no such <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> exists, returns 0.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a7c72ed1f8cd962c93b8c42ab96cd91ec">bars()</a>, <a class="el" href="classQCPBarsGroup.html#af07364189c5717a158ec95b609687532">size</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af07364189c5717a158ec95b609687532"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int QCPBarsGroup::size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the number of <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> plottables that are part of this group. </p>

</div>
</div>
<a class="anchor" id="a1d89da4e9176f4f77105e9a4afd44e2b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool QCPBarsGroup::isEmpty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns whether this bars group is empty.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#af07364189c5717a158ec95b609687532">size</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a3ddf23928c6cd89530bd34ab7ba7b177"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Removes all <a class="el" href="classQCPBars.html" title="A plottable representing a bar chart in a plot. ">QCPBars</a> plottables from this group.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a1d89da4e9176f4f77105e9a4afd44e2b">isEmpty</a> </dd></dl>

</div>
</div>
<a class="anchor" id="adb4837894167e629e42e200db056fac3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool QCPBarsGroup::contains </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns whether the specified <em>bars</em> plottable is part of this group. </p>

</div>
</div>
<a class="anchor" id="a809ed63cc4ff7cd5b0b8c96b470163d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::append </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adds the specified <em>bars</em> plottable to this group. Alternatively, you can also use <a class="el" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">QCPBars::setBarsGroup</a> on the <em>bars</em> instance.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a309a5f7233db189f3ea9c2d04ece6c13">insert</a>, <a class="el" href="classQCPBarsGroup.html#a215e28a5944f1159013a0e19169220e7">remove</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a309a5f7233db189f3ea9c2d04ece6c13"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::insert </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Inserts the specified <em>bars</em> plottable into this group at the specified index position <em>i</em>. This gives you full control over the ordering of the bars.</p>
<p><em>bars</em> may already be part of this group. In that case, <em>bars</em> is just moved to the new index position.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a809ed63cc4ff7cd5b0b8c96b470163d3">append</a>, <a class="el" href="classQCPBarsGroup.html#a215e28a5944f1159013a0e19169220e7">remove</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a215e28a5944f1159013a0e19169220e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Removes the specified <em>bars</em> plottable from this group.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#adb4837894167e629e42e200db056fac3">contains</a>, <a class="el" href="classQCPBarsGroup.html#a3ddf23928c6cd89530bd34ab7ba7b177">clear</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7b00514f19ad58d0bb3fd5246a67fae2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::registerBars </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Adds the specified <em>bars</em> to the internal mBars list of bars. This method does not change the barsGroup property on <em>bars</em>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#ac7073cdd7b1a40c6cb4b5f908145f8c4">unregisterBars</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ac7073cdd7b1a40c6cb4b5f908145f8c4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QCPBarsGroup::unregisterBars </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Removes the specified <em>bars</em> from the internal mBars list of bars. This method does not change the barsGroup property on <em>bars</em>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a7b00514f19ad58d0bb3fd5246a67fae2">registerBars</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8e2ca6002e7bab49670144d048a2bcc9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double QCPBarsGroup::keyPixelOffset </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>keyCoord</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the pixel offset in the key dimension the specified <em>bars</em> plottable should have at the given key coordinate <em>keyCoord</em>. The offset is relative to the pixel position of the key coordinate <em>keyCoord</em>. </p>

</div>
</div>
<a class="anchor" id="a0beccd41bc3841a4c5b284823bc7d2de"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">double QCPBarsGroup::getPixelSpacing </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
          <td class="paramname"><em>bars</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>keyCoord</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns the spacing in pixels which is between this <em>bars</em> and the following one, both at the key coordinate <em>keyCoord</em>.</p>
<dl class="section note"><dt>Note</dt><dd>Typically the returned value doesn't depend on <em>bars</em> or <em>keyCoord</em>. <em>bars</em> is only needed to get acces to the key axis transformation and axis rect for the modes <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6ae94b05c27bc985dcdd8b1e1b7f163d26">stAxisRectRatio</a> and <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6ad369cee6287e0a86e8c2b643a3168c54">stPlotCoords</a>. The <em>keyCoord</em> is only relevant for spacings given in <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6ad369cee6287e0a86e8c2b643a3168c54">stPlotCoords</a> on a logarithmic axis. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/plottables/<a class="el" href="plottable-bars_8h.html">plottable-bars.h</a></li>
<li>src/plottables/plottable-bars.cpp</li>
</ul>
</div><!-- contents -->
</body>
</html>