reportbuilder 1.2.5 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (392) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +6 -0
  3. data/Manifest.txt +377 -0
  4. data/data/flot/API.txt +1024 -0
  5. data/data/flot/FAQ.txt +71 -0
  6. data/data/flot/LICENSE.txt +22 -0
  7. data/data/flot/Makefile +15 -0
  8. data/data/flot/NEWS.txt +340 -0
  9. data/data/flot/PLUGINS.txt +105 -0
  10. data/data/flot/README.txt +81 -0
  11. data/data/flot/examples/ajax.html +143 -0
  12. data/data/flot/examples/annotating.html +75 -0
  13. data/data/flot/examples/arrow-down.gif +0 -0
  14. data/data/flot/examples/arrow-left.gif +0 -0
  15. data/data/flot/examples/arrow-right.gif +0 -0
  16. data/data/flot/examples/arrow-up.gif +0 -0
  17. data/data/flot/examples/basic.html +38 -0
  18. data/data/flot/examples/data-eu-gdp-growth-1.json +4 -0
  19. data/data/flot/examples/data-eu-gdp-growth-2.json +4 -0
  20. data/data/flot/examples/data-eu-gdp-growth-3.json +4 -0
  21. data/data/flot/examples/data-eu-gdp-growth-4.json +4 -0
  22. data/data/flot/examples/data-eu-gdp-growth-5.json +4 -0
  23. data/data/flot/examples/data-eu-gdp-growth.json +4 -0
  24. data/data/flot/examples/data-japan-gdp-growth.json +4 -0
  25. data/data/flot/examples/data-usa-gdp-growth.json +4 -0
  26. data/data/flot/examples/dual-axis.html +39 -0
  27. data/data/flot/examples/graph-types.html +75 -0
  28. data/data/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
  29. data/data/flot/examples/image.html +45 -0
  30. data/data/flot/examples/index.html +43 -0
  31. data/data/flot/examples/interacting.html +93 -0
  32. data/data/flot/examples/layout.css +6 -0
  33. data/data/flot/examples/navigate.html +118 -0
  34. data/data/flot/examples/selection.html +114 -0
  35. data/data/flot/examples/setting-options.html +65 -0
  36. data/data/flot/examples/stacking.html +77 -0
  37. data/data/flot/examples/thresholding.html +54 -0
  38. data/data/flot/examples/time.html +71 -0
  39. data/data/flot/examples/tracking.html +95 -0
  40. data/data/flot/examples/turning-series.html +98 -0
  41. data/data/flot/examples/visitors.html +90 -0
  42. data/data/flot/examples/zooming.html +98 -0
  43. data/data/flot/excanvas.js +1427 -0
  44. data/data/flot/excanvas.min.js +1 -0
  45. data/data/flot/jquery.colorhelpers.js +174 -0
  46. data/data/flot/jquery.colorhelpers.min.js +1 -0
  47. data/data/flot/jquery.flot.crosshair.js +156 -0
  48. data/data/flot/jquery.flot.crosshair.min.js +1 -0
  49. data/data/flot/jquery.flot.image.js +237 -0
  50. data/data/flot/jquery.flot.image.min.js +1 -0
  51. data/data/flot/jquery.flot.js +2119 -0
  52. data/data/flot/jquery.flot.min.js +1 -0
  53. data/data/flot/jquery.flot.navigate.js +272 -0
  54. data/data/flot/jquery.flot.navigate.min.js +1 -0
  55. data/data/flot/jquery.flot.selection.js +299 -0
  56. data/data/flot/jquery.flot.selection.min.js +1 -0
  57. data/data/flot/jquery.flot.stack.js +152 -0
  58. data/data/flot/jquery.flot.stack.min.js +1 -0
  59. data/data/flot/jquery.flot.threshold.js +103 -0
  60. data/data/flot/jquery.flot.threshold.min.js +1 -0
  61. data/data/flot/jquery.js +4376 -0
  62. data/data/flot/jquery.min.js +19 -0
  63. data/data/jqplot/MIT-LICENSE.txt +21 -0
  64. data/data/jqplot/README.txt +73 -0
  65. data/data/jqplot/changes.txt +261 -0
  66. data/data/jqplot/copyright.txt +33 -0
  67. data/data/jqplot/docs/files/MIT-LICENSE-txt.html +39 -0
  68. data/data/jqplot/docs/files/changes-txt.html +39 -0
  69. data/data/jqplot/docs/files/gpl-2-0-txt.html +39 -0
  70. data/data/jqplot/docs/files/images/background.jpg +0 -0
  71. data/data/jqplot/docs/files/images/basicline.png +0 -0
  72. data/data/jqplot/docs/files/images/basiclogaxis.png +0 -0
  73. data/data/jqplot/docs/files/images/basiclogoptions.png +0 -0
  74. data/data/jqplot/docs/files/images/basicoptions.png +0 -0
  75. data/data/jqplot/docs/files/images/dualaxis.png +0 -0
  76. data/data/jqplot/docs/files/images/logo.jpg +0 -0
  77. data/data/jqplot/docs/files/images/navdocs.png +0 -0
  78. data/data/jqplot/docs/files/images/navdocsover.png +0 -0
  79. data/data/jqplot/docs/files/images/navdownload.png +0 -0
  80. data/data/jqplot/docs/files/images/navdownloadover.png +0 -0
  81. data/data/jqplot/docs/files/images/navexamples.png +0 -0
  82. data/data/jqplot/docs/files/images/navexamplesover.png +0 -0
  83. data/data/jqplot/docs/files/images/navhome.png +0 -0
  84. data/data/jqplot/docs/files/images/navhomeover.png +0 -0
  85. data/data/jqplot/docs/files/images/new.png +0 -0
  86. data/data/jqplot/docs/files/images/sample3.png +0 -0
  87. data/data/jqplot/docs/files/images/samplesm.png +0 -0
  88. data/data/jqplot/docs/files/jqPlotCssStyling-txt.html +39 -0
  89. data/data/jqplot/docs/files/jqPlotOptions-txt.html +292 -0
  90. data/data/jqplot/docs/files/jqplot-axisLabelRenderer-js.html +47 -0
  91. data/data/jqplot/docs/files/jqplot-axisTickRenderer-js.html +69 -0
  92. data/data/jqplot/docs/files/jqplot-canvasGridRenderer-js.html +39 -0
  93. data/data/jqplot/docs/files/jqplot-core-js.html +353 -0
  94. data/data/jqplot/docs/files/jqplot-divTitleRenderer-js.html +39 -0
  95. data/data/jqplot/docs/files/jqplot-lineRenderer-js.html +53 -0
  96. data/data/jqplot/docs/files/jqplot-linearAxisRenderer-js.html +39 -0
  97. data/data/jqplot/docs/files/jqplot-markerRenderer-js.html +65 -0
  98. data/data/jqplot/docs/files/jqplot-shadowRenderer-js.html +61 -0
  99. data/data/jqplot/docs/files/jqplot-shapeRenderer-js.html +63 -0
  100. data/data/jqplot/docs/files/jqplot-themeEngine-js.html +190 -0
  101. data/data/jqplot/docs/files/optionsTutorial-txt.html +119 -0
  102. data/data/jqplot/docs/files/plugins/jqplot-BezierCurveRenderer-js.html +45 -0
  103. data/data/jqplot/docs/files/plugins/jqplot-barRenderer-js.html +67 -0
  104. data/data/jqplot/docs/files/plugins/jqplot-blockRenderer-js.html +53 -0
  105. data/data/jqplot/docs/files/plugins/jqplot-bubbleRenderer-js.html +71 -0
  106. data/data/jqplot/docs/files/plugins/jqplot-canvasAxisLabelRenderer-js.html +63 -0
  107. data/data/jqplot/docs/files/plugins/jqplot-canvasAxisTickRenderer-js.html +79 -0
  108. data/data/jqplot/docs/files/plugins/jqplot-categoryAxisRenderer-js.html +46 -0
  109. data/data/jqplot/docs/files/plugins/jqplot-cursor-js.html +91 -0
  110. data/data/jqplot/docs/files/plugins/jqplot-dateAxisRenderer-js.html +93 -0
  111. data/data/jqplot/docs/files/plugins/jqplot-donutRenderer-js.html +98 -0
  112. data/data/jqplot/docs/files/plugins/jqplot-dragable-js.html +45 -0
  113. data/data/jqplot/docs/files/plugins/jqplot-enhancedLegendRenderer-js.html +49 -0
  114. data/data/jqplot/docs/files/plugins/jqplot-funnelRenderer-js.html +87 -0
  115. data/data/jqplot/docs/files/plugins/jqplot-highlighter-js.html +80 -0
  116. data/data/jqplot/docs/files/plugins/jqplot-logAxisRenderer-js.html +45 -0
  117. data/data/jqplot/docs/files/plugins/jqplot-mekkoAxisRenderer-js.html +49 -0
  118. data/data/jqplot/docs/files/plugins/jqplot-mekkoRenderer-js.html +62 -0
  119. data/data/jqplot/docs/files/plugins/jqplot-meterGaugeRenderer-js.html +103 -0
  120. data/data/jqplot/docs/files/plugins/jqplot-ohlcRenderer-js.html +65 -0
  121. data/data/jqplot/docs/files/plugins/jqplot-pieRenderer-js.html +93 -0
  122. data/data/jqplot/docs/files/plugins/jqplot-pointLabels-js.html +72 -0
  123. data/data/jqplot/docs/files/plugins/jqplot-trendline-js.html +67 -0
  124. data/data/jqplot/docs/files/usage-txt.html +58 -0
  125. data/data/jqplot/docs/index.html +1 -0
  126. data/data/jqplot/docs/index/Classes.html +58 -0
  127. data/data/jqplot/docs/index/Files.html +34 -0
  128. data/data/jqplot/docs/index/Functions.html +66 -0
  129. data/data/jqplot/docs/index/General.html +46 -0
  130. data/data/jqplot/docs/index/General2.html +46 -0
  131. data/data/jqplot/docs/index/General3.html +46 -0
  132. data/data/jqplot/docs/index/General4.html +50 -0
  133. data/data/jqplot/docs/index/General5.html +34 -0
  134. data/data/jqplot/docs/index/General6.html +58 -0
  135. data/data/jqplot/docs/index/Hooks.html +46 -0
  136. data/data/jqplot/docs/index/Properties.html +50 -0
  137. data/data/jqplot/docs/index/Properties2.html +50 -0
  138. data/data/jqplot/docs/index/Properties3.html +50 -0
  139. data/data/jqplot/docs/index/Properties4.html +34 -0
  140. data/data/jqplot/docs/index/Properties5.html +58 -0
  141. data/data/jqplot/docs/javascript/main.js +836 -0
  142. data/data/jqplot/docs/javascript/searchdata.js +182 -0
  143. data/data/jqplot/docs/search/ClassesA.html +20 -0
  144. data/data/jqplot/docs/search/ClassesG.html +20 -0
  145. data/data/jqplot/docs/search/ClassesJ.html +20 -0
  146. data/data/jqplot/docs/search/ClassesL.html +20 -0
  147. data/data/jqplot/docs/search/ClassesS.html +20 -0
  148. data/data/jqplot/docs/search/ClassesSymbols.html +20 -0
  149. data/data/jqplot/docs/search/ClassesT.html +20 -0
  150. data/data/jqplot/docs/search/FilesJ.html +20 -0
  151. data/data/jqplot/docs/search/FunctionsC.html +20 -0
  152. data/data/jqplot/docs/search/FunctionsD.html +20 -0
  153. data/data/jqplot/docs/search/FunctionsG.html +20 -0
  154. data/data/jqplot/docs/search/FunctionsI.html +20 -0
  155. data/data/jqplot/docs/search/FunctionsM.html +20 -0
  156. data/data/jqplot/docs/search/FunctionsN.html +20 -0
  157. data/data/jqplot/docs/search/FunctionsR.html +20 -0
  158. data/data/jqplot/docs/search/FunctionsS.html +20 -0
  159. data/data/jqplot/docs/search/FunctionsZ.html +20 -0
  160. data/data/jqplot/docs/search/GeneralA.html +20 -0
  161. data/data/jqplot/docs/search/GeneralB.html +20 -0
  162. data/data/jqplot/docs/search/GeneralC.html +20 -0
  163. data/data/jqplot/docs/search/GeneralD.html +20 -0
  164. data/data/jqplot/docs/search/GeneralE.html +20 -0
  165. data/data/jqplot/docs/search/GeneralF.html +20 -0
  166. data/data/jqplot/docs/search/GeneralG.html +20 -0
  167. data/data/jqplot/docs/search/GeneralH.html +20 -0
  168. data/data/jqplot/docs/search/GeneralI.html +20 -0
  169. data/data/jqplot/docs/search/GeneralJ.html +20 -0
  170. data/data/jqplot/docs/search/GeneralL.html +20 -0
  171. data/data/jqplot/docs/search/GeneralM.html +20 -0
  172. data/data/jqplot/docs/search/GeneralN.html +20 -0
  173. data/data/jqplot/docs/search/GeneralO.html +20 -0
  174. data/data/jqplot/docs/search/GeneralP.html +20 -0
  175. data/data/jqplot/docs/search/GeneralR.html +20 -0
  176. data/data/jqplot/docs/search/GeneralS.html +20 -0
  177. data/data/jqplot/docs/search/GeneralSymbols.html +20 -0
  178. data/data/jqplot/docs/search/GeneralT.html +20 -0
  179. data/data/jqplot/docs/search/GeneralU.html +20 -0
  180. data/data/jqplot/docs/search/GeneralV.html +20 -0
  181. data/data/jqplot/docs/search/GeneralW.html +20 -0
  182. data/data/jqplot/docs/search/GeneralX.html +20 -0
  183. data/data/jqplot/docs/search/GeneralY.html +20 -0
  184. data/data/jqplot/docs/search/GeneralZ.html +20 -0
  185. data/data/jqplot/docs/search/HooksA.html +20 -0
  186. data/data/jqplot/docs/search/HooksE.html +20 -0
  187. data/data/jqplot/docs/search/HooksJ.html +20 -0
  188. data/data/jqplot/docs/search/HooksP.html +20 -0
  189. data/data/jqplot/docs/search/NoResults.html +15 -0
  190. data/data/jqplot/docs/search/PropertiesA.html +20 -0
  191. data/data/jqplot/docs/search/PropertiesB.html +20 -0
  192. data/data/jqplot/docs/search/PropertiesC.html +20 -0
  193. data/data/jqplot/docs/search/PropertiesD.html +20 -0
  194. data/data/jqplot/docs/search/PropertiesE.html +20 -0
  195. data/data/jqplot/docs/search/PropertiesF.html +20 -0
  196. data/data/jqplot/docs/search/PropertiesG.html +20 -0
  197. data/data/jqplot/docs/search/PropertiesH.html +20 -0
  198. data/data/jqplot/docs/search/PropertiesI.html +20 -0
  199. data/data/jqplot/docs/search/PropertiesL.html +20 -0
  200. data/data/jqplot/docs/search/PropertiesM.html +20 -0
  201. data/data/jqplot/docs/search/PropertiesN.html +20 -0
  202. data/data/jqplot/docs/search/PropertiesO.html +20 -0
  203. data/data/jqplot/docs/search/PropertiesP.html +20 -0
  204. data/data/jqplot/docs/search/PropertiesR.html +20 -0
  205. data/data/jqplot/docs/search/PropertiesS.html +20 -0
  206. data/data/jqplot/docs/search/PropertiesT.html +20 -0
  207. data/data/jqplot/docs/search/PropertiesU.html +20 -0
  208. data/data/jqplot/docs/search/PropertiesV.html +20 -0
  209. data/data/jqplot/docs/search/PropertiesW.html +20 -0
  210. data/data/jqplot/docs/search/PropertiesX.html +20 -0
  211. data/data/jqplot/docs/search/PropertiesY.html +20 -0
  212. data/data/jqplot/docs/search/PropertiesZ.html +20 -0
  213. data/data/jqplot/docs/styles/1.css +767 -0
  214. data/data/jqplot/docs/styles/2.css +174 -0
  215. data/data/jqplot/docs/styles/main.css +2 -0
  216. data/data/jqplot/examples/.htaccess +1 -0
  217. data/data/jqplot/examples/OHLC.html +333 -0
  218. data/data/jqplot/examples/OHLC2.html +193 -0
  219. data/data/jqplot/examples/area.html +107 -0
  220. data/data/jqplot/examples/axisLabel.html +117 -0
  221. data/data/jqplot/examples/axisLabelsRotatedText.html +131 -0
  222. data/data/jqplot/examples/axisLabelsRotatedText2.html +155 -0
  223. data/data/jqplot/examples/barLinePieStack.html +198 -0
  224. data/data/jqplot/examples/barMissingValues.html +64 -0
  225. data/data/jqplot/examples/barTest.html +283 -0
  226. data/data/jqplot/examples/barTest2.html +74 -0
  227. data/data/jqplot/examples/bezierCurve.html +96 -0
  228. data/data/jqplot/examples/blockPlot.html +149 -0
  229. data/data/jqplot/examples/bubbleChart2.html +253 -0
  230. data/data/jqplot/examples/bubblechart.html +69 -0
  231. data/data/jqplot/examples/catchError.html +53 -0
  232. data/data/jqplot/examples/categoryHorizontalBar.html +81 -0
  233. data/data/jqplot/examples/categoryVsLinearAxes.html +74 -0
  234. data/data/jqplot/examples/chartInTable.html +33 -0
  235. data/data/jqplot/examples/customHighlighterCursorTrendline.html +72 -0
  236. data/data/jqplot/examples/customPieTests.html +73 -0
  237. data/data/jqplot/examples/dataLabels.html +192 -0
  238. data/data/jqplot/examples/dataTracking.html +91 -0
  239. data/data/jqplot/examples/donutTest.html +89 -0
  240. data/data/jqplot/examples/donutTest.js +96 -0
  241. data/data/jqplot/examples/examples.css +19 -0
  242. data/data/jqplot/examples/fillToZero.html +126 -0
  243. data/data/jqplot/examples/filledLine.html +78 -0
  244. data/data/jqplot/examples/filledLineCategoryAxis.html +80 -0
  245. data/data/jqplot/examples/funnelTest.html +82 -0
  246. data/data/jqplot/examples/funnelTest.js +74 -0
  247. data/data/jqplot/examples/gridCustomization.html +56 -0
  248. data/data/jqplot/examples/hiddenPlot.html +216 -0
  249. data/data/jqplot/examples/highlighter.html +95 -0
  250. data/data/jqplot/examples/highlighter2.html +63 -0
  251. data/data/jqplot/examples/horizontalLine.html +51 -0
  252. data/data/jqplot/examples/intticks.html +178 -0
  253. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  254. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  255. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  256. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  257. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  258. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  259. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  260. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  261. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  262. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  263. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  264. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  265. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  266. data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  267. data/data/jqplot/examples/jquery-ui/css/ui-lightness/jquery-ui-1.8.1.custom.css +486 -0
  268. data/data/jqplot/examples/jquery-ui/js/jquery-1.4.2.min.js +154 -0
  269. data/data/jqplot/examples/jquery-ui/js/jquery-ui-1.8.1.custom.min.js +756 -0
  270. data/data/jqplot/examples/legendLabels.html +205 -0
  271. data/data/jqplot/examples/legendLabels2.html +228 -0
  272. data/data/jqplot/examples/liz.zip +0 -0
  273. data/data/jqplot/examples/markerStyles.html +44 -0
  274. data/data/jqplot/examples/mekkoChart.html +217 -0
  275. data/data/jqplot/examples/meterGauge.html +132 -0
  276. data/data/jqplot/examples/meterGauge2.html +158 -0
  277. data/data/jqplot/examples/minMaxLines.html +61 -0
  278. data/data/jqplot/examples/missingValues.html +119 -0
  279. data/data/jqplot/examples/multiAxesRotatedText.html +70 -0
  280. data/data/jqplot/examples/multipleBarColors.html +149 -0
  281. data/data/jqplot/examples/multipleLines.html +47 -0
  282. data/data/jqplot/examples/multipleYAxes.html +85 -0
  283. data/data/jqplot/examples/nav.inc +35 -0
  284. data/data/jqplot/examples/pieTest.html +77 -0
  285. data/data/jqplot/examples/pieTest2.html +87 -0
  286. data/data/jqplot/examples/pieTest2.js +80 -0
  287. data/data/jqplot/examples/pieTest3.html +100 -0
  288. data/data/jqplot/examples/pointLabels.html +94 -0
  289. data/data/jqplot/examples/pointLabels2.html +47 -0
  290. data/data/jqplot/examples/prefix.html +90 -0
  291. data/data/jqplot/examples/resizablePlot.html +150 -0
  292. data/data/jqplot/examples/rotatedTickLabels.html +61 -0
  293. data/data/jqplot/examples/rotatedTickLabelsZoom.html +68 -0
  294. data/data/jqplot/examples/seriesCanvasReorder.html +93 -0
  295. data/data/jqplot/examples/seriesUpdate.html +123 -0
  296. data/data/jqplot/examples/shadowTests.html +133 -0
  297. data/data/jqplot/examples/singlePoint.html +70 -0
  298. data/data/jqplot/examples/sparkLine.html +48 -0
  299. data/data/jqplot/examples/stackedBar2.html +104 -0
  300. data/data/jqplot/examples/stackedBar3.html +76 -0
  301. data/data/jqplot/examples/stackedBarCategoryVsLinearAxes.html +121 -0
  302. data/data/jqplot/examples/stackedCategoryAxis.html +89 -0
  303. data/data/jqplot/examples/stackedFilledLine.html +77 -0
  304. data/data/jqplot/examples/stackedLine.html +56 -0
  305. data/data/jqplot/examples/test2.html +64 -0
  306. data/data/jqplot/examples/theming.html +483 -0
  307. data/data/jqplot/examples/trendlineDragableCustomization.html +79 -0
  308. data/data/jqplot/examples/verticalLine.html +52 -0
  309. data/data/jqplot/examples/waterfall.html +135 -0
  310. data/data/jqplot/examples/zoom1.html +125 -0
  311. data/data/jqplot/examples/zoom2.html +73 -0
  312. data/data/jqplot/examples/zoom3.html +69 -0
  313. data/data/jqplot/examples/zoomOptions.html +101 -0
  314. data/data/jqplot/examples/zoomProxy.html +108 -0
  315. data/data/jqplot/excanvas.js +1416 -0
  316. data/data/jqplot/excanvas.min.js +35 -0
  317. data/data/jqplot/gpl-2.0.txt +280 -0
  318. data/data/jqplot/jqPlotCssStyling.txt +53 -0
  319. data/data/jqplot/jqPlotOptions.txt +276 -0
  320. data/data/jqplot/jquery-1.4.1.min.js +152 -0
  321. data/data/jqplot/jquery-1.4.2.min.js +154 -0
  322. data/data/jqplot/jquery.jqplot.css +212 -0
  323. data/data/jqplot/jquery.jqplot.js +7004 -0
  324. data/data/jqplot/jquery.jqplot.min.css +1 -0
  325. data/data/jqplot/jquery.jqplot.min.js +34 -0
  326. data/data/jqplot/optionsTutorial.txt +239 -0
  327. data/data/jqplot/plugins/jqplot.BezierCurveRenderer.js +300 -0
  328. data/data/jqplot/plugins/jqplot.BezierCurveRenderer.min.js +34 -0
  329. data/data/jqplot/plugins/jqplot.barRenderer.js +629 -0
  330. data/data/jqplot/plugins/jqplot.barRenderer.min.js +34 -0
  331. data/data/jqplot/plugins/jqplot.blockRenderer.js +221 -0
  332. data/data/jqplot/plugins/jqplot.blockRenderer.min.js +34 -0
  333. data/data/jqplot/plugins/jqplot.bubbleRenderer.js +724 -0
  334. data/data/jqplot/plugins/jqplot.bubbleRenderer.min.js +34 -0
  335. data/data/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js +187 -0
  336. data/data/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js +34 -0
  337. data/data/jqplot/plugins/jqplot.canvasAxisTickRenderer.js +226 -0
  338. data/data/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js +34 -0
  339. data/data/jqplot/plugins/jqplot.canvasTextRenderer.js +408 -0
  340. data/data/jqplot/plugins/jqplot.canvasTextRenderer.min.js +34 -0
  341. data/data/jqplot/plugins/jqplot.categoryAxisRenderer.js +630 -0
  342. data/data/jqplot/plugins/jqplot.categoryAxisRenderer.min.js +34 -0
  343. data/data/jqplot/plugins/jqplot.cursor.js +952 -0
  344. data/data/jqplot/plugins/jqplot.cursor.min.js +34 -0
  345. data/data/jqplot/plugins/jqplot.dateAxisRenderer.js +313 -0
  346. data/data/jqplot/plugins/jqplot.dateAxisRenderer.min.js +34 -0
  347. data/data/jqplot/plugins/jqplot.donutRenderer.js +876 -0
  348. data/data/jqplot/plugins/jqplot.donutRenderer.min.js +34 -0
  349. data/data/jqplot/plugins/jqplot.dragable.js +206 -0
  350. data/data/jqplot/plugins/jqplot.dragable.min.js +34 -0
  351. data/data/jqplot/plugins/jqplot.enhancedLegendRenderer.js +186 -0
  352. data/data/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js +34 -0
  353. data/data/jqplot/plugins/jqplot.funnelRenderer.js +918 -0
  354. data/data/jqplot/plugins/jqplot.funnelRenderer.min.js +34 -0
  355. data/data/jqplot/plugins/jqplot.highlighter.js +374 -0
  356. data/data/jqplot/plugins/jqplot.highlighter.min.js +34 -0
  357. data/data/jqplot/plugins/jqplot.logAxisRenderer.js +434 -0
  358. data/data/jqplot/plugins/jqplot.logAxisRenderer.min.js +34 -0
  359. data/data/jqplot/plugins/jqplot.mekkoAxisRenderer.js +595 -0
  360. data/data/jqplot/plugins/jqplot.mekkoAxisRenderer.min.js +34 -0
  361. data/data/jqplot/plugins/jqplot.mekkoRenderer.js +419 -0
  362. data/data/jqplot/plugins/jqplot.mekkoRenderer.min.js +34 -0
  363. data/data/jqplot/plugins/jqplot.meterGaugeRenderer.js +1112 -0
  364. data/data/jqplot/plugins/jqplot.meterGaugeRenderer.min.js +34 -0
  365. data/data/jqplot/plugins/jqplot.ohlcRenderer.js +343 -0
  366. data/data/jqplot/plugins/jqplot.ohlcRenderer.min.js +34 -0
  367. data/data/jqplot/plugins/jqplot.pieRenderer.js +749 -0
  368. data/data/jqplot/plugins/jqplot.pieRenderer.min.js +34 -0
  369. data/data/jqplot/plugins/jqplot.pointLabels.js +325 -0
  370. data/data/jqplot/plugins/jqplot.pointLabels.min.js +34 -0
  371. data/data/jqplot/plugins/jqplot.trendline.js +208 -0
  372. data/data/jqplot/plugins/jqplot.trendline.min.js +34 -0
  373. data/data/jqplot/usage.txt +119 -0
  374. data/examples/graph.rb +17 -0
  375. data/lib/reportbuilder.rb +21 -2
  376. data/lib/reportbuilder/builder.rb +31 -3
  377. data/lib/reportbuilder/builder/html.rb +39 -5
  378. data/lib/reportbuilder/graph.rb +252 -0
  379. data/lib/reportbuilder/graph/html_flot.rb +149 -0
  380. data/lib/reportbuilder/graph/html_jqplot.rb +145 -0
  381. data/lib/reportbuilder/image.rb +178 -78
  382. data/lib/reportbuilder/table/rtfbuilder.rb +2 -2
  383. data/test/helper_test.rb +6 -7
  384. data/test/test_graph.rb +44 -0
  385. data/test/test_graph_html_flot.rb +36 -0
  386. data/test/test_graph_html_jqplot.rb +36 -0
  387. data/test/test_html.rb +4 -7
  388. data/test/test_image.rb +35 -7
  389. data/test/test_reportbuilder.rb +4 -6
  390. data/test/test_table.rb +0 -2
  391. metadata +402 -7
  392. metadata.gz.sig +4 -2
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2009 - 2010 Chris Leonello
3
+ * jqPlot is currently available for use in all personal or commercial projects
4
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
5
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
6
+ * choose the license that best suits your project and use it accordingly.
7
+ *
8
+ * Although not required, the author would appreciate an email letting him
9
+ * know of any substantial use of jqPlot. You can reach the author at:
10
+ * chris at jqplot or see http://www.jqplot.com/info.php .
11
+ *
12
+ * If you are feeling kind and generous, consider supporting the project by
13
+ * making a donation at: http://www.jqplot.com/donate.php .
14
+ *
15
+ * jqPlot includes date instance methods and printf/sprintf functions by other authors:
16
+ *
17
+ * Date instance methods contained in jqplot.dateMethods.js:
18
+ *
19
+ * author Ken Snyder (ken d snyder at gmail dot com)
20
+ * date 2008-09-10
21
+ * version 2.0.2 (http://kendsnyder.com/sandbox/date/)
22
+ * license Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
23
+ *
24
+ * JavaScript printf/sprintf functions contained in jqplot.sprintf.js:
25
+ *
26
+ * version 2007.04.27
27
+ * author Ash Searle
28
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
29
+ * http://hexmen.com/js/sprintf.js
30
+ * The author (Ash Searle) has placed this code in the public domain:
31
+ * "This code is unrestricted: you are free to use it however you like."
32
+ *
33
+ */
34
+ (function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var i=k.trendline.label.toString();var j=null;if(this.renderer.constructor!=f.jqplot.PieRenderer&&k.trendline.show&&i){j={label:i,color:k.trendline.color}}return j}function e(m,k,j,i,l){if(this.renderer.constructor==f.jqplot.LineRenderer){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(i.show&&this.renderer.constructor!=f.jqplot.PieRenderer){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p<v.length;p++){if(v[p]<=0){s--}else{k.push(w[p]);j.push(Math.log(v[p]))}}}}for(var p=0;p<s;p++){o=o+k[p];m=m+j[p];q=q+k[p]*j[p];r=r+k[p]*k[p];l=l+j[p]*j[p]}t=(s*q-o*m)/(s*r-o*o);z=(m-t*o)/s;return[t,z]}function h(k,j){var i;i=b(k,j,"linear");return[i[0],i[1]]}function d(o,m){var k;var i=o;var n=m;k=b(i,n,"exp");var l=Math.exp(k[0]);var j=Math.exp(k[1]);return[l,j]}function c(l,j){var p=(j==null)?"linear":j;var n;var o;var r=[];var q=[];var m=[];for(k=0;k<l.length;k++){if(l[k]!=null&&l[k][0]!=null&&l[k][1]!=null){r.push(l[k][0]);q.push(l[k][1])}}if(p=="linear"){n=h(r,q);for(var k=0;k<r.length;k++){o=n[0]*r[k]+n[1];m.push([r[k],o])}}else{if(p=="exp"||p=="exponential"){n=d(r,q);for(var k=0;k<r.length;k++){o=n[1]*Math.pow(n[0],r[k]);m.push([r[k],o])}}}return{data:m,slope:n[0],intercept:n[1]}}})(jQuery);
@@ -0,0 +1,119 @@
1
+ Title: jqPlot Usage
2
+
3
+ Usage Documentation:
4
+
5
+ Introduction:
6
+
7
+ jqPlot is a jQuery plugin to generate pure client-side javascript charts in your web pages.
8
+
9
+ The jqPlot home page is at <http://www.jqplot.com/>.
10
+
11
+ The project page and downloads are at <http://www.bitbucket.org/cleonello/jqplot/>.
12
+
13
+ Below are a few examples to demonstrate jqPlot usage. These plots are shown as static images.
14
+ Many more examples of dynamically rendered plots can be seen on the test and examples pages here: <../../tests/>.
15
+
16
+ Include the Files:
17
+
18
+ jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.4.1 is included in the distribution.
19
+ To use jqPlot include jquery, the jqPlot jQuery plugin, jqPlot css file and optionally the excanvas
20
+ script for IE support in your web page:
21
+
22
+ > <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
23
+ > <script language="javascript" type="text/javascript" src="jquery-1.4.2.min.js"></script>
24
+ > <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
25
+ > <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
26
+
27
+ Add a plot container:
28
+
29
+ Add a container (target) to your web page where you want your plot to show up.
30
+ Be sure to give your target a width and a height:
31
+
32
+ > <div id="chartdiv" style="height:400px;width:300px; "></div>
33
+
34
+ Create a plot:
35
+
36
+ Then, create the actual plot by calling the
37
+ $.jqplot plugin with the id of your target and some data:
38
+
39
+ > $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);
40
+
41
+ Which will produce a
42
+ chart like:
43
+
44
+ (see images/basicline.png)
45
+
46
+ Plot Options:
47
+
48
+ You can customize the plot by passing options to the $.jqplot function. Options are described in
49
+ <jqPlot Options> in the jqPlotOptions.txt file. An example of options usage:
50
+
51
+ > $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
52
+ > { title:'Exponential Line',
53
+ > axes:{yaxis:{min:-10, max:240}},
54
+ > series:[{color:'#5FAB78'}]
55
+ > });
56
+
57
+ Which will produce
58
+ a plot like:
59
+
60
+ (see images/basicoptions.png)
61
+
62
+ Using Plugins:
63
+
64
+ You can use jqPlot plugins (that is, plugins to the jqPlot plugin) by including them in your html
65
+ after you include the jqPlot plugin. Here is how to include the log axis plugin:
66
+
67
+ > <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
68
+ > <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
69
+ > <script language="javascript" type="text/javascript" src="jquery-1.4.2.min.js"></script>
70
+ > <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
71
+ > <script language="javascript" type="text/javascript" src="jqplot.logAxisRenderer.js"></script>
72
+
73
+ Here is a the same $.jqplot call
74
+ but with a log y axis:
75
+
76
+ > $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
77
+ > { title:'Exponential Line',
78
+ > axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer}},
79
+ > series:[{color:'#5FAB78'}]
80
+ > });
81
+
82
+ Which produces
83
+ a plot like:
84
+
85
+ (see images/basiclogaxis.png)
86
+
87
+ You can further customize with options specific
88
+ to the log axis plugin:
89
+
90
+ > $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]],
91
+ > { title:'Exponential Line',
92
+ > axes:{yaxis:{renderer: $.jqplot.LogAxisRenderer, tickDistribution:'power'}},
93
+ > series:[{color:'#5FAB78'}]
94
+ > });
95
+
96
+ Which makes a
97
+ plot like:
98
+
99
+ (see images/basiclogoptions.png)
100
+
101
+ For a full list of options, see <jqPlot Options> in the jqPlotOptions.txt file.
102
+
103
+ You can add as many plugins as you wish. Order is generally not important.
104
+ Some plugins, like the highlighter plugin which highlights data points near the
105
+ mouse, don't need any extra options or setup to function. Highlighter does have
106
+ additional options which the user can set.
107
+
108
+ Other plugins, the barRenderer for example, provide functionality the must be specified
109
+ in the chart options object. To render a series as a bar graph with the bar renderer,
110
+ you would first include the plugin after jqPlot:
111
+
112
+ > <script language="javascript" type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
113
+
114
+ Then you would create
115
+ a chart like:
116
+
117
+ > $.jqplot('chartdiv', [[34.53, 56.32, 25.1, 18.6]], series:[{renderer:$.jqplot.BarRenderer}]);
118
+
119
+ Here the default LineRenderer is replaced by a BarRenderer to generate a bar graph for the first (an only) series.
@@ -0,0 +1,17 @@
1
+ $:.unshift(File.dirname(__FILE__)+"/../lib")
2
+ require "reportbuilder"
3
+ $base_dirname=File.dirname(__FILE__)
4
+ rb=ReportBuilder.new(:directory=>$base_dirname) do |rb|
5
+ rb.graph(:name=>"Graph", :html_engine=>:ploticus) do |g|
6
+ g.series_defaults :color=>'red', :bars=>{:width=>5}
7
+ g.legend :show=>true, :position=>'nw', :background_color=>'purple'
8
+ g.xaxis :min=>-2, :max=>10, :ticks=>2
9
+ g.grid :show=>true, :color=>'#cccccc', :background_color=>'#eeeeee'
10
+ g.serie :x1, :label=>'d1', :data=>10.times.map{|i| rand(10)+i}, :type=>:bar, :bars=>{:width=>5, :color=>'blue'}
11
+ g.serie :x2, :label=>'d2', :data=>10.times.map{|i| rand(10)+i}, :type=>:scatter, :lines=>{:color=>'orange'}
12
+ g.serie :x3, :label=>'d3', :data=>10.times.map{|i| rand(10)+i}, :type=>:line, :lines=>{:color=>'yellow', :width=>3, :shadow_depth=>20}, :markers=>{:show=>true, :color=>'red', :diameter=>10}
13
+ end
14
+ end
15
+ rb.name="Graph"
16
+ puts rb.to_html
17
+ rb.save_html($base_dirname+'/graph.html')
@@ -2,6 +2,7 @@ require 'reportbuilder/builder'
2
2
  require 'reportbuilder/table'
3
3
  require 'reportbuilder/section'
4
4
  require 'reportbuilder/image'
5
+ require 'reportbuilder/graph'
5
6
 
6
7
  # = Report Abstract Interface.
7
8
  # Creates text, html and rtf output, based on a common framework.
@@ -51,15 +52,28 @@ class ReportBuilder
51
52
  # Doesn't print a title if set to true
52
53
  attr_accessor :no_title
53
54
  # ReportBuilder version
54
- VERSION = '1.2.5'
55
-
55
+ VERSION = '1.3.0'
56
+ DATA_DIR=File.dirname(__FILE__)+"/../data"
56
57
  FormatNotFound=Class.new(Exception)
57
58
  # Available formats
58
59
  def self.builder_for(format)
59
60
  format=format.to_s.downcase
60
61
  Builder.inherited_classes.find {|m| m.code.include? format}
61
62
  end
63
+ def self.has_rmagick?
64
+ begin
65
+ require 'RMagick'
66
+ true
67
+ rescue LoadError
68
+ false
69
+ end
70
+ end
62
71
  # Generates and optionally save the report on one function
72
+ #
73
+ # * options= Hash of options
74
+ # * :filename => name of file. If not provided, returns output
75
+ # * :format => format of output. See Builder subclasses
76
+ # * &block: block executed inside builder
63
77
  def self.generate(options=Hash.new, &block)
64
78
  options[:filename]||=nil
65
79
  options[:format]||="text"
@@ -135,5 +149,10 @@ class ReportBuilder
135
149
  gen.parse
136
150
  gen.out
137
151
  end
152
+ def save_text(file)
153
+ gen=Builder::Text.new(self, @options)
154
+ gen.parse
155
+ gen.save(file)
156
+ end
138
157
  alias_method :to_s, :to_text
139
158
  end
@@ -28,8 +28,10 @@ class ReportBuilder
28
28
  @options=default_options.merge(options)
29
29
  @toc=[]
30
30
  @table_n=1
31
+ @graph_n=1
31
32
  @entry_n=1
32
33
  @list_tables=[]
34
+ @list_graphs=[]
33
35
 
34
36
  end
35
37
  # Parse the output. Could be reimplemented on subclasses
@@ -78,10 +80,28 @@ class ReportBuilder
78
80
  def table(opt=Hash.new, &block)
79
81
  parse_element(ReportBuilder::Table.new(opt,&block))
80
82
  end
81
- # Create and parse an image.
82
- def image(filename,opt=Hash.new)
83
- parse_element(ReportBuilder::Image.new(filename,opt))
83
+ def graph(opt=Hash.new, &block)
84
+ parse_element(ReportBuilder::Graph.new(opt,&block))
84
85
  end
86
+ # Create and parse an image, using a string or IO
87
+ def image_blob(blob, opt=Hash.new)
88
+ parse_element(ReportBuilder::ImageBlob.new(blob,opt))
89
+ end
90
+ # Create and parse an image, using a string or IO
91
+ def image_filename(filename, opt=Hash.new)
92
+ parse_element(ReportBuilder::ImageFilename.new(filename,opt))
93
+ end
94
+
95
+ # Create and parse an image, detecting if is a Filename or a
96
+ # blob
97
+ def image(img, opt=Hash.new)
98
+ if img.is_a? String and File.exists? img
99
+ parse_element(ReportBuilder::ImageFilename.new(img,opt))
100
+ else
101
+ parse_element(ReportBuilder::ImageBlob.new(img,opt))
102
+ end
103
+ end
104
+
85
105
  # Create and parse an image. Use a block to insert element inside the block
86
106
  def section(opt=Hash.new, &block)
87
107
  parse_element(ReportBuilder::Section.new(opt,&block))
@@ -116,6 +136,14 @@ class ReportBuilder
116
136
  @list_tables.push([anchor,name])
117
137
  anchor
118
138
  end
139
+ # Add an entry for graph index.
140
+ # Returns the name of the anchor
141
+ def graph_entry(name)
142
+ anchor="graph_#{@graph_n}"
143
+ @graph_n+=1
144
+ @list_graphs.push([anchor,name])
145
+ anchor
146
+ end
119
147
  end
120
148
 
121
149
  class ElementBuilder
@@ -5,7 +5,7 @@ class ReportBuilder
5
5
  attr_reader :directory
6
6
  def initialize(builder, options)
7
7
  super
8
- @directory = @options.delete :directory
8
+ @directory = @options.delete :directory
9
9
  @body=""
10
10
  @headers=[]
11
11
  @footers=[]
@@ -85,9 +85,11 @@ class ReportBuilder
85
85
  end
86
86
  def js(js)
87
87
  if(File.exists? js)
88
- if(!File.exists? @directory+"/js/"+File.basename(js))
88
+ if(!File.exists? @directory+"/js")
89
89
  FileUtils.mkdir @directory+"/js"
90
- FileUtils.cp js,@directory+"/js/"+File.basename(js)
90
+ end
91
+ if(!File.exists? @directory+"/js/"+File.basename(js))
92
+ FileUtils.cp js, @directory+"/js/"+File.basename(js)
91
93
  end
92
94
  @headers.push("<script type='text/javascript' src='js/#{File.basename(js)}'></script>")
93
95
  end
@@ -95,15 +97,47 @@ class ReportBuilder
95
97
 
96
98
  def css(css)
97
99
  if(File.exists? css)
98
- if(!File.exists? @directory+"/css/"+File.basename(css))
100
+ if(!File.exists? @directory+"/css")
99
101
  FileUtils.mkdir @directory+"/css"
102
+ end
103
+ if(!File.exists? @directory+"/css/"+File.basename(css))
100
104
  FileUtils.cp css, @directory+"/css/"+File.basename(css)
101
105
  end
102
106
  @headers.push("<link rel='stylesheet' type='text/css' href='css/#{File.basename(css)}' />")
103
107
  end
104
108
  end
105
109
 
106
-
110
+ def parse_js(d, level=0)
111
+ ei=5
112
+ indent=" "*(level*2)
113
+ case d
114
+ when String
115
+ "\"#{d}\""
116
+ when TrueClass
117
+ 'true'
118
+ when FalseClass
119
+ 'false'
120
+ when Numeric
121
+ d.to_s
122
+ when Array
123
+ if d.size>ei
124
+ sep,pre=",\n"+indent, "\n"+indent
125
+ else
126
+ sep, pre=", ", ""
127
+ end
128
+ pre+"["+d.map {|i| parse_js(i, level+1)}.join(sep)+pre+"]"
129
+ when Hash
130
+ if d.size>ei
131
+ sep, pre=",\n"+indent, "\n"+indent
132
+ else
133
+ sep, pre=", ", ""
134
+ end
135
+ pre+"{ "+d.map {|k,v| parse_js(k)+" : "+parse_js(v, level+1)}.join(sep)+pre+"}"
136
+
137
+ else
138
+ d.to_s
139
+ end
140
+ end
107
141
  def text(t)
108
142
  ws=(" "*parse_level*2)
109
143
  @body << ws << "<p>#{t}</p>\n"
@@ -0,0 +1,252 @@
1
+ class ReportBuilder
2
+ # Creates a Graph. API based on:
3
+ # * jqPlot: [http://www.jqplot.com/]
4
+ #
5
+ # == API Reference
6
+ # All options could be not available on specifics builder.
7
+ # See documentation and source code for specific information
8
+ # * height
9
+ # * width
10
+ # * data: Array for a specific data serie. The first parameter
11
+ # should be the id, and the next elements could be single values,
12
+ # with automatic
13
+ # asignation on x axis (from 1 to n), or an array of values. Normally,
14
+ # they correspond to x, y and z axis, but may change according to specific
15
+ # series type
16
+ # * series_defaults: Options for all series. The options are:
17
+ # * type: could be :line, :bar, :scatter, :pie. Depending on engine,
18
+ # is a shorthand designed to set several options at once or set
19
+ # the 'real' type of plot
20
+ # * label: String
21
+ # * color: String
22
+ # * lines: Hash
23
+ # * show: boolean
24
+ # * color: String
25
+ # * width: integer
26
+ # * fill: boolean
27
+ # * fill_color: string
28
+ # * shadow: boolean
29
+ # * shadow_angle
30
+ # * shadow_offset
31
+ # * shadow_depth
32
+ # * shadow_alpha
33
+ # * markers: Hash
34
+ # * show: boolean
35
+ # * color: boolean
36
+ # * style: style
37
+ # * line_width
38
+ # * size: integer (diameter)
39
+ # * diameter:
40
+ # * radius:
41
+ # * shadow: boolean
42
+ # * shadow_angle
43
+ # * shadow_offset
44
+ # * shadow_depth
45
+ # * shadow_alpha
46
+ # * bars: Hash
47
+ # * color
48
+ # * width
49
+ # * padding
50
+ # * margin
51
+ # * direction
52
+ # * align: 'left' or 'center'
53
+ # * serie_options: Options for a specific serie. The first argument should
54
+ # be the id of serie, and the second parameter should be a hash with
55
+ # options according to series_options
56
+ # * serie: Shorthand for :data and :serie_options. The first element is the
57
+ # id, the second a hash with options for serie, including :data key to
58
+ # assign data to a serie.
59
+ # * legend: hash of options
60
+ # * show
61
+ # * position:
62
+ # * margin
63
+ # * background_color
64
+ # * title
65
+ # * show
66
+ # * text: by default, equal to name of element
67
+ # * axes_defaults: hash of options
68
+ # * show
69
+ # * min
70
+ # * max
71
+ # * autoscale
72
+ # * label_width
73
+ # * label_height
74
+ # * ticks: number of ticks or array
75
+ # * xaxes: Same as axes_defaults
76
+ # * yaxes: Same as axes_defaults
77
+ # * grid
78
+ # * show
79
+ # * color
80
+ # * background_color
81
+ # * tick_color
82
+ # * border_width
83
+ # * border_color
84
+ # * shadow: boolean
85
+ # * shadow_angleel
86
+ # * shadow_offset
87
+ # * shadow_depth
88
+ # * shadow_alpha
89
+
90
+ # == Usage
91
+ # graph=ReportBuilder::Graph.new(:name=>"Graph", ) do |g|
92
+ # g.serie :x1, :data=>[1,2,3,4], :label=>"Data 1" # Automatic asignation of x axis
93
+ # g.data :x2, :data=>[[1,2],[2,3],[4,5]], :label=>"Data 2" # Manual asignation of x axis
94
+ # g.xaxis :label=>"X axis", :autoscale=>true # jqPlot like asignation
95
+ # end
96
+ class Graph
97
+ # Allows to define an reader/writer function
98
+ # Without parameters, retrieve the value for a instance variable
99
+ # With parameters, set the value for instance variable
100
+ def self.attr_accessor_dsl(*attr)
101
+ attr.each do |sym|
102
+ sym_w_sm=sym.to_s.gsub(":","")
103
+ define_method(sym) do |*args|
104
+ if args.size==0
105
+ instance_variable_get("@#{sym_w_sm}")
106
+ else
107
+ instance_variable_set("@#{sym_w_sm}", args[0])
108
+ end
109
+ end
110
+
111
+ define_method(sym.to_s+"=") do |*args|
112
+ instance_variable_set("@#{sym_w_sm}", args[0])
113
+ end
114
+ end
115
+ end
116
+
117
+ @@n=1 # :nodoc:
118
+ attr_reader :name
119
+ attr_reader :number, :series_data_hash, :series_options_hash
120
+
121
+ attr_accessor_dsl :height, :width, :series_defaults, :title, :xaxis, :yaxis, :grid, :html_engine, :generic_engine, :legend, :axes_defaults
122
+ attr_reader :xmin,:xmax,:ymin, :ymax
123
+ def initialize(options=Hash.new, &block)
124
+ @number=@@n
125
+ @@n+=1
126
+ if !options.has_key? :name
127
+ @name="Graph #{@@n}"
128
+ else
129
+ @name=options.delete(:name)
130
+ end
131
+ @series_data_hash=Hash.new
132
+ @series_options_hash=Hash.new
133
+ @series_defaults=Hash.new
134
+ @xaxis=Hash.new
135
+ @yaxis=Hash.new
136
+ @grid=Hash.new
137
+ @legend=Hash.new
138
+ @axes_defaults=Hash.new
139
+ @title={:text=>@name}
140
+ default_options={
141
+ :width=>600,
142
+ :height=>400,
143
+ :html_engine=>:jqplot,
144
+ :generic_engine=>:rchart
145
+ }
146
+ @options=default_options.merge(options)
147
+ @options.each {|k,v|
148
+ self.send("#{k}=",v) if self.respond_to? k
149
+ }
150
+
151
+ if block
152
+ block.arity<1 ? self.instance_eval(&block) : block.call(self)
153
+ end
154
+ end
155
+ def name=(v)
156
+ @name=v
157
+ @title[:text]=v unless @title[:text]
158
+ end
159
+ def series_id
160
+ @series_data_hash.keys.sort {|a,b| a.to_s<=>b.to_s}
161
+ end
162
+ def series_data
163
+ series_id.map {|v|
164
+ @series_data_hash[v]
165
+ }
166
+ end
167
+ def series_options
168
+ series_id.map {|v|
169
+ @series_options_hash[v]
170
+ }
171
+ end
172
+
173
+ def data(name, *d)
174
+ i=0
175
+ if d.size==0
176
+ @series_data_hash[name]
177
+ else
178
+ @series_data_hash[name]=d.map {|v|
179
+ i+=1
180
+ if v.is_a? Array
181
+ v
182
+ else
183
+ [i,v]
184
+ end
185
+ }
186
+ end
187
+ end
188
+ def set_marker_size(h)
189
+ d=h[:markers][:diameter] if h[:markers][:diameter]
190
+ d=h[:markers][:size] if h[:markers][:size]
191
+ d=2*h[:markers][:radius] if h[:markers][:radius]
192
+ h[:markers][:diameter]=d
193
+ h[:markers][:radius]=d/2.0
194
+ h[:markers][:size]=d
195
+ end
196
+ def serie_options(name, h)
197
+ set_marker_size(h) if h[:markers] and (h[:markers].keys & [:size, :radius, :diameter]).size > 0
198
+ @series_options_hash[name]=h
199
+ end
200
+ def serie(name,d)
201
+ raise "You should define :data key" unless d[:data]
202
+ da=d.delete(:data)
203
+ data(name,*da)
204
+ serie_options(name,d)
205
+ end
206
+
207
+ def actuals_minmax
208
+ if @actuals_minmax.nil?
209
+ @actuals_minmax=Hash.new
210
+ series_data.each do |data|
211
+ data.each do |v|
212
+ @actuals_minmax[:xmin]||=v[0]
213
+ @actuals_minmax[:xmax]||=v[0]
214
+ @actuals_minmax[:ymin]||=v[1]
215
+ @actuals_minmax[:ymax]||=v[1]
216
+ @actuals_minmax[:xmin]=v[0] if @actuals_minmax[:xmin]>v[0]
217
+ @actuals_minmax[:xmax]=v[0] if @actuals_minmax[:xmax]<v[0]
218
+ @actuals_minmax[:ymin]=v[1] if @actuals_minmax[:ymin]>v[1]
219
+ @actuals_minmax[:ymax]=v[1] if @actuals_minmax[:ymax]<v[1]
220
+ end
221
+ end
222
+ end
223
+ @actuals_minmax
224
+ end
225
+
226
+ def define_xy_ranges
227
+ @xmin=xaxis[:min] if xaxis[:min]
228
+ @xmax=xaxis[:max] if xaxis[:max]
229
+ @ymin=yaxis[:min] if yaxis[:min]
230
+ @ymin=yaxis[:max] if yaxis[:max]
231
+ @xmin||=actuals_minmax[:xmin]
232
+ @xmax||=actuals_minmax[:xmax]
233
+ @ymin||=actuals_minmax[:ymin]
234
+ @ymax||=actuals_minmax[:ymax]
235
+ end
236
+
237
+
238
+
239
+ def report_building_html(builder)
240
+ require "reportbuilder/graph/html_#{html_engine}"
241
+ klass=("Html"+html_engine.to_s.capitalize).to_sym
242
+ graph_builder=ReportBuilder::Graph.const_get(klass).new(builder, self)
243
+ graph_builder.generate
244
+ end
245
+ def report_building(builder)
246
+ require "reportbuilder/graph/#{generic_engine}"
247
+ klass=(generic_engine.capitalize).to_sym
248
+ graph_builder = ReportBuilder::Graph.const_get(klass).new(builder, self)
249
+ graph_builder.generate
250
+ end
251
+ end
252
+ end