QwtPlotMultiBarChart.3 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. .TH "QwtPlotMultiBarChart" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtPlotMultiBarChart \- \fBQwtPlotMultiBarChart\fP displays a series of a samples that consist each of a set of values\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_plot_multi_barchart\&.h>\fP
  11. .PP
  12. Inherits \fBQwtPlotAbstractBarChart\fP, and \fBQwtSeriesStore< QwtSetSample >\fP\&.
  13. .SS "Public Types"
  14. .in +1c
  15. .ti -1c
  16. .RI "enum \fBChartStyle\fP { \fBGrouped\fP, \fBStacked\fP }"
  17. .br
  18. .RI "Chart styles\&. "
  19. .in -1c
  20. .SS "Public Member Functions"
  21. .in +1c
  22. .ti -1c
  23. .RI "\fBQwtPlotMultiBarChart\fP (const QString &\fBtitle\fP=QString())"
  24. .br
  25. .ti -1c
  26. .RI "\fBQwtPlotMultiBarChart\fP (const \fBQwtText\fP &\fBtitle\fP)"
  27. .br
  28. .ti -1c
  29. .RI "virtual \fB~QwtPlotMultiBarChart\fP ()"
  30. .br
  31. .RI "Destructor\&. "
  32. .ti -1c
  33. .RI "virtual int \fBrtti\fP () const"
  34. .br
  35. .ti -1c
  36. .RI "void \fBsetBarTitles\fP (const QList< \fBQwtText\fP > &)"
  37. .br
  38. .RI "Set the titles for the bars\&. "
  39. .ti -1c
  40. .RI "QList< \fBQwtText\fP > \fBbarTitles\fP () const"
  41. .br
  42. .ti -1c
  43. .RI "void \fBsetSamples\fP (const QVector< \fBQwtSetSample\fP > &)"
  44. .br
  45. .ti -1c
  46. .RI "void \fBsetSamples\fP (const QVector< QVector< double > > &)"
  47. .br
  48. .ti -1c
  49. .RI "void \fBsetSamples\fP (\fBQwtSeriesData\fP< \fBQwtSetSample\fP > *)"
  50. .br
  51. .ti -1c
  52. .RI "void \fBsetStyle\fP (\fBChartStyle\fP \fBstyle\fP)"
  53. .br
  54. .ti -1c
  55. .RI "\fBChartStyle\fP \fBstyle\fP () const"
  56. .br
  57. .ti -1c
  58. .RI "void \fBsetSymbol\fP (int valueIndex, \fBQwtColumnSymbol\fP *)"
  59. .br
  60. .RI "Add a symbol to the symbol map\&. "
  61. .ti -1c
  62. .RI "const \fBQwtColumnSymbol\fP * \fBsymbol\fP (int valueIndex) const"
  63. .br
  64. .ti -1c
  65. .RI "void \fBresetSymbolMap\fP ()"
  66. .br
  67. .ti -1c
  68. .RI "virtual void \fBdrawSeries\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, int from, int to) const"
  69. .br
  70. .ti -1c
  71. .RI "virtual QRectF \fBboundingRect\fP () const"
  72. .br
  73. .ti -1c
  74. .RI "virtual QList< \fBQwtLegendData\fP > \fBlegendData\fP () const"
  75. .br
  76. .ti -1c
  77. .RI "virtual \fBQwtGraphic\fP \fBlegendIcon\fP (int index, const QSizeF &) const"
  78. .br
  79. .in -1c
  80. .SS "Protected Member Functions"
  81. .in +1c
  82. .ti -1c
  83. .RI "\fBQwtColumnSymbol\fP * \fBsymbol\fP (int valueIndex)"
  84. .br
  85. .ti -1c
  86. .RI "virtual \fBQwtColumnSymbol\fP * \fBspecialSymbol\fP (int sampleIndex, int valueIndex) const"
  87. .br
  88. .RI "Create a symbol for special values\&. "
  89. .ti -1c
  90. .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 \fBQwtSetSample\fP &\fBsample\fP) const"
  91. .br
  92. .ti -1c
  93. .RI "virtual void \fBdrawBar\fP (QPainter *, int sampleIndex, int valueIndex, const \fBQwtColumnRect\fP &) const"
  94. .br
  95. .ti -1c
  96. .RI "void \fBdrawStackedBars\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, int index, double \fBsampleWidth\fP, const \fBQwtSetSample\fP &\fBsample\fP) const"
  97. .br
  98. .ti -1c
  99. .RI "void \fBdrawGroupedBars\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect, int index, double \fBsampleWidth\fP, const \fBQwtSetSample\fP &\fBsample\fP) const"
  100. .br
  101. .in -1c
  102. .SH "Detailed Description"
  103. .PP
  104. \fBQwtPlotMultiBarChart\fP displays a series of a samples that consist each of a set of values\&.
  105. Each value is displayed as a bar, the bars of each set can be organized side by side or accumulated\&.
  106. .PP
  107. Each bar of a set is rendered by a \fBQwtColumnSymbol\fP, that is set by \fBsetSymbol()\fP\&. The bars of different sets use the same symbols\&. Exceptions are possible by overloading \fBspecialSymbol()\fP or overloading \fBdrawBar()\fP\&.
  108. .PP
  109. Depending on its \fBorientation()\fP the bars are displayed horizontally or vertically\&. The bars cover the interval between the \fBbaseline()\fP and the value\&.
  110. .PP
  111. In opposite to most other plot items, \fBQwtPlotMultiBarChart\fP returns more than one entry for the legend - one for each symbol\&.
  112. .PP
  113. \fBSee also\fP
  114. .RS 4
  115. \fBQwtPlotBarChart\fP, \fBQwtPlotHistogram\fP \fBQwtPlotSeriesItem::orientation()\fP, \fBQwtPlotAbstractBarChart::baseline()\fP
  116. .RE
  117. .PP
  118. .SH "Member Enumeration Documentation"
  119. .PP
  120. .SS "enum \fBQwtPlotMultiBarChart::ChartStyle\fP"
  121. .PP
  122. Chart styles\&. The default setting is \fBQwtPlotMultiBarChart::Grouped\fP\&.
  123. .PP
  124. \fBSee also\fP
  125. .RS 4
  126. \fBsetStyle()\fP, \fBstyle()\fP
  127. .RE
  128. .PP
  129. .PP
  130. \fBEnumerator\fP
  131. .in +1c
  132. .TP
  133. \fB\fIGrouped \fP\fP
  134. The bars of a set are displayed side by side\&.
  135. .TP
  136. \fB\fIStacked \fP\fP
  137. The bars are displayed on top of each other accumulating to a single bar\&. All values of a set need to have the same sign\&.
  138. .SH "Constructor & Destructor Documentation"
  139. .PP
  140. .SS "QwtPlotMultiBarChart::QwtPlotMultiBarChart (const QString & title = \fCQString()\fP)\fC [explicit]\fP"
  141. Constructor
  142. .PP
  143. \fBParameters\fP
  144. .RS 4
  145. \fItitle\fP Title of the chart
  146. .RE
  147. .PP
  148. .SS "QwtPlotMultiBarChart::QwtPlotMultiBarChart (const \fBQwtText\fP & title)\fC [explicit]\fP"
  149. Constructor
  150. .PP
  151. \fBParameters\fP
  152. .RS 4
  153. \fItitle\fP Title of the chart
  154. .RE
  155. .PP
  156. .SH "Member Function Documentation"
  157. .PP
  158. .SS "QList< \fBQwtText\fP > QwtPlotMultiBarChart::barTitles () const"
  159. .PP
  160. \fBReturns\fP
  161. .RS 4
  162. Bar titles
  163. .RE
  164. .PP
  165. \fBSee also\fP
  166. .RS 4
  167. \fBsetBarTitles()\fP, \fBlegendData()\fP
  168. .RE
  169. .PP
  170. .SS "QRectF QwtPlotMultiBarChart::boundingRect () const\fC [virtual]\fP"
  171. .PP
  172. \fBReturns\fP
  173. .RS 4
  174. Bounding rectangle of all samples\&. For an empty series the rectangle is invalid\&.
  175. .RE
  176. .PP
  177. .PP
  178. Reimplemented from \fBQwtPlotSeriesItem\fP\&.
  179. .SS "void QwtPlotMultiBarChart::drawBar (QPainter * painter, int sampleIndex, int valueIndex, const \fBQwtColumnRect\fP & rect) const\fC [protected]\fP, \fC [virtual]\fP"
  180. Draw a bar
  181. .PP
  182. \fBParameters\fP
  183. .RS 4
  184. \fIpainter\fP Painter
  185. .br
  186. \fIsampleIndex\fP Index of the sample - might be -1 when the bar is painted for the legend
  187. .br
  188. \fIvalueIndex\fP Index of a value in a set
  189. .br
  190. \fIrect\fP Directed target rectangle for the bar
  191. .RE
  192. .PP
  193. \fBSee also\fP
  194. .RS 4
  195. \fBdrawSeries()\fP
  196. .RE
  197. .PP
  198. .SS "void QwtPlotMultiBarChart::drawGroupedBars (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect, int index, double sampleWidth, const \fBQwtSetSample\fP & sample) const\fC [protected]\fP"
  199. Draw a grouped sample
  200. .PP
  201. \fBParameters\fP
  202. .RS 4
  203. \fIpainter\fP Painter
  204. .br
  205. \fIxMap\fP x map
  206. .br
  207. \fIyMap\fP y map
  208. .br
  209. \fIcanvasRect\fP Contents rectangle of the canvas
  210. .br
  211. \fIindex\fP Index of the sample to be painted
  212. .br
  213. \fIsampleWidth\fP Boundng width for all bars of the smaple
  214. .br
  215. \fIsample\fP Sample
  216. .RE
  217. .PP
  218. \fBSee also\fP
  219. .RS 4
  220. \fBdrawSeries()\fP, \fBsampleWidth()\fP
  221. .RE
  222. .PP
  223. .SS "void QwtPlotMultiBarChart::drawSample (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect, const \fBQwtInterval\fP & boundingInterval, int index, const \fBQwtSetSample\fP & sample) const\fC [protected]\fP, \fC [virtual]\fP"
  224. Draw a sample
  225. .PP
  226. \fBParameters\fP
  227. .RS 4
  228. \fIpainter\fP Painter
  229. .br
  230. \fIxMap\fP x map
  231. .br
  232. \fIyMap\fP y map
  233. .br
  234. \fIcanvasRect\fP Contents rectangle of the canvas
  235. .br
  236. \fIboundingInterval\fP Bounding interval of sample values
  237. .br
  238. \fIindex\fP Index of the sample to be painted
  239. .br
  240. \fIsample\fP Sample value
  241. .RE
  242. .PP
  243. \fBSee also\fP
  244. .RS 4
  245. \fBdrawSeries()\fP
  246. .RE
  247. .PP
  248. .SS "void QwtPlotMultiBarChart::drawSeries (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect, int from, int to) const\fC [virtual]\fP"
  249. Draw an interval of the bar chart
  250. .PP
  251. \fBParameters\fP
  252. .RS 4
  253. \fIpainter\fP Painter
  254. .br
  255. \fIxMap\fP Maps x-values into pixel coordinates\&.
  256. .br
  257. \fIyMap\fP Maps y-values into pixel coordinates\&.
  258. .br
  259. \fIcanvasRect\fP Contents rectangle of the canvas
  260. .br
  261. \fIfrom\fP Index of the first point to be painted
  262. .br
  263. \fIto\fP Index of the last point to be painted\&. If to < 0 the curve will be painted to its last point\&.
  264. .RE
  265. .PP
  266. \fBSee also\fP
  267. .RS 4
  268. drawSymbols()
  269. .RE
  270. .PP
  271. .PP
  272. Implements \fBQwtPlotSeriesItem\fP\&.
  273. .SS "void QwtPlotMultiBarChart::drawStackedBars (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRectF & canvasRect, int index, double sampleWidth, const \fBQwtSetSample\fP & sample) const\fC [protected]\fP"
  274. Draw a stacked sample
  275. .PP
  276. \fBParameters\fP
  277. .RS 4
  278. \fIpainter\fP Painter
  279. .br
  280. \fIxMap\fP x map
  281. .br
  282. \fIyMap\fP y map
  283. .br
  284. \fIcanvasRect\fP Contents rectangle of the canvas
  285. .br
  286. \fIindex\fP Index of the sample to be painted
  287. .br
  288. \fIsampleWidth\fP Width of the bars
  289. .br
  290. \fIsample\fP Sample
  291. .RE
  292. .PP
  293. \fBSee also\fP
  294. .RS 4
  295. \fBdrawSeries()\fP, \fBsampleWidth()\fP
  296. .RE
  297. .PP
  298. .SS "QList< \fBQwtLegendData\fP > QwtPlotMultiBarChart::legendData () const\fC [virtual]\fP"
  299. .PP
  300. \fBReturns\fP
  301. .RS 4
  302. Information to be displayed on the legend
  303. .RE
  304. .PP
  305. The chart is represented by a list of entries - one for each bar title\&. Each element contains a bar title and an icon showing its corresponding bar\&.
  306. .PP
  307. \fBSee also\fP
  308. .RS 4
  309. \fBbarTitles()\fP, \fBlegendIcon()\fP, \fBlegendIconSize()\fP
  310. .RE
  311. .PP
  312. .PP
  313. Reimplemented from \fBQwtPlotItem\fP\&.
  314. .SS "\fBQwtGraphic\fP QwtPlotMultiBarChart::legendIcon (int index, const QSizeF & size) const\fC [virtual]\fP"
  315. .PP
  316. \fBReturns\fP
  317. .RS 4
  318. Icon for representing a bar on the legend
  319. .RE
  320. .PP
  321. \fBParameters\fP
  322. .RS 4
  323. \fIindex\fP Index of the bar
  324. .br
  325. \fIsize\fP Icon size
  326. .RE
  327. .PP
  328. \fBReturns\fP
  329. .RS 4
  330. An icon showing a bar
  331. .RE
  332. .PP
  333. \fBSee also\fP
  334. .RS 4
  335. \fBdrawBar()\fP, \fBlegendData()\fP
  336. .RE
  337. .PP
  338. .PP
  339. Reimplemented from \fBQwtPlotItem\fP\&.
  340. .SS "void QwtPlotMultiBarChart::resetSymbolMap ()"
  341. Remove all symbols from the symbol map
  342. .SS "int QwtPlotMultiBarChart::rtti () const\fC [virtual]\fP"
  343. .PP
  344. \fBReturns\fP
  345. .RS 4
  346. \fBQwtPlotItem::Rtti_PlotBarChart\fP
  347. .RE
  348. .PP
  349. .PP
  350. Reimplemented from \fBQwtPlotItem\fP\&.
  351. .SS "void QwtPlotMultiBarChart::setBarTitles (const QList< \fBQwtText\fP > & titles)"
  352. .PP
  353. Set the titles for the bars\&. The titles are used for the legend\&.
  354. .PP
  355. \fBParameters\fP
  356. .RS 4
  357. \fItitles\fP Bar titles
  358. .RE
  359. .PP
  360. \fBSee also\fP
  361. .RS 4
  362. \fBbarTitles()\fP, \fBlegendData()\fP
  363. .RE
  364. .PP
  365. .SS "void QwtPlotMultiBarChart::setSamples (const QVector< QVector< double > > & samples)"
  366. Initialize data with an array of samples\&.
  367. .PP
  368. \fBParameters\fP
  369. .RS 4
  370. \fIsamples\fP Vector of points
  371. .RE
  372. .PP
  373. .SS "void QwtPlotMultiBarChart::setSamples (const QVector< \fBQwtSetSample\fP > & samples)"
  374. Initialize data with an array of samples\&.
  375. .PP
  376. \fBParameters\fP
  377. .RS 4
  378. \fIsamples\fP Vector of points
  379. .RE
  380. .PP
  381. .SS "void QwtPlotMultiBarChart::setSamples (\fBQwtSeriesData\fP< \fBQwtSetSample\fP > * data)"
  382. Assign a series of samples
  383. .PP
  384. \fBsetSamples()\fP is just a wrapper for \fBsetData()\fP without any additional value - beside that it is easier to find for the developer\&.
  385. .PP
  386. \fBParameters\fP
  387. .RS 4
  388. \fIdata\fP Data
  389. .RE
  390. .PP
  391. \fBWarning\fP
  392. .RS 4
  393. The item takes ownership of the data object, deleting it when its not used anymore\&.
  394. .RE
  395. .PP
  396. .SS "void QwtPlotMultiBarChart::setStyle (\fBChartStyle\fP style)"
  397. Set the style of the chart
  398. .PP
  399. \fBParameters\fP
  400. .RS 4
  401. \fIstyle\fP Chart style
  402. .RE
  403. .PP
  404. \fBSee also\fP
  405. .RS 4
  406. \fBstyle()\fP
  407. .RE
  408. .PP
  409. .SS "void QwtPlotMultiBarChart::setSymbol (int valueIndex, \fBQwtColumnSymbol\fP * symbol)"
  410. .PP
  411. Add a symbol to the symbol map\&. Assign a default symbol for drawing the bar representing all values with the same index in a set\&.
  412. .PP
  413. \fBParameters\fP
  414. .RS 4
  415. \fIvalueIndex\fP Index of a value in a set
  416. .br
  417. \fIsymbol\fP Symbol used for drawing a bar
  418. .RE
  419. .PP
  420. \fBSee also\fP
  421. .RS 4
  422. \fBsymbol()\fP, \fBresetSymbolMap()\fP, \fBspecialSymbol()\fP
  423. .RE
  424. .PP
  425. .SS "\fBQwtColumnSymbol\fP * QwtPlotMultiBarChart::specialSymbol (int sampleIndex, int valueIndex) const\fC [protected]\fP, \fC [virtual]\fP"
  426. .PP
  427. Create a symbol for special values\&. Usually the symbols for displaying a bar are set by setSymbols() and common for all sets\&. By overloading \fBspecialSymbol()\fP it is possible to create a temporary \fBsymbol()\fP for displaying a special value\&.
  428. .PP
  429. The symbol has to be created by new each time \fBspecialSymbol()\fP is called\&. As soon as the symbol is painted this symbol gets deleted\&.
  430. .PP
  431. When no symbol ( NULL ) is returned, the value will be displayed with the standard symbol that is used for all symbols with the same valueIndex\&.
  432. .PP
  433. \fBParameters\fP
  434. .RS 4
  435. \fIsampleIndex\fP Index of the sample
  436. .br
  437. \fIvalueIndex\fP Index of the value in the set
  438. .RE
  439. .PP
  440. \fBReturns\fP
  441. .RS 4
  442. NULL, meaning that the value is not special
  443. .RE
  444. .PP
  445. .SS "\fBQwtPlotMultiBarChart::ChartStyle\fP QwtPlotMultiBarChart::style () const"
  446. .PP
  447. \fBReturns\fP
  448. .RS 4
  449. Style of the chart
  450. .RE
  451. .PP
  452. \fBSee also\fP
  453. .RS 4
  454. \fBsetStyle()\fP
  455. .RE
  456. .PP
  457. .SS "\fBQwtColumnSymbol\fP * QwtPlotMultiBarChart::symbol (int valueIndex)\fC [protected]\fP"
  458. Find a symbol in the symbol map
  459. .PP
  460. \fBParameters\fP
  461. .RS 4
  462. \fIvalueIndex\fP Index of a value in a set
  463. .RE
  464. .PP
  465. \fBReturns\fP
  466. .RS 4
  467. The symbol, that had been set by \fBsetSymbol()\fP or NULL\&.
  468. .RE
  469. .PP
  470. \fBSee also\fP
  471. .RS 4
  472. \fBsetSymbol()\fP, \fBspecialSymbol()\fP, \fBdrawBar()\fP
  473. .RE
  474. .PP
  475. .SS "const \fBQwtColumnSymbol\fP * QwtPlotMultiBarChart::symbol (int valueIndex) const"
  476. Find a symbol in the symbol map
  477. .PP
  478. \fBParameters\fP
  479. .RS 4
  480. \fIvalueIndex\fP Index of a value in a set
  481. .RE
  482. .PP
  483. \fBReturns\fP
  484. .RS 4
  485. The symbol, that had been set by \fBsetSymbol()\fP or NULL\&.
  486. .RE
  487. .PP
  488. \fBSee also\fP
  489. .RS 4
  490. \fBsetSymbol()\fP, \fBspecialSymbol()\fP, \fBdrawBar()\fP
  491. .RE
  492. .PP
  493. .SH "Author"
  494. .PP
  495. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.