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(d){d.jqplot.BarRenderer=function(){d.jqplot.LineRenderer.call(this)};d.jqplot.BarRenderer.prototype=new d.jqplot.LineRenderer();d.jqplot.BarRenderer.prototype.constructor=d.jqplot.BarRenderer;d.jqplot.BarRenderer.prototype.init=function(o,q){this.barPadding=8;this.barMargin=10;this.barDirection="vertical";this.barWidth=null;this.shadowOffset=2;this.shadowDepth=5;this.shadowAlpha=0.08;this.waterfall=false;this.groups=1;this.varyBarColor=false;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];if(o.highlightMouseDown&&o.highlightMouseOver==null){o.highlightMouseOver=false}d.extend(true,this,o);this.fill=true;if(this.waterfall){this.fillToZero=false;this.disableStack=true}if(this.barDirection=="vertical"){this._primaryAxis="_xaxis";this._stackAxis="y";this.fillAxis="y"}else{this._primaryAxis="_yaxis";this._stackAxis="x";this.fillAxis="x"}this._highlightedPoint=null;this._plotSeriesInfo=null;this._dataColors=[];this._barPoints=[];var p={lineJoin:"miter",lineCap:"round",fill:true,isarc:false,strokeStyle:this.color,fillStyle:this.color,closePath:this.fill};this.renderer.shapeRenderer.init(p);var n={lineJoin:"miter",lineCap:"round",fill:true,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,closePath:this.fill};this.renderer.shadowRenderer.init(n);q.postInitHooks.addOnce(h);q.postDrawHooks.addOnce(j);q.eventListenerHooks.addOnce("jqplotMouseMove",b);q.eventListenerHooks.addOnce("jqplotMouseDown",a);q.eventListenerHooks.addOnce("jqplotMouseUp",l);q.eventListenerHooks.addOnce("jqplotClick",e);q.eventListenerHooks.addOnce("jqplotRightClick",m)};function g(t,p,o,w){if(this.rendererOptions.barDirection=="horizontal"){this._stackAxis="x";this._primaryAxis="_yaxis"}if(this.rendererOptions.waterfall==true){this._data=d.extend(true,[],this.data);var s=0;var u=(!this.rendererOptions.barDirection||this.rendererOptions.barDirection=="vertical")?1:0;for(var q=0;q<this.data.length;q++){s+=this.data[q][u];if(q>0){this.data[q][u]+=this.data[q-1][u]}}this.data[this.data.length]=(u==1)?[this.data.length+1,s]:[s,this.data.length+1];this._data[this._data.length]=(u==1)?[this._data.length+1,s]:[s,this._data.length+1]}if(this.rendererOptions.groups>1){this.breakOnNull=true;var n=this.data.length;var v=parseInt(n/this.rendererOptions.groups,10);var r=0;for(var q=v;q<n;q+=v){this.data.splice(q+r,0,[null,null]);r++}for(q=0;q<this.data.length;q++){if(this._primaryAxis=="_xaxis"){this.data[q][0]=q+1}else{this.data[q][1]=q+1}}}}d.jqplot.preSeriesInitHooks.push(g);d.jqplot.BarRenderer.prototype.calcSeriesNumbers=function(){var r=0;var t=0;var q=this[this._primaryAxis];var p,o,u;for(var n=0;n<q._series.length;n++){o=q._series[n];if(o===this){u=n}if(o.renderer.constructor==d.jqplot.BarRenderer){r+=o.data.length;t+=1}}return[r,t,u]};d.jqplot.BarRenderer.prototype.setBarWidth=function(){var q;var n=0;var o=0;var t=this[this._primaryAxis];var x,r,v;var w=this._plotSeriesInfo=this.renderer.calcSeriesNumbers.call(this);n=w[0];o=w[1];var u=t.numberTicks;var p=(u-1)/2;if(t.name=="xaxis"||t.name=="x2axis"){if(this._stack){this.barWidth=(t._offsets.max-t._offsets.min)/n*o-this.barMargin}else{this.barWidth=((t._offsets.max-t._offsets.min)/p-this.barPadding*(o-1)-this.barMargin*2)/o}}else{if(this._stack){this.barWidth=(t._offsets.min-t._offsets.max)/n*o-this.barMargin}else{this.barWidth=((t._offsets.min-t._offsets.max)/p-this.barPadding*(o-1)-this.barMargin*2)/o}}return[n,o]};function f(o){var q=[];for(var s=0;s<o.length;s++){var r=d.jqplot.getColorComponents(o[s]);var n=[r[0],r[1],r[2]];var t=n[0]+n[1]+n[2];for(var p=0;p<3;p++){n[p]=(t>570)?n[p]*0.8:n[p]+0.3*(255-n[p]);n[p]=parseInt(n[p],10)}q.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}return q}d.jqplot.BarRenderer.prototype.draw=function(E,J,q){var G;var A=(q!=undefined)?q:{};var v=(A.shadow!=undefined)?A.shadow:this.shadow;var M=(A.showLine!=undefined)?A.showLine:this.showLine;var F=(A.fill!=undefined)?A.fill:this.fill;var p=this.xaxis;var H=this.yaxis;var y=this._xaxis.series_u2p;var I=this._yaxis.series_u2p;var D,C,x,w,s;this._dataColors=[];this._barPoints=[];if(this.barWidth==null){this.renderer.setBarWidth.call(this)}var L=this._plotSeriesInfo=this.renderer.calcSeriesNumbers.call(this);x=L[0];w=L[1];s=L[2];if(this._stack){this._barNudge=0}else{this._barNudge=(-Math.abs(w/2-0.5)+s)*(this.barWidth+this.barPadding)}if(M){var u=new d.jqplot.ColorGenerator(this.negativeSeriesColors);var B=new d.jqplot.ColorGenerator(this.seriesColors);var K=u.get(this.index);if(!this.useNegativeColors){K=A.fillStyle}var t=A.fillStyle;if(this.barDirection=="vertical"){for(var G=0;G<J.length;G++){if(this.data[G][1]==null){continue}points=[];var r=J[G][0]+this._barNudge;var o;if(this._stack&&this._prevGridData.length){o=this._prevGridData[G][1]}else{if(this.fillToZero){o=this._yaxis.series_u2p(0)}else{if(this.waterfall&&G>0&&G<this.gridData.length-1){o=this.gridData[G-1][1]}else{o=E.canvas.height}}}if((this.fillToZero&&this._plotData[G][1]<0)||(this.waterfall&&this._data[G][1]<0)){if(this.varyBarColor&&!this._stack){if(this.useNegativeColors){A.fillStyle=u.next()}else{A.fillStyle=B.next()}}else{A.fillStyle=K}}else{if(this.varyBarColor&&!this._stack){A.fillStyle=B.next()}else{A.fillStyle=t}}points.push([r-this.barWidth/2,o]);points.push([r-this.barWidth/2,J[G][1]]);points.push([r+this.barWidth/2,J[G][1]]);points.push([r+this.barWidth/2,o]);this._barPoints.push(points);if(v&&!this._stack){var z=d.extend(true,{},A);delete z.fillStyle;this.renderer.shadowRenderer.draw(E,points,z)}var n=A.fillStyle||this.color;this._dataColors.push(n);this.renderer.shapeRenderer.draw(E,points,A)}}else{if(this.barDirection=="horizontal"){for(var G=0;G<J.length;G++){if(this.data[G][0]==null){continue}points=[];var r=J[G][1]-this._barNudge;var N;if(this._stack&&this._prevGridData.length){N=this._prevGridData[G][0]}else{if(this.fillToZero){N=this._xaxis.series_u2p(0)}else{if(this.waterfall&&G>0&&G<this.gridData.length-1){N=this.gridData[G-1][1]}else{N=0}}}if((this.fillToZero&&this._plotData[G][1]<0)||(this.waterfall&&this._data[G][1]<0)){if(this.varyBarColor&&!this._stack){if(this.useNegativeColors){A.fillStyle=u.next()}else{A.fillStyle=B.next()}}}else{if(this.varyBarColor&&!this._stack){A.fillStyle=B.next()}else{A.fillStyle=t}}points.push([N,r+this.barWidth/2]);points.push([N,r-this.barWidth/2]);points.push([J[G][0],r-this.barWidth/2]);points.push([J[G][0],r+this.barWidth/2]);this._barPoints.push(points);if(v&&!this._stack){var z=d.extend(true,{},A);delete z.fillStyle;this.renderer.shadowRenderer.draw(E,points,z)}var n=A.fillStyle||this.color;this._dataColors.push(n);this.renderer.shapeRenderer.draw(E,points,A)}}}}if(this.highlightColors.length==0){this.highlightColors=f(this._dataColors)}else{if(typeof(this.highlightColors)=="string"){var L=this.highlightColors;this.highlightColors=[];for(var G=0;G<this._dataColors.length;G++){this.highlightColors.push(L)}}}};d.jqplot.BarRenderer.prototype.drawShadow=function(z,E,p){var B;var w=(p!=undefined)?p:{};var s=(w.shadow!=undefined)?w.shadow:this.shadow;var G=(w.showLine!=undefined)?w.showLine:this.showLine;var A=(w.fill!=undefined)?w.fill:this.fill;var o=this.xaxis;var C=this.yaxis;var v=this._xaxis.series_u2p;var D=this._yaxis.series_u2p;var y,x,u,t,r;if(this._stack&&this.shadow){if(this.barWidth==null){this.renderer.setBarWidth.call(this)}var F=this._plotSeriesInfo=this.renderer.calcSeriesNumbers.call(this);u=F[0];t=F[1];r=F[2];if(this._stack){this._barNudge=0}else{this._barNudge=(-Math.abs(t/2-0.5)+r)*(this.barWidth+this.barPadding)}if(G){if(this.barDirection=="vertical"){for(var B=0;B<E.length;B++){if(this.data[B][1]==null){continue}points=[];var q=E[B][0]+this._barNudge;var n;if(this._stack&&this._prevGridData.length){n=this._prevGridData[B][1]}else{if(this.fillToZero){n=this._yaxis.series_u2p(0)}else{n=z.canvas.height}}points.push([q-this.barWidth/2,n]);points.push([q-this.barWidth/2,E[B][1]]);points.push([q+this.barWidth/2,E[B][1]]);points.push([q+this.barWidth/2,n]);this.renderer.shadowRenderer.draw(z,points,w)}}else{if(this.barDirection=="horizontal"){for(var B=0;B<E.length;B++){if(this.data[B][0]==null){continue}points=[];var q=E[B][1]-this._barNudge;var H;if(this._stack&&this._prevGridData.length){H=this._prevGridData[B][0]}else{H=0}points.push([H,q+this.barWidth/2]);points.push([E[B][0],q+this.barWidth/2]);points.push([E[B][0],q-this.barWidth/2]);points.push([H,q-this.barWidth/2]);this.renderer.shadowRenderer.draw(z,points,w)}}}}}};function h(p,o,n){for(i=0;i<this.series.length;i++){if(this.series[i].renderer.constructor==d.jqplot.BarRenderer){if(this.series[i].highlightMouseOver){this.series[i].highlightMouseDown=false}}}this.target.bind("mouseout",{plot:this},function(q){k(q.data.plot)})}function j(){this.plugins.barRenderer={highlightedSeriesIndex:null};this.plugins.barRenderer.highlightCanvas=new d.jqplot.GenericCanvas();this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-barRenderer-highlight-canvas",this._plotDimensions));var n=this.plugins.barRenderer.highlightCanvas.setContext()}function c(u,t,q,p){var o=u.series[t];var n=u.plugins.barRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);o._highlightedPoint=q;u.plugins.barRenderer.highlightedSeriesIndex=t;var r={fillStyle:o.highlightColors[q]};o.renderer.shapeRenderer.draw(n._ctx,p,r)}function k(p){var n=p.plugins.barRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);for(var o=0;o<p.series.length;o++){p.series[o]._highlightedPoint=null}p.plugins.barRenderer.highlightedSeriesIndex=null;p.target.trigger("jqplotDataUnhighlight")}function b(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var o=jQuery.Event("jqplotDataMouseOver");o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p);if(s.series[p[0]].highlightMouseOver&&!(p[0]==s.plugins.barRenderer.highlightedSeriesIndex&&p[1]==s.series[p[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.pageX=r.pageX;n.pageY=r.pageY;s.target.trigger(n,p);c(s,t.seriesIndex,t.pointIndex,t.points)}}else{if(t==null){k(s)}}}function a(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];if(r.series[o[0]].highlightMouseDown&&!(o[0]==r.plugins.barRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o);c(r,s.seriesIndex,s.pointIndex,s.points)}}else{if(s==null){k(r)}}}function l(p,o,s,r,q){var n=q.plugins.barRenderer.highlightedSeriesIndex;if(n!=null&&q.series[n].highlightMouseDown){k(q)}}function e(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];var n=jQuery.Event("jqplotDataClick");n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o)}}function m(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var n=s.plugins.barRenderer.highlightedSeriesIndex;if(n!=null&&s.series[n].highlightMouseDown){k(s)}var o=jQuery.Event("jqplotDataRightClick");o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p)}}})(jQuery);
@@ -0,0 +1,221 @@
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 and GPL version 2.0 licenses. This means that you can
5
+ * choose the license that best suits your project and use it accordingly.
6
+ *
7
+ * The author would appreciate an email letting him know of any substantial
8
+ * use of jqPlot. You can reach the author at: chris at jqplot dot com
9
+ * or see http://www.jqplot.com/info.php . This is, of course,
10
+ * not required.
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
+ * Thanks for using jqPlot!
16
+ *
17
+ */
18
+ (function($) {
19
+ /**
20
+ * Class: $.jqplot.BlockRenderer
21
+ * Plugin renderer to draw a x-y block chart. A Block chart has data points displayed as
22
+ * colored squares with a text label inside. Data must be supplied in the form:
23
+ *
24
+ * > [[x1, y1, "label 1", {css}], [x2, y2, "label 2", {css}], ...]
25
+ *
26
+ * The label and css object are optional. If the label is ommitted, the
27
+ * box will collapse unless a css height and/or width is specified.
28
+ *
29
+ * The css object is an object specifying css properties
30
+ * such as:
31
+ *
32
+ * > {background:'#4f98a5', border:'3px solid gray', padding:'1px'}
33
+ *
34
+ * Note that css properties specified with the data point override defaults
35
+ * specified with the series.
36
+ *
37
+ */
38
+ $.jqplot.BlockRenderer = function(){
39
+ $.jqplot.LineRenderer.call(this);
40
+ };
41
+
42
+ $.jqplot.BlockRenderer.prototype = new $.jqplot.LineRenderer();
43
+ $.jqplot.BlockRenderer.prototype.constructor = $.jqplot.BlockRenderer;
44
+
45
+ // called with scope of a series
46
+ $.jqplot.BlockRenderer.prototype.init = function(options) {
47
+ // Group: Properties
48
+ //
49
+ // prop: css
50
+ // default css styles that will be applied to all data blocks.
51
+ // these values will be overridden by css styles supplied with the
52
+ // individulal data points.
53
+ this.css = {padding:'2px', border:'1px solid #999', textAlign:'center'};
54
+ // prop: escapeHtml
55
+ // true to escape html in the box label.
56
+ this.escapeHtml = false;
57
+ // prop: insertBreaks
58
+ // true to turn spaces in data block label into html breaks <br />.
59
+ this.insertBreaks = true;
60
+ // prop: varyBlockColors
61
+ // true to vary the color of each block in this series according to
62
+ // the seriesColors array. False to set each block to the color
63
+ // specified on this series. This has no effect if a css background color
64
+ // option is specified in the renderer css options.
65
+ this.varyBlockColors = false;
66
+ $.extend(true, this, options);
67
+ if (this.css.backgroundColor) {
68
+ this.color = this.css.backgroundColor;
69
+ }
70
+ else if (this.css.background) {
71
+ this.color = this.css.background;
72
+ }
73
+ else if (!this.varyBlockColors) {
74
+ this.css.background = this.color;
75
+ }
76
+ this.canvas = new $.jqplot.BlockCanvas();
77
+ this.shadowCanvas = new $.jqplot.BlockCanvas();
78
+ this.canvas._plotDimensions = this._plotDimensions;
79
+ this.shadowCanvas._plotDimensions = this._plotDimensions;
80
+
81
+ // group: Methods
82
+ //
83
+ // Method: moveBlock
84
+ // Moves an individual block. More efficient than redrawing
85
+ // the whole series by calling plot.drawSeries().
86
+ // Properties:
87
+ // idx - the 0 based index of the block or point in this series.
88
+ // x - the x coordinate in data units (value on x axis) to move the block to.
89
+ // y - the y coordinate in data units (value on the y axis) to move the block to.
90
+ // duration - optional parameter to create an animated movement. Can be a
91
+ // number (higher is slower animation) or 'fast', 'normal' or 'slow'. If not
92
+ // provided, the element is moved without any animation.
93
+ this.moveBlock = function (idx, x, y, duration) {
94
+ // update plotData, stackData, data and gridData
95
+ // x and y are in data coordinates.
96
+ var el = this.canvas._elem.children(':eq('+idx+')');
97
+ this.data[idx][0] = x;
98
+ this.data[idx][1] = y;
99
+ this._plotData[idx][0] = x;
100
+ this._plotData[idx][1] = y;
101
+ this._stackData[idx][0] = x;
102
+ this._stackData[idx][1] = y;
103
+ this.gridData[idx][0] = this._xaxis.series_u2p(x);
104
+ this.gridData[idx][1] = this._yaxis.series_u2p(y);
105
+ var w = el.outerWidth();
106
+ var h = el.outerHeight();
107
+ var left = this.gridData[idx][0] - w/2 + 'px';
108
+ var top = this.gridData[idx][1] - h/2 + 'px';
109
+ if (duration) {
110
+ if (parseInt(duration, 10)) {
111
+ duration = parseInt(duration, 10);
112
+ }
113
+ el.animate({left:left, top:top}, duration);
114
+ }
115
+ else {
116
+ el.css({left:left, top:top});
117
+ }
118
+ el = null;
119
+ };
120
+ };
121
+
122
+ // called with scope of series
123
+ $.jqplot.BlockRenderer.prototype.draw = function (ctx, gd, options) {
124
+ if (this.plugins.pointLabels) {
125
+ this.plugins.pointLabels.show = false;
126
+ }
127
+ var i, el, d, gd, t, css, w, h, left, top;
128
+ var opts = (options != undefined) ? options : {};
129
+ var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
130
+ this.canvas._elem.empty();
131
+ for (i=0; i<this.gridData.length; i++) {
132
+ d = this.data[i];
133
+ gd = this.gridData[i];
134
+ t = '';
135
+ css = {};
136
+ if (typeof d[2] == 'string') {
137
+ t = d[2];
138
+ }
139
+ else if (typeof d[2] == 'object') {
140
+ css = d[2];
141
+ }
142
+ if (typeof d[3] == 'object') {
143
+ css = d[3];
144
+ }
145
+ if (this.insertBreaks){
146
+ t = t.replace(/ /g, '<br />');
147
+ }
148
+ css = $.extend(true, {}, this.css, css);
149
+ // create a div
150
+ el = $('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');
151
+ this.canvas._elem.append(el);
152
+ // set text
153
+ this.escapeHtml ? el.text(t) : el.html(t);
154
+ // style it
155
+ // remove styles we don't want overridden.
156
+ delete css.position;
157
+ delete css.marginRight;
158
+ delete css.marginLeft;
159
+ if (!css.background && !css.backgroundColor && !css.backgroundImage){
160
+ css.background = colorGenerator.next();
161
+ }
162
+ el.css(css);
163
+ w = el.outerWidth();
164
+ h = el.outerHeight();
165
+ left = gd[0] - w/2 + 'px';
166
+ top = gd[1] - h/2 + 'px';
167
+ el.css({left:left, top:top});
168
+ el = null;
169
+ }
170
+ };
171
+
172
+ $.jqplot.BlockCanvas = function() {
173
+ $.jqplot.ElemContainer.call(this);
174
+ this._ctx;
175
+ };
176
+
177
+ $.jqplot.BlockCanvas.prototype = new $.jqplot.ElemContainer();
178
+ $.jqplot.BlockCanvas.prototype.constructor = $.jqplot.BlockCanvas;
179
+
180
+ $.jqplot.BlockCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
181
+ this._offsets = offsets;
182
+ var klass = 'jqplot-blockCanvas';
183
+ if (clss != undefined) {
184
+ klass = clss;
185
+ }
186
+ var elem;
187
+ // if this canvas already has a dom element, don't make a new one.
188
+ if (this._elem) {
189
+ elem = this._elem.get(0);
190
+ }
191
+ else {
192
+ elem = document.createElement('div');
193
+ }
194
+ // if new plotDimensions supplied, use them.
195
+ if (plotDimensions != undefined) {
196
+ this._plotDimensions = plotDimensions;
197
+ }
198
+
199
+ var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
200
+ var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
201
+ this._elem = $(elem);
202
+ this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
203
+
204
+ this._elem.addClass(klass);
205
+ return this._elem;
206
+ };
207
+
208
+ $.jqplot.BlockCanvas.prototype.setContext = function() {
209
+ this._ctx = {
210
+ canvas:{
211
+ width:0,
212
+ height:0
213
+ },
214
+ clearRect:function(){return null;}
215
+ };
216
+ return this._ctx;
217
+ };
218
+
219
+ })(jQuery);
220
+
221
+
@@ -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(a){a.jqplot.BlockRenderer=function(){a.jqplot.LineRenderer.call(this)};a.jqplot.BlockRenderer.prototype=new a.jqplot.LineRenderer();a.jqplot.BlockRenderer.prototype.constructor=a.jqplot.BlockRenderer;a.jqplot.BlockRenderer.prototype.init=function(b){this.css={padding:"2px",border:"1px solid #999",textAlign:"center"};this.escapeHtml=false;this.insertBreaks=true;this.varyBlockColors=false;a.extend(true,this,b);if(this.css.backgroundColor){this.color=this.css.backgroundColor}else{if(this.css.background){this.color=this.css.background}else{if(!this.varyBlockColors){this.css.background=this.color}}}this.canvas=new a.jqplot.BlockCanvas();this.shadowCanvas=new a.jqplot.BlockCanvas();this.canvas._plotDimensions=this._plotDimensions;this.shadowCanvas._plotDimensions=this._plotDimensions;this.moveBlock=function(l,j,i,e){var c=this.canvas._elem.children(":eq("+l+")");this.data[l][0]=j;this.data[l][1]=i;this._plotData[l][0]=j;this._plotData[l][1]=i;this._stackData[l][0]=j;this._stackData[l][1]=i;this.gridData[l][0]=this._xaxis.series_u2p(j);this.gridData[l][1]=this._yaxis.series_u2p(i);var k=c.outerWidth();var f=c.outerHeight();var d=this.gridData[l][0]-k/2+"px";var g=this.gridData[l][1]-f/2+"px";if(e){if(parseInt(e,10)){e=parseInt(e,10)}c.animate({left:d,top:g},e)}else{c.css({left:d,top:g})}c=null}};a.jqplot.BlockRenderer.prototype.draw=function(q,o,r){if(this.plugins.pointLabels){this.plugins.pointLabels.show=false}var f,c,l,o,p,k,n,g,e,m;var b=(r!=undefined)?r:{};var j=new a.jqplot.ColorGenerator(this.seriesColors);this.canvas._elem.empty();for(f=0;f<this.gridData.length;f++){l=this.data[f];o=this.gridData[f];p="";k={};if(typeof l[2]=="string"){p=l[2]}else{if(typeof l[2]=="object"){k=l[2]}}if(typeof l[3]=="object"){k=l[3]}if(this.insertBreaks){p=p.replace(/ /g,"<br />")}k=a.extend(true,{},this.css,k);c=a('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');this.canvas._elem.append(c);this.escapeHtml?c.text(p):c.html(p);delete k.position;delete k.marginRight;delete k.marginLeft;if(!k.background&&!k.backgroundColor&&!k.backgroundImage){k.background=j.next()}c.css(k);n=c.outerWidth();g=c.outerHeight();e=o[0]-n/2+"px";m=o[1]-g/2+"px";c.css({left:e,top:m});c=null}};a.jqplot.BlockCanvas=function(){a.jqplot.ElemContainer.call(this);this._ctx};a.jqplot.BlockCanvas.prototype=new a.jqplot.ElemContainer();a.jqplot.BlockCanvas.prototype.constructor=a.jqplot.BlockCanvas;a.jqplot.BlockCanvas.prototype.createElement=function(i,e,c){this._offsets=i;var b="jqplot-blockCanvas";if(e!=undefined){b=e}var g;if(this._elem){g=this._elem.get(0)}else{g=document.createElement("div")}if(c!=undefined){this._plotDimensions=c}var d=this._plotDimensions.width-this._offsets.left-this._offsets.right+"px";var f=this._plotDimensions.height-this._offsets.top-this._offsets.bottom+"px";this._elem=a(g);this._elem.css({position:"absolute",width:d,height:f,left:this._offsets.left,top:this._offsets.top});this._elem.addClass(b);return this._elem};a.jqplot.BlockCanvas.prototype.setContext=function(){this._ctx={canvas:{width:0,height:0},clearRect:function(){return null}};return this._ctx}})(jQuery);
@@ -0,0 +1,724 @@
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 and GPL version 2.0 licenses. This means that you can
5
+ * choose the license that best suits your project and use it accordingly.
6
+ *
7
+ * The author would appreciate an email letting him know of any substantial
8
+ * use of jqPlot. You can reach the author at: chris at jqplot dot com
9
+ * or see http://www.jqplot.com/info.php . This is, of course,
10
+ * not required.
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
+ * Thanks for using jqPlot!
16
+ *
17
+ */
18
+ (function($) {
19
+ var arrayMax = function( array ){
20
+ return Math.max.apply( Math, array );
21
+ };
22
+ var arrayMin = function( array ){
23
+ return Math.min.apply( Math, array );
24
+ };
25
+
26
+ /**
27
+ * Class: $.jqplot.BubbleRenderer
28
+ * Plugin renderer to draw a bubble chart. A Bubble chart has data points displayed as
29
+ * colored circles with an optional text label inside. To use
30
+ * the bubble renderer, you must include the bubble renderer like:
31
+ *
32
+ * > <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.bubbleRenderer.js"></script>
33
+ *
34
+ * Data must be supplied in
35
+ * the form:
36
+ *
37
+ * > [[x1, y1, r1, <label or {label:'text', color:color}>], ...]
38
+ *
39
+ * where the label or options
40
+ * object is optional.
41
+ *
42
+ * Note that all bubble colors will be the same
43
+ * unless the "varyBubbleColors" option is set to true. Colors can be specified in the data array
44
+ * or in the seriesColors array option on the series. If no colors are defined, the default jqPlot
45
+ * series of 16 colors are used. Colors are automatically cycled around again if there are more
46
+ * bubbles than colors.
47
+ *
48
+ * Bubbles are autoscaled by default to fit within the chart area while maintaining
49
+ * relative sizes. If the "autoscaleBubbles" option is set to false, the r(adius) values
50
+ * in the data array a treated as literal pixel values for the radii of the bubbles.
51
+ *
52
+ * Properties are passed into the bubble renderer in the rendererOptions object of
53
+ * the series options like:
54
+ *
55
+ * > seriesDefaults: {
56
+ * > renderer: $.jqplot.BubbleRenderer,
57
+ * > rendererOptions: {
58
+ * > bubbleAlpha: 0.7,
59
+ * > varyBubbleColors: false
60
+ * > }
61
+ * > }
62
+ *
63
+ */
64
+ $.jqplot.BubbleRenderer = function(){
65
+ $.jqplot.LineRenderer.call(this);
66
+ };
67
+
68
+ $.jqplot.BubbleRenderer.prototype = new $.jqplot.LineRenderer();
69
+ $.jqplot.BubbleRenderer.prototype.constructor = $.jqplot.BubbleRenderer;
70
+
71
+ // called with scope of a series
72
+ $.jqplot.BubbleRenderer.prototype.init = function(options, plot) {
73
+ // Group: Properties
74
+ //
75
+ // prop: varyBubbleColors
76
+ // True to vary the color of each bubble in this series according to
77
+ // the seriesColors array. False to set each bubble to the color
78
+ // specified on this series. This has no effect if a css background color
79
+ // option is specified in the renderer css options.
80
+ this.varyBubbleColors = true;
81
+ // prop: autoscaleBubbles
82
+ // True to scale the bubble radius based on plot size.
83
+ // False will use the radius value as provided as a raw pixel value for
84
+ // bubble radius.
85
+ this.autoscaleBubbles = true;
86
+ // prop: autoscaleMultiplier
87
+ // Multiplier the bubble size if autoscaleBubbles is true.
88
+ this.autoscaleMultiplier = 1.0;
89
+ // prop: autoscalePointsFactor
90
+ // Factor which decreases bubble size based on how many bubbles on on the chart.
91
+ // 0 means no adjustment for number of bubbles. Negative values will decrease
92
+ // size of bubbles as more bubbles are added. Values between 0 and -0.2
93
+ // should work well.
94
+ this.autoscalePointsFactor = -0.07;
95
+ // prop: escapeHtml
96
+ // True to escape html in bubble label text.
97
+ this.escapeHtml = true;
98
+ // prop: highlightMouseOver
99
+ // True to highlight bubbles when moused over.
100
+ // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
101
+ this.highlightMouseOver = true;
102
+ // prop: highlightMouseDown
103
+ // True to highlight when a mouse button is pressed over a bubble.
104
+ // This will be disabled if highlightMouseOver is true.
105
+ this.highlightMouseDown = false;
106
+ // prop: highlightColors
107
+ // An array of colors to use when highlighting a slice. Calculated automatically
108
+ // if not supplied.
109
+ this.highlightColors = [];
110
+ // prop: bubbleAlpha
111
+ // Alpha transparency to apply to all bubbles in this series.
112
+ this.bubbleAlpha = 1.0;
113
+ // prop: highlightAlpha
114
+ // Alpha transparency to apply when highlighting bubble.
115
+ // Set to value of bubbleAlpha by default.
116
+ this.highlightAlpha = null;
117
+ // prop: bubbleGradients
118
+ // True to color the bubbles with gradient fills instead of flat colors.
119
+ // NOT AVAILABLE IN IE due to lack of excanvas support for radial gradient fills.
120
+ // will be ignored in IE.
121
+ this.bubbleGradients = false;
122
+ // prop: showLabels
123
+ // True to show labels on bubbles (if any), false to not show.
124
+ this.showLabels = true;
125
+ // array of [point index, radius] which will be sorted in descending order to plot
126
+ // largest points below smaller points.
127
+ this.radii = [];
128
+ this.maxRadius = 0;
129
+ // index of the currenty highlighted point, if any
130
+ this._highlightedPoint = null;
131
+ // array of jQuery labels.
132
+ this.labels = [];
133
+ this.bubbleCanvases = [];
134
+
135
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
136
+ if (options.highlightMouseDown && options.highlightMouseOver == null) {
137
+ options.highlightMouseOver = false;
138
+ }
139
+
140
+ $.extend(true, this, options);
141
+
142
+ if (this.highlightAlpha == null) {
143
+ this.highlightAlpha = this.bubbleAlpha;
144
+ if (this.bubbleGradients) {
145
+ this.highlightAlpha = 0.35;
146
+ }
147
+ }
148
+
149
+ this.autoscaleMultiplier = this.autoscaleMultiplier * Math.pow(this.data.length, this.autoscalePointsFactor);
150
+
151
+ // index of the currenty highlighted point, if any
152
+ this._highlightedPoint = null;
153
+
154
+ // adjust the series colors for options colors passed in with data or for alpha.
155
+ // note, this can leave undefined holes in the seriesColors array.
156
+ for (var i=0; i<this.data.length; i++) {
157
+ var color = null;
158
+ var d = this.data[i];
159
+ this.maxRadius = Math.max(this.maxRadius, d[2]);
160
+ if (d[3]) {
161
+ if (typeof(d[3]) == 'object') {
162
+ color = d[3]['color'];
163
+ }
164
+ }
165
+
166
+ if (color == null) {
167
+ if (this.seriesColors[i] != null) {
168
+ color = this.seriesColors[i];
169
+ }
170
+ }
171
+
172
+ if (color && this.bubbleAlpha < 1.0) {
173
+ comps = $.jqplot.getColorComponents(color);
174
+ color = 'rgba('+comps[0]+', '+comps[1]+', '+comps[2]+', '+this.bubbleAlpha+')';
175
+ }
176
+
177
+ if (color) {
178
+ this.seriesColors[i] = color;
179
+ }
180
+ }
181
+
182
+ if (!this.varyBubbleColors) {
183
+ this.seriesColors = [this.color];
184
+ }
185
+
186
+ this.colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
187
+
188
+ // set highlight colors if none provided
189
+ if (this.highlightColors.length == 0) {
190
+ for (var i=0; i<this.seriesColors.length; i++){
191
+ var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
192
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
193
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
194
+ for (var j=0; j<3; j++) {
195
+ // when darkening, lowest color component can be is 60.
196
+ newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
197
+ newrgb[j] = parseInt(newrgb[j], 10);
198
+ }
199
+ this.highlightColors.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+', '+this.highlightAlpha+')');
200
+ }
201
+ }
202
+
203
+ this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors);
204
+
205
+ var sopts = {fill:true, isarc:true, angle:this.shadowAngle, alpha:this.shadowAlpha, closePath:true};
206
+
207
+ this.renderer.shadowRenderer.init(sopts);
208
+
209
+ this.canvas = new $.jqplot.DivCanvas();
210
+ this.canvas._plotDimensions = this._plotDimensions;
211
+
212
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
213
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
214
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
215
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
216
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
217
+ plot.postDrawHooks.addOnce(postPlotDraw);
218
+
219
+ };
220
+
221
+
222
+ // converts the user data values to grid coordinates and stores them
223
+ // in the gridData array.
224
+ // Called with scope of a series.
225
+ $.jqplot.BubbleRenderer.prototype.setGridData = function(plot) {
226
+ // recalculate the grid data
227
+ var xp = this._xaxis.series_u2p;
228
+ var yp = this._yaxis.series_u2p;
229
+ var data = this._plotData;
230
+ this.gridData = [];
231
+ var radii = [];
232
+ this.radii = [];
233
+ var dim = Math.min(plot._height, plot._width);
234
+ for (var i=0; i<this.data.length; i++) {
235
+ if (data[i] != null) {
236
+ this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1]), data[i][2]]);
237
+ this.radii.push([i, data[i][2]]);
238
+ radii.push(data[i][2]);
239
+ }
240
+ }
241
+ var r, val, maxr = this.maxRadius = arrayMax(radii);
242
+ var l = this.gridData.length;
243
+ if (this.autoscaleBubbles) {
244
+ for (var i=0; i<l; i++) {
245
+ val = radii[i]/maxr;
246
+ r = this.autoscaleMultiplier * dim / 6;
247
+ this.gridData[i][2] = r * val;
248
+ }
249
+ }
250
+
251
+ this.radii.sort(function(a, b) { return b[1] - a[1]; });
252
+ };
253
+
254
+ // converts any arbitrary data values to grid coordinates and
255
+ // returns them. This method exists so that plugins can use a series'
256
+ // linerenderer to generate grid data points without overwriting the
257
+ // grid data associated with that series.
258
+ // Called with scope of a series.
259
+ $.jqplot.BubbleRenderer.prototype.makeGridData = function(data, plot) {
260
+ // recalculate the grid data
261
+ var xp = this._xaxis.series_u2p;
262
+ var yp = this._yaxis.series_u2p;
263
+ var gd = [];
264
+ var radii = [];
265
+ this.radii = [];
266
+ var dim = Math.min(plot._height, plot._width);
267
+ for (var i=0; i<data.length; i++) {
268
+ if (data[i] != null) {
269
+ gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1]), data[i][2]]);
270
+ radii.push(data[i][2]);
271
+ this.radii.push([i, data[i][2]]);
272
+ }
273
+ }
274
+ var r, val, maxr = this.maxRadius = arrayMax(radii);
275
+ var l = this.gridData.length;
276
+ if (this.autoscaleBubbles) {
277
+ for (var i=0; i<l; i++) {
278
+ val = radii[i]/maxr;
279
+ r = this.autoscaleMultiplier * dim / 6;
280
+ gd[i][2] = r * val;
281
+ }
282
+ }
283
+ this.radii.sort(function(a, b) { return b[1] - a[1]; });
284
+ return gd;
285
+ };
286
+
287
+ // called with scope of series
288
+ $.jqplot.BubbleRenderer.prototype.draw = function (ctx, gd, options) {
289
+ if (this.plugins.pointLabels) {
290
+ this.plugins.pointLabels.show = false;
291
+ }
292
+ var opts = (options != undefined) ? options : {};
293
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
294
+ this.canvas._elem.empty();
295
+ for (var i=0; i<this.radii.length; i++) {
296
+ var idx = this.radii[i][0];
297
+ var t=null;
298
+ var color = null;
299
+ var el = tel = null;
300
+ var d = this.data[idx];
301
+ var gd = this.gridData[idx];
302
+ if (d[3]) {
303
+ if (typeof(d[3]) == 'object') {
304
+ t = d[3]['label'];
305
+ }
306
+ else if (typeof(d[3]) == 'string') {
307
+ t = d[3];
308
+ }
309
+ }
310
+
311
+ // color = (this.varyBubbleColors) ? this.colorGenerator.get(idx) : this.color;
312
+ color = this.colorGenerator.get(idx);
313
+
314
+ // If we're drawing a shadow, expand the canvas dimensions to accomodate.
315
+ var canvasRadius = gd[2];
316
+ var offset, depth;
317
+ if (this.shadow) {
318
+ offset = (0.7 + gd[2]/40).toFixed(1);
319
+ depth = 1 + Math.ceil(gd[2]/15);
320
+ canvasRadius += offset*depth;
321
+ }
322
+ this.bubbleCanvases[idx] = new $.jqplot.BubbleCanvas();
323
+ this.canvas._elem.append(this.bubbleCanvases[idx].createElement(gd[0], gd[1], canvasRadius));
324
+ this.bubbleCanvases[idx].setContext();
325
+ var ctx = this.bubbleCanvases[idx]._ctx;
326
+ var x = ctx.canvas.width/2;
327
+ var y = ctx.canvas.height/2;
328
+ if (this.shadow) {
329
+ this.renderer.shadowRenderer.draw(ctx, [x, y, gd[2], 0, 2*Math.PI], {offset: offset, depth: depth});
330
+ }
331
+ this.bubbleCanvases[idx].draw(gd[2], color, this.bubbleGradients, this.shadowAngle/180*Math.PI);
332
+
333
+ // now draw label.
334
+ if (t && this.showLabels) {
335
+ tel = $('<div style="position:absolute;" class="jqplot-bubble-label"></div>');
336
+ if (this.escapeHtml) {
337
+ tel.text(t);
338
+ }
339
+ else {
340
+ tel.html(t);
341
+ }
342
+ this.canvas._elem.append(tel);
343
+ var h = $(tel).outerHeight();
344
+ var w = $(tel).outerWidth();
345
+ var top = gd[1] - 0.5*h;
346
+ var left = gd[0] - 0.5*w;
347
+ tel.css({top: top, left: left});
348
+ this.labels[idx] = $(tel);
349
+ }
350
+ }
351
+ };
352
+
353
+
354
+ $.jqplot.DivCanvas = function() {
355
+ $.jqplot.ElemContainer.call(this);
356
+ this._ctx;
357
+ };
358
+
359
+ $.jqplot.DivCanvas.prototype = new $.jqplot.ElemContainer();
360
+ $.jqplot.DivCanvas.prototype.constructor = $.jqplot.DivCanvas;
361
+
362
+ $.jqplot.DivCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
363
+ this._offsets = offsets;
364
+ var klass = 'jqplot-DivCanvas';
365
+ if (clss != undefined) {
366
+ klass = clss;
367
+ }
368
+ var elem;
369
+ // if this canvas already has a dom element, don't make a new one.
370
+ if (this._elem) {
371
+ elem = this._elem.get(0);
372
+ }
373
+ else {
374
+ elem = document.createElement('div');
375
+ }
376
+ // if new plotDimensions supplied, use them.
377
+ if (plotDimensions != undefined) {
378
+ this._plotDimensions = plotDimensions;
379
+ }
380
+
381
+ var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
382
+ var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
383
+ this._elem = $(elem);
384
+ this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
385
+
386
+ this._elem.addClass(klass);
387
+ return this._elem;
388
+ };
389
+
390
+ $.jqplot.DivCanvas.prototype.setContext = function() {
391
+ this._ctx = {
392
+ canvas:{
393
+ width:0,
394
+ height:0
395
+ },
396
+ clearRect:function(){return null;}
397
+ };
398
+ return this._ctx;
399
+ };
400
+
401
+ $.jqplot.BubbleCanvas = function() {
402
+ $.jqplot.ElemContainer.call(this);
403
+ this._ctx;
404
+ };
405
+
406
+ $.jqplot.BubbleCanvas.prototype = new $.jqplot.ElemContainer();
407
+ $.jqplot.BubbleCanvas.prototype.constructor = $.jqplot.BubbleCanvas;
408
+
409
+ // initialize with the x,y pont of bubble center and the bubble radius.
410
+ $.jqplot.BubbleCanvas.prototype.createElement = function(x, y, r) {
411
+ var klass = 'jqplot-bubble-point';
412
+
413
+ var elem;
414
+ // if this canvas already has a dom element, don't make a new one.
415
+ if (this._elem) {
416
+ elem = this._elem.get(0);
417
+ }
418
+ else {
419
+ elem = document.createElement('canvas');
420
+ }
421
+
422
+ elem.width = (r != null) ? 2*r : elem.width;
423
+ elem.height = (r != null) ? 2*r : elem.height;
424
+ this._elem = $(elem);
425
+ var l = (x != null && r != null) ? x - r : this._elem.css('left');
426
+ var t = (y != null && r != null) ? y - r : this._elem.css('top');
427
+ this._elem.css({ position: 'absolute', left: l, top: t });
428
+
429
+ this._elem.addClass(klass);
430
+ if ($.browser.msie) {
431
+ window.G_vmlCanvasManager.init_(document);
432
+ elem = window.G_vmlCanvasManager.initElement(elem);
433
+ }
434
+
435
+ return this._elem;
436
+ };
437
+
438
+ $.jqplot.BubbleCanvas.prototype.draw = function(r, color, gradients, angle) {
439
+ var ctx = this._ctx;
440
+ // r = Math.floor(r*1.04);
441
+ // var x = Math.round(ctx.canvas.width/2);
442
+ // var y = Math.round(ctx.canvas.height/2);
443
+ var x = ctx.canvas.width/2;
444
+ var y = ctx.canvas.height/2;
445
+ ctx.save();
446
+ if (gradients && !$.browser.msie) {
447
+ r = r*1.04;
448
+ var comps = $.jqplot.getColorComponents(color);
449
+ var colorinner = 'rgba('+Math.round(comps[0]+0.8*(255-comps[0]))+', '+Math.round(comps[1]+0.8*(255-comps[1]))+', '+Math.round(comps[2]+0.8*(255-comps[2]))+', '+comps[3]+')';
450
+ var colorend = 'rgba('+comps[0]+', '+comps[1]+', '+comps[2]+', 0)';
451
+ // var rinner = Math.round(0.35 * r);
452
+ // var xinner = Math.round(x - Math.cos(angle) * 0.33 * r);
453
+ // var yinner = Math.round(y - Math.sin(angle) * 0.33 * r);
454
+ var rinner = 0.35 * r;
455
+ var xinner = x - Math.cos(angle) * 0.33 * r;
456
+ var yinner = y - Math.sin(angle) * 0.33 * r;
457
+ var radgrad = ctx.createRadialGradient(xinner, yinner, rinner, x, y, r);
458
+ radgrad.addColorStop(0, colorinner);
459
+ radgrad.addColorStop(0.93, color);
460
+ radgrad.addColorStop(0.96, colorend);
461
+ radgrad.addColorStop(1, colorend);
462
+ // radgrad.addColorStop(.98, colorend);
463
+ ctx.fillStyle = radgrad;
464
+ ctx.fillRect(0,0, ctx.canvas.width, ctx.canvas.height);
465
+ }
466
+ else {
467
+ ctx.fillStyle = color;
468
+ ctx.strokeStyle = color;
469
+ ctx.lineWidth = 1;
470
+ ctx.beginPath();
471
+ var ang = 2*Math.PI;
472
+ ctx.arc(x, y, r, 0, ang, 0);
473
+ ctx.closePath();
474
+ ctx.fill();
475
+ }
476
+ ctx.restore();
477
+ };
478
+
479
+ $.jqplot.BubbleCanvas.prototype.setContext = function() {
480
+ this._ctx = this._elem.get(0).getContext("2d");
481
+ return this._ctx;
482
+ };
483
+
484
+ $.jqplot.BubbleAxisRenderer = function() {
485
+ $.jqplot.LinearAxisRenderer.call(this);
486
+ };
487
+
488
+ $.jqplot.BubbleAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
489
+ $.jqplot.BubbleAxisRenderer.prototype.constructor = $.jqplot.BubbleAxisRenderer;
490
+
491
+ // called with scope of axis object.
492
+ $.jqplot.BubbleAxisRenderer.prototype.init = function(options){
493
+ $.extend(true, this, options);
494
+ var db = this._dataBounds;
495
+ var minsidx=minpidx=maxsids=maxpidx=maxr=minr=minMaxRadius=maxMaxRadius=maxMult=minMult=0;
496
+ // Go through all the series attached to this axis and find
497
+ // the min/max bounds for this axis.
498
+ for (var i=0; i<this._series.length; i++) {
499
+ var s = this._series[i];
500
+ var d = s._plotData;
501
+
502
+ for (var j=0; j<d.length; j++) {
503
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
504
+ if (d[j][0] < db.min || db.min == null) {
505
+ db.min = d[j][0];
506
+ minsidx=i;
507
+ minpidx=j;
508
+ minr = d[j][2];
509
+ minMaxRadius = s.maxRadius;
510
+ minMult = s.autoscaleMultiplier;
511
+ }
512
+ if (d[j][0] > db.max || db.max == null) {
513
+ db.max = d[j][0];
514
+ maxsidx=i;
515
+ maxpidx=j;
516
+ maxr = d[j][2];
517
+ maxMaxRadius = s.maxRadius;
518
+ maxMult = s.autoscaleMultiplier;
519
+ }
520
+ }
521
+ else {
522
+ if (d[j][1] < db.min || db.min == null) {
523
+ db.min = d[j][1];
524
+ minsidx=i;
525
+ minpidx=j;
526
+ minr = d[j][2];
527
+ minMaxRadius = s.maxRadius;
528
+ minMult = s.autoscaleMultiplier;
529
+ }
530
+ if (d[j][1] > db.max || db.max == null) {
531
+ db.max = d[j][1];
532
+ maxsidx=i;
533
+ maxpidx=j;
534
+ maxr = d[j][2];
535
+ maxMaxRadius = s.maxRadius;
536
+ maxMult = s.autoscaleMultiplier;
537
+ }
538
+ }
539
+ }
540
+ }
541
+
542
+ var minRatio = minr/minMaxRadius;
543
+ var maxRatio = maxr/maxMaxRadius;
544
+
545
+ // need to estimate the effect of the radius on total axis span and adjust axis accordingly.
546
+ var span = db.max - db.min;
547
+ // var dim = (this.name == 'xaxis' || this.name == 'x2axis') ? this._plotDimensions.width : this._plotDimensions.height;
548
+ var dim = Math.min(this._plotDimensions.width, this._plotDimensions.height);
549
+
550
+ var minfact = minRatio * minMult/3 * span;
551
+ var maxfact = maxRatio * maxMult/3 * span;
552
+ db.max += maxfact;
553
+ db.min -= minfact;
554
+ };
555
+
556
+ function highlight (plot, sidx, pidx) {
557
+ plot.plugins.bubbleRenderer.highlightLabelCanvas.empty();
558
+ var s = plot.series[sidx];
559
+ var canvas = plot.plugins.bubbleRenderer.highlightCanvas;
560
+ var ctx = canvas._ctx;
561
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
562
+ s._highlightedPoint = pidx;
563
+ plot.plugins.bubbleRenderer.highlightedSeriesIndex = sidx;
564
+
565
+ var color = s.highlightColorGenerator.get(pidx);
566
+ var x = s.gridData[pidx][0],
567
+ y = s.gridData[pidx][1],
568
+ r = s.gridData[pidx][2];
569
+ ctx.save();
570
+ ctx.fillStyle = color;
571
+ ctx.strokeStyle = color;
572
+ ctx.lineWidth = 1;
573
+ ctx.beginPath();
574
+ ctx.arc(x, y, r, 0, 2*Math.PI, 0);
575
+ ctx.closePath();
576
+ ctx.fill();
577
+ ctx.restore();
578
+ // bring label to front
579
+ if (s.labels[pidx]) {
580
+ plot.plugins.bubbleRenderer.highlightLabel = s.labels[pidx].clone();
581
+ plot.plugins.bubbleRenderer.highlightLabel.appendTo(plot.plugins.bubbleRenderer.highlightLabelCanvas);
582
+ plot.plugins.bubbleRenderer.highlightLabel.addClass('jqplot-bubble-label-highlight');
583
+ }
584
+ }
585
+
586
+ function unhighlight (plot) {
587
+ var canvas = plot.plugins.bubbleRenderer.highlightCanvas;
588
+ var sidx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
589
+ plot.plugins.bubbleRenderer.highlightLabelCanvas.empty();
590
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
591
+ for (var i=0; i<plot.series.length; i++) {
592
+ plot.series[i]._highlightedPoint = null;
593
+ }
594
+ plot.plugins.bubbleRenderer.highlightedSeriesIndex = null;
595
+ plot.target.trigger('jqplotDataUnhighlight');
596
+ }
597
+
598
+
599
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
600
+ if (neighbor) {
601
+ var si = neighbor.seriesIndex;
602
+ var pi = neighbor.pointIndex;
603
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
604
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
605
+ evt1.pageX = ev.pageX;
606
+ evt1.pageY = ev.pageY;
607
+ plot.target.trigger(evt1, ins);
608
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
609
+ var evt = jQuery.Event('jqplotDataHighlight');
610
+ evt.pageX = ev.pageX;
611
+ evt.pageY = ev.pageY;
612
+ plot.target.trigger(evt, ins);
613
+ highlight (plot, ins[0], ins[1]);
614
+ }
615
+ }
616
+ else if (neighbor == null) {
617
+ unhighlight (plot);
618
+ }
619
+ }
620
+
621
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
622
+ if (neighbor) {
623
+ var si = neighbor.seriesIndex;
624
+ var pi = neighbor.pointIndex;
625
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
626
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
627
+ var evt = jQuery.Event('jqplotDataHighlight');
628
+ evt.pageX = ev.pageX;
629
+ evt.pageY = ev.pageY;
630
+ plot.target.trigger(evt, ins);
631
+ highlight (plot, ins[0], ins[1]);
632
+ }
633
+ }
634
+ else if (neighbor == null) {
635
+ unhighlight (plot);
636
+ }
637
+ }
638
+
639
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
640
+ var idx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
641
+ if (idx != null && plot.series[idx].highlightMouseDown) {
642
+ unhighlight(plot);
643
+ }
644
+ }
645
+
646
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
647
+ if (neighbor) {
648
+ var si = neighbor.seriesIndex;
649
+ var pi = neighbor.pointIndex;
650
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
651
+ var evt = jQuery.Event('jqplotDataClick');
652
+ evt.pageX = ev.pageX;
653
+ evt.pageY = ev.pageY;
654
+ plot.target.trigger(evt, ins);
655
+ }
656
+ }
657
+
658
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
659
+ if (neighbor) {
660
+ var si = neighbor.seriesIndex;
661
+ var pi = neighbor.pointIndex;
662
+ var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
663
+ var idx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
664
+ if (idx != null && plot.series[idx].highlightMouseDown) {
665
+ unhighlight(plot);
666
+ }
667
+ var evt = jQuery.Event('jqplotDataRightClick');
668
+ evt.pageX = ev.pageX;
669
+ evt.pageY = ev.pageY;
670
+ plot.target.trigger(evt, ins);
671
+ }
672
+ }
673
+
674
+ // called within context of plot
675
+ // create a canvas which we can draw on.
676
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
677
+ function postPlotDraw() {
678
+ this.plugins.bubbleRenderer = {highlightedSeriesIndex:null};
679
+ this.plugins.bubbleRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
680
+ this.plugins.bubbleRenderer.highlightLabel = null;
681
+ this.plugins.bubbleRenderer.highlightLabelCanvas = $('<div style="position:absolute;"></div>');
682
+ var top = this._gridPadding.top;
683
+ var left = this._gridPadding.left;
684
+ var width = this._plotDimensions.width - this._gridPadding.left - this._gridPadding.right;
685
+ var height = this._plotDimensions.height - this._gridPadding.top - this._gridPadding.bottom;
686
+ this.plugins.bubbleRenderer.highlightLabelCanvas.css({top:top, left:left, width:width+'px', height:height+'px'});
687
+
688
+ this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-bubbleRenderer-highlight-canvas', this._plotDimensions));
689
+ this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightLabelCanvas);
690
+
691
+ var hctx = this.plugins.bubbleRenderer.highlightCanvas.setContext();
692
+ }
693
+
694
+
695
+ // setup default renderers for axes and legend so user doesn't have to
696
+ // called with scope of plot
697
+ function preInit(target, data, options) {
698
+ options = options || {};
699
+ options.axesDefaults = options.axesDefaults || {};
700
+ options.seriesDefaults = options.seriesDefaults || {};
701
+ // only set these if there is a Bubble series
702
+ var setopts = false;
703
+ if (options.seriesDefaults.renderer == $.jqplot.BubbleRenderer) {
704
+ setopts = true;
705
+ }
706
+ else if (options.series) {
707
+ for (var i=0; i < options.series.length; i++) {
708
+ if (options.series[i].renderer == $.jqplot.BubbleRenderer) {
709
+ setopts = true;
710
+ }
711
+ }
712
+ }
713
+
714
+ if (setopts) {
715
+ options.axesDefaults.renderer = $.jqplot.BubbleAxisRenderer;
716
+ options.sortData = false;
717
+ }
718
+ }
719
+
720
+ $.jqplot.preInitHooks.push(preInit);
721
+
722
+ })(jQuery);
723
+
724
+