classQCPBarsGroup.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta name="author" content="Emanuel Eichhammer" />
  6. <meta name="copyright" content="(C) 2013-2015 Emanuel Eichhammer" />
  7. <title>QCPBarsGroup Class Reference</title>
  8. <link href="qt.css" rel="stylesheet" type="text/css"/>
  9. </head>
  10. <body>
  11. <div id="top">
  12. <a class="headerLink" href="index.html">Main Page</a> &middot;
  13. <a class="headerLink" href="classoverview.html">Class Overview</a> &middot;
  14. <a class="headerLink" href="hierarchy.html">Hierarchy</a> &middot;
  15. <a class="headerLink" href="annotated.html">All Classes</a> &middot;
  16. <a class="headerLink" href="pages.html">Special Pages</a>
  17. <!-- Generated by Doxygen 1.8.6 -->
  18. </div><!-- top -->
  19. <div class="header">
  20. <div class="summary">
  21. <a href="#pub-types">Public Types</a> &#124;
  22. <a href="#pub-methods">Public Functions</a> &#124;
  23. <a href="#pro-methods">Protected Functions</a> </div>
  24. <div class="headertitle">
  25. <div class="title">QCPBarsGroup Class Reference</div> </div>
  26. </div><!--header-->
  27. <div class="contents">
  28. <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.
  29. <a href="classQCPBarsGroup.html#details">More...</a></p>
  30. <p>Inherits QObject.</p>
  31. <table class="memberdecls">
  32. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
  33. Public Types</h2></td></tr>
  34. <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>
  35. <tr class="separator:a4c0521120a97e60bbca37677a37075b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
  36. </table><table class="memberdecls">
  37. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  38. Public Functions</h2></td></tr>
  39. <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>
  40. <tr class="separator:aa4e043b9a22c6c5ea0f93740aca063e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  41. <tr class="memitem:a1bb562f669d47bd7d3cdd2da1f7d8f00"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1bb562f669d47bd7d3cdd2da1f7d8f00"></a>
  42. <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>&#160;</td><td class="memItemRight" valign="bottom"><b>spacingType</b> () const </td></tr>
  43. <tr class="separator:a1bb562f669d47bd7d3cdd2da1f7d8f00"><td class="memSeparator" colspan="2">&#160;</td></tr>
  44. <tr class="memitem:a730bffefcac6c97aaf60e6f64dd3bcd9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a730bffefcac6c97aaf60e6f64dd3bcd9"></a>
  45. double&#160;</td><td class="memItemRight" valign="bottom"><b>spacing</b> () const </td></tr>
  46. <tr class="separator:a730bffefcac6c97aaf60e6f64dd3bcd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  47. <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>
  48. <tr class="separator:a2c7e2d61b10594a4555b615e1fcaf49e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  49. <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>
  50. <tr class="separator:aa553d327479d72a0c3dafcc724a190e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  51. <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>
  52. <tr class="separator:a7c72ed1f8cd962c93b8c42ab96cd91ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
  53. <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>
  54. <tr class="separator:a72d022790b7c93151c95c28eefaf51b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  55. <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>
  56. <tr class="separator:af07364189c5717a158ec95b609687532"><td class="memSeparator" colspan="2">&#160;</td></tr>
  57. <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>
  58. <tr class="separator:a1d89da4e9176f4f77105e9a4afd44e2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  59. <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>
  60. <tr class="separator:a3ddf23928c6cd89530bd34ab7ba7b177"><td class="memSeparator" colspan="2">&#160;</td></tr>
  61. <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>
  62. <tr class="separator:adb4837894167e629e42e200db056fac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  63. <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>
  64. <tr class="separator:a809ed63cc4ff7cd5b0b8c96b470163d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  65. <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>
  66. <tr class="separator:a309a5f7233db189f3ea9c2d04ece6c13"><td class="memSeparator" colspan="2">&#160;</td></tr>
  67. <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>
  68. <tr class="separator:a215e28a5944f1159013a0e19169220e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  69. </table><table class="memberdecls">
  70. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
  71. Protected Functions</h2></td></tr>
  72. <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>
  73. <tr class="separator:a7b00514f19ad58d0bb3fd5246a67fae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  74. <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>
  75. <tr class="separator:ac7073cdd7b1a40c6cb4b5f908145f8c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  76. <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>
  77. <tr class="separator:a8e2ca6002e7bab49670144d048a2bcc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  78. <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>
  79. <tr class="separator:a0beccd41bc3841a4c5b284823bc7d2de"><td class="memSeparator" colspan="2">&#160;</td></tr>
  80. </table>
  81. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  82. <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>
  83. <div class="image">
  84. <img src="QCPBarsGroup.png" alt="QCPBarsGroup.png"/>
  85. </div>
  86. <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>
  87. <h1><a class="anchor" id="qcpbarsgroup-usage"></a>
  88. Usage</h1>
  89. <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>
  90. <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>
  91. <div class="line"> group-&gt;<a class="code" href="classQCPBarsGroup.html#a809ed63cc4ff7cd5b0b8c96b470163d3">append</a>(bars1);</div>
  92. <div class="line"> group-&gt;<a class="code" href="classQCPBarsGroup.html#a809ed63cc4ff7cd5b0b8c96b470163d3">append</a>(bars2);</div>
  93. </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>
  94. <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>
  95. <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>
  96. <p>To clear the entire group, call <a class="el" href="classQCPBarsGroup.html#a3ddf23928c6cd89530bd34ab7ba7b177">clear</a>, or simply delete the group.</p>
  97. <h1><a class="anchor" id="qcpbarsgroup-example"></a>
  98. Example</h1>
  99. <p>The image above is generated with the following code: </p>
  100. <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>
  101. <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>
  102. <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>
  103. <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>
  104. <div class="line"> </div>
  105. <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>
  106. <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>
  107. <div class="line"> customPlot-&gt;addPlottable(bars);</div>
  108. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#aa3435aab19e0a49e4e7b41bd36a8d96b">setData</a>(datax, datay1);</div>
  109. <div class="line"> bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#a7a4b92144dca6453a1f0f210e27edc74">setBrush</a>(QColor(0, 0, 255, 50));</div>
  110. <div class="line"> bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#ab74b09ae4c0e7e13142fe4b5bf46cac7">setPen</a>(QColor(0, 0, 255));</div>
  111. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#afec6116579d44d5b706e0fa5e5332507">setWidth</a>(0.15);</div>
  112. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">setBarsGroup</a>(group1);</div>
  113. <div class="line"> bars = <span class="keyword">new</span> <a class="code" href="classQCPBars.html">QCPBars</a>(customPlot-&gt;xAxis, customPlot-&gt;yAxis);</div>
  114. <div class="line"> customPlot-&gt;addPlottable(bars);</div>
  115. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#aa3435aab19e0a49e4e7b41bd36a8d96b">setData</a>(datax, datay2);</div>
  116. <div class="line"> bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#a7a4b92144dca6453a1f0f210e27edc74">setBrush</a>(QColor(180, 00, 120, 50));</div>
  117. <div class="line"> bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#ab74b09ae4c0e7e13142fe4b5bf46cac7">setPen</a>(QColor(180, 00, 120));</div>
  118. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#afec6116579d44d5b706e0fa5e5332507">setWidth</a>(0.15);</div>
  119. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">setBarsGroup</a>(group1);</div>
  120. <div class="line"> bars = <span class="keyword">new</span> <a class="code" href="classQCPBars.html">QCPBars</a>(customPlot-&gt;xAxis, customPlot-&gt;yAxis);</div>
  121. <div class="line"> customPlot-&gt;addPlottable(bars);</div>
  122. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#aa3435aab19e0a49e4e7b41bd36a8d96b">setData</a>(datax, datay3);</div>
  123. <div class="line"> bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#a7a4b92144dca6453a1f0f210e27edc74">setBrush</a>(QColor(255, 154, 0, 50));</div>
  124. <div class="line"> bars-&gt;<a class="code" href="classQCPAbstractPlottable.html#ab74b09ae4c0e7e13142fe4b5bf46cac7">setPen</a>(QColor(255, 154, 0));</div>
  125. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#afec6116579d44d5b706e0fa5e5332507">setWidth</a>(0.15);</div>
  126. <div class="line"> bars-&gt;<a class="code" href="classQCPBars.html#aedd1709061f0b307c47ddb45e172ef9a">setBarsGroup</a>(group1);</div>
  127. <div class="line"></div>
  128. <div class="line"> customPlot-&gt;xAxis-&gt;setRange(0.1, 4.9);</div>
  129. <div class="line"> customPlot-&gt;yAxis-&gt;setRange(0, 0.7);</div>
  130. <div class="line"> customPlot-&gt;xAxis-&gt;setAutoTickStep(<span class="keyword">false</span>);</div>
  131. <div class="line"> customPlot-&gt;xAxis-&gt;setTickStep(1);</div>
  132. </div><!-- fragment --></div><h2 class="groupheader">Member Enumeration Documentation</h2>
  133. <a class="anchor" id="a4c0521120a97e60bbca37677a37075b6"></a>
  134. <div class="memitem">
  135. <div class="memproto">
  136. <table class="memname">
  137. <tr>
  138. <td class="memname">enum <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">QCPBarsGroup::SpacingType</a></td>
  139. </tr>
  140. </table>
  141. </div><div class="memdoc">
  142. <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>
  143. <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>
  144. <table class="fieldtable">
  145. <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">
  146. <p>Bar spacing is in absolute pixels. </p>
  147. </td></tr>
  148. <tr><td class="fieldname"><em><a class="anchor" id="a4c0521120a97e60bbca37677a37075b6ae94b05c27bc985dcdd8b1e1b7f163d26"></a>stAxisRectRatio</em>&#160;</td><td class="fielddoc">
  149. <p>Bar spacing is given by a fraction of the axis rect size. </p>
  150. </td></tr>
  151. <tr><td class="fieldname"><em><a class="anchor" id="a4c0521120a97e60bbca37677a37075b6ad369cee6287e0a86e8c2b643a3168c54"></a>stPlotCoords</em>&#160;</td><td class="fielddoc">
  152. <p>Bar spacing is in key coordinates and thus scales with the key axis range. </p>
  153. </td></tr>
  154. </table>
  155. </div>
  156. </div>
  157. <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  158. <a class="anchor" id="aa4e043b9a22c6c5ea0f93740aca063e1"></a>
  159. <div class="memitem">
  160. <div class="memproto">
  161. <table class="memname">
  162. <tr>
  163. <td class="memname">QCPBarsGroup::QCPBarsGroup </td>
  164. <td>(</td>
  165. <td class="paramtype"><a class="el" href="classQCustomPlot.html">QCustomPlot</a> *&#160;</td>
  166. <td class="paramname"><em>parentPlot</em></td><td>)</td>
  167. <td></td>
  168. </tr>
  169. </table>
  170. </div><div class="memdoc">
  171. <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>
  172. </div>
  173. </div>
  174. <h2 class="groupheader">Member Function Documentation</h2>
  175. <a class="anchor" id="a2c7e2d61b10594a4555b615e1fcaf49e"></a>
  176. <div class="memitem">
  177. <div class="memproto">
  178. <table class="memname">
  179. <tr>
  180. <td class="memname">void QCPBarsGroup::setSpacingType </td>
  181. <td>(</td>
  182. <td class="paramtype"><a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>&#160;</td>
  183. <td class="paramname"><em>spacingType</em></td><td>)</td>
  184. <td></td>
  185. </tr>
  186. </table>
  187. </div><div class="memdoc">
  188. <p>Sets how the spacing between adjacent bars is interpreted. See <a class="el" href="classQCPBarsGroup.html#a4c0521120a97e60bbca37677a37075b6">SpacingType</a>.</p>
  189. <p>The actual spacing can then be specified with <a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a>.</p>
  190. <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#aa553d327479d72a0c3dafcc724a190e2">setSpacing</a> </dd></dl>
  191. </div>
  192. </div>
  193. <a class="anchor" id="aa553d327479d72a0c3dafcc724a190e2"></a>
  194. <div class="memitem">
  195. <div class="memproto">
  196. <table class="memname">
  197. <tr>
  198. <td class="memname">void QCPBarsGroup::setSpacing </td>
  199. <td>(</td>
  200. <td class="paramtype">double&#160;</td>
  201. <td class="paramname"><em>spacing</em></td><td>)</td>
  202. <td></td>
  203. </tr>
  204. </table>
  205. </div><div class="memdoc">
  206. <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>
  207. <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a2c7e2d61b10594a4555b615e1fcaf49e">setSpacingType</a> </dd></dl>
  208. </div>
  209. </div>
  210. <a class="anchor" id="a7c72ed1f8cd962c93b8c42ab96cd91ec"></a>
  211. <div class="memitem">
  212. <div class="memproto">
  213. <table class="mlabels">
  214. <tr>
  215. <td class="mlabels-left">
  216. <table class="memname">
  217. <tr>
  218. <td class="memname">QList&lt; <a class="el" href="classQCPBars.html">QCPBars</a> * &gt; QCPBarsGroup::bars </td>
  219. <td>(</td>
  220. <td class="paramname"></td><td>)</td>
  221. <td> const</td>
  222. </tr>
  223. </table>
  224. </td>
  225. <td class="mlabels-right">
  226. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  227. </tr>
  228. </table>
  229. </div><div class="memdoc">
  230. <p>Returns all bars currently in this group.</p>
  231. <dl class="section see"><dt>See Also</dt><dd>bars(int index) </dd></dl>
  232. </div>
  233. </div>
  234. <a class="anchor" id="a72d022790b7c93151c95c28eefaf51b4"></a>
  235. <div class="memitem">
  236. <div class="memproto">
  237. <table class="memname">
  238. <tr>
  239. <td class="memname"><a class="el" href="classQCPBars.html">QCPBars</a> * QCPBarsGroup::bars </td>
  240. <td>(</td>
  241. <td class="paramtype">int&#160;</td>
  242. <td class="paramname"><em>index</em></td><td>)</td>
  243. <td> const</td>
  244. </tr>
  245. </table>
  246. </div><div class="memdoc">
  247. <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>
  248. <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>
  249. </div>
  250. </div>
  251. <a class="anchor" id="af07364189c5717a158ec95b609687532"></a>
  252. <div class="memitem">
  253. <div class="memproto">
  254. <table class="mlabels">
  255. <tr>
  256. <td class="mlabels-left">
  257. <table class="memname">
  258. <tr>
  259. <td class="memname">int QCPBarsGroup::size </td>
  260. <td>(</td>
  261. <td class="paramname"></td><td>)</td>
  262. <td> const</td>
  263. </tr>
  264. </table>
  265. </td>
  266. <td class="mlabels-right">
  267. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  268. </tr>
  269. </table>
  270. </div><div class="memdoc">
  271. <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>
  272. </div>
  273. </div>
  274. <a class="anchor" id="a1d89da4e9176f4f77105e9a4afd44e2b"></a>
  275. <div class="memitem">
  276. <div class="memproto">
  277. <table class="mlabels">
  278. <tr>
  279. <td class="mlabels-left">
  280. <table class="memname">
  281. <tr>
  282. <td class="memname">bool QCPBarsGroup::isEmpty </td>
  283. <td>(</td>
  284. <td class="paramname"></td><td>)</td>
  285. <td> const</td>
  286. </tr>
  287. </table>
  288. </td>
  289. <td class="mlabels-right">
  290. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  291. </tr>
  292. </table>
  293. </div><div class="memdoc">
  294. <p>Returns whether this bars group is empty.</p>
  295. <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#af07364189c5717a158ec95b609687532">size</a> </dd></dl>
  296. </div>
  297. </div>
  298. <a class="anchor" id="a3ddf23928c6cd89530bd34ab7ba7b177"></a>
  299. <div class="memitem">
  300. <div class="memproto">
  301. <table class="memname">
  302. <tr>
  303. <td class="memname">void QCPBarsGroup::clear </td>
  304. <td>(</td>
  305. <td class="paramname"></td><td>)</td>
  306. <td></td>
  307. </tr>
  308. </table>
  309. </div><div class="memdoc">
  310. <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>
  311. <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a1d89da4e9176f4f77105e9a4afd44e2b">isEmpty</a> </dd></dl>
  312. </div>
  313. </div>
  314. <a class="anchor" id="adb4837894167e629e42e200db056fac3"></a>
  315. <div class="memitem">
  316. <div class="memproto">
  317. <table class="mlabels">
  318. <tr>
  319. <td class="mlabels-left">
  320. <table class="memname">
  321. <tr>
  322. <td class="memname">bool QCPBarsGroup::contains </td>
  323. <td>(</td>
  324. <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  325. <td class="paramname"><em>bars</em></td><td>)</td>
  326. <td> const</td>
  327. </tr>
  328. </table>
  329. </td>
  330. <td class="mlabels-right">
  331. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  332. </tr>
  333. </table>
  334. </div><div class="memdoc">
  335. <p>Returns whether the specified <em>bars</em> plottable is part of this group. </p>
  336. </div>
  337. </div>
  338. <a class="anchor" id="a809ed63cc4ff7cd5b0b8c96b470163d3"></a>
  339. <div class="memitem">
  340. <div class="memproto">
  341. <table class="memname">
  342. <tr>
  343. <td class="memname">void QCPBarsGroup::append </td>
  344. <td>(</td>
  345. <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  346. <td class="paramname"><em>bars</em></td><td>)</td>
  347. <td></td>
  348. </tr>
  349. </table>
  350. </div><div class="memdoc">
  351. <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>
  352. <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>
  353. </div>
  354. </div>
  355. <a class="anchor" id="a309a5f7233db189f3ea9c2d04ece6c13"></a>
  356. <div class="memitem">
  357. <div class="memproto">
  358. <table class="memname">
  359. <tr>
  360. <td class="memname">void QCPBarsGroup::insert </td>
  361. <td>(</td>
  362. <td class="paramtype">int&#160;</td>
  363. <td class="paramname"><em>i</em>, </td>
  364. </tr>
  365. <tr>
  366. <td class="paramkey"></td>
  367. <td></td>
  368. <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  369. <td class="paramname"><em>bars</em>&#160;</td>
  370. </tr>
  371. <tr>
  372. <td></td>
  373. <td>)</td>
  374. <td></td><td></td>
  375. </tr>
  376. </table>
  377. </div><div class="memdoc">
  378. <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>
  379. <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>
  380. <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>
  381. </div>
  382. </div>
  383. <a class="anchor" id="a215e28a5944f1159013a0e19169220e7"></a>
  384. <div class="memitem">
  385. <div class="memproto">
  386. <table class="memname">
  387. <tr>
  388. <td class="memname">void QCPBarsGroup::remove </td>
  389. <td>(</td>
  390. <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  391. <td class="paramname"><em>bars</em></td><td>)</td>
  392. <td></td>
  393. </tr>
  394. </table>
  395. </div><div class="memdoc">
  396. <p>Removes the specified <em>bars</em> plottable from this group.</p>
  397. <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>
  398. </div>
  399. </div>
  400. <a class="anchor" id="a7b00514f19ad58d0bb3fd5246a67fae2"></a>
  401. <div class="memitem">
  402. <div class="memproto">
  403. <table class="mlabels">
  404. <tr>
  405. <td class="mlabels-left">
  406. <table class="memname">
  407. <tr>
  408. <td class="memname">void QCPBarsGroup::registerBars </td>
  409. <td>(</td>
  410. <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  411. <td class="paramname"><em>bars</em></td><td>)</td>
  412. <td></td>
  413. </tr>
  414. </table>
  415. </td>
  416. <td class="mlabels-right">
  417. <span class="mlabels"><span class="mlabel">protected</span></span> </td>
  418. </tr>
  419. </table>
  420. </div><div class="memdoc">
  421. <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>
  422. <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#ac7073cdd7b1a40c6cb4b5f908145f8c4">unregisterBars</a> </dd></dl>
  423. </div>
  424. </div>
  425. <a class="anchor" id="ac7073cdd7b1a40c6cb4b5f908145f8c4"></a>
  426. <div class="memitem">
  427. <div class="memproto">
  428. <table class="mlabels">
  429. <tr>
  430. <td class="mlabels-left">
  431. <table class="memname">
  432. <tr>
  433. <td class="memname">void QCPBarsGroup::unregisterBars </td>
  434. <td>(</td>
  435. <td class="paramtype"><a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  436. <td class="paramname"><em>bars</em></td><td>)</td>
  437. <td></td>
  438. </tr>
  439. </table>
  440. </td>
  441. <td class="mlabels-right">
  442. <span class="mlabels"><span class="mlabel">protected</span></span> </td>
  443. </tr>
  444. </table>
  445. </div><div class="memdoc">
  446. <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>
  447. <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classQCPBarsGroup.html#a7b00514f19ad58d0bb3fd5246a67fae2">registerBars</a> </dd></dl>
  448. </div>
  449. </div>
  450. <a class="anchor" id="a8e2ca6002e7bab49670144d048a2bcc9"></a>
  451. <div class="memitem">
  452. <div class="memproto">
  453. <table class="mlabels">
  454. <tr>
  455. <td class="mlabels-left">
  456. <table class="memname">
  457. <tr>
  458. <td class="memname">double QCPBarsGroup::keyPixelOffset </td>
  459. <td>(</td>
  460. <td class="paramtype">const <a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  461. <td class="paramname"><em>bars</em>, </td>
  462. </tr>
  463. <tr>
  464. <td class="paramkey"></td>
  465. <td></td>
  466. <td class="paramtype">double&#160;</td>
  467. <td class="paramname"><em>keyCoord</em>&#160;</td>
  468. </tr>
  469. <tr>
  470. <td></td>
  471. <td>)</td>
  472. <td></td><td></td>
  473. </tr>
  474. </table>
  475. </td>
  476. <td class="mlabels-right">
  477. <span class="mlabels"><span class="mlabel">protected</span></span> </td>
  478. </tr>
  479. </table>
  480. </div><div class="memdoc">
  481. <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>
  482. </div>
  483. </div>
  484. <a class="anchor" id="a0beccd41bc3841a4c5b284823bc7d2de"></a>
  485. <div class="memitem">
  486. <div class="memproto">
  487. <table class="mlabels">
  488. <tr>
  489. <td class="mlabels-left">
  490. <table class="memname">
  491. <tr>
  492. <td class="memname">double QCPBarsGroup::getPixelSpacing </td>
  493. <td>(</td>
  494. <td class="paramtype">const <a class="el" href="classQCPBars.html">QCPBars</a> *&#160;</td>
  495. <td class="paramname"><em>bars</em>, </td>
  496. </tr>
  497. <tr>
  498. <td class="paramkey"></td>
  499. <td></td>
  500. <td class="paramtype">double&#160;</td>
  501. <td class="paramname"><em>keyCoord</em>&#160;</td>
  502. </tr>
  503. <tr>
  504. <td></td>
  505. <td>)</td>
  506. <td></td><td></td>
  507. </tr>
  508. </table>
  509. </td>
  510. <td class="mlabels-right">
  511. <span class="mlabels"><span class="mlabel">protected</span></span> </td>
  512. </tr>
  513. </table>
  514. </div><div class="memdoc">
  515. <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>
  516. <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>
  517. </div>
  518. </div>
  519. <hr/>The documentation for this class was generated from the following files:<ul>
  520. <li>src/plottables/<a class="el" href="plottable-bars_8h.html">plottable-bars.h</a></li>
  521. <li>src/plottables/plottable-bars.cpp</li>
  522. </ul>
  523. </div><!-- contents -->
  524. </body>
  525. </html>