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(a){a.jqplot.CategoryAxisRenderer=function(b){a.jqplot.LinearAxisRenderer.call(this);this.sortMergedLabels=false};a.jqplot.CategoryAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.CategoryAxisRenderer.prototype.constructor=a.jqplot.CategoryAxisRenderer;a.jqplot.CategoryAxisRenderer.prototype.init=function(e){this.groups=1;this.groupLabels=[];this._groupLabels=[];this._grouped=false;this._barsPerGroup=null;a.extend(true,this,{tickOptions:{formatString:"%d"}},e);var b=this._dataBounds;for(var f=0;f<this._series.length;f++){var g=this._series[f];if(g.groups){this.groups=g.groups}var h=g.data;for(var c=0;c<h.length;c++){if(this.name=="xaxis"||this.name=="x2axis"){if(h[c][0]<b.min||b.min==null){b.min=h[c][0]}if(h[c][0]>b.max||b.max==null){b.max=h[c][0]}}else{if(h[c][1]<b.min||b.min==null){b.min=h[c][1]}if(h[c][1]>b.max||b.max==null){b.max=h[c][1]}}}}if(this.groupLabels.length){this.groups=this.groupLabels.length}};a.jqplot.CategoryAxisRenderer.prototype.createTicks=function(){var D=this._ticks;var z=this.ticks;var F=this.name;var C=this._dataBounds;var v,A;var q,w;var d,c;var b,x;if(z.length){if(this.groups>1&&!this._grouped){var r=z.length;var p=parseInt(r/this.groups,10);var e=0;for(var x=p;x<r;x+=p){z.splice(x+e,0," ");e++}this._grouped=true}this.min=0.5;this.max=z.length+0.5;var m=this.max-this.min;this.numberTicks=2*z.length+1;for(x=0;x<z.length;x++){b=this.min+2*x*m/(this.numberTicks-1);var h=new this.tickRenderer(this.tickOptions);h.showLabel=false;h.showMark=true;h.setTick(b,this.name);this._ticks.push(h);var h=new this.tickRenderer(this.tickOptions);h.label=z[x];h.showLabel=true;h.showMark=false;h.showGridline=false;h.setTick(b+0.5,this.name);this._ticks.push(h)}var h=new this.tickRenderer(this.tickOptions);h.showLabel=false;h.showMark=true;h.setTick(b+1,this.name);this._ticks.push(h)}else{if(F=="xaxis"||F=="x2axis"){v=this._plotDimensions.width}else{v=this._plotDimensions.height}if(this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}if(this.min!=null&&this.max!=null&&this.tickInterval!=null){if(parseInt((this.max-this.min)/this.tickInterval,10)!=(this.max-this.min)/this.tickInterval){this.tickInterval=null}}var y=[];var B=0;var q=0.5;var w,E;var f=false;for(var x=0;x<this._series.length;x++){var k=this._series[x];for(var u=0;u<k.data.length;u++){if(this.name=="xaxis"||this.name=="x2axis"){E=k.data[u][0]}else{E=k.data[u][1]}if(a.inArray(E,y)==-1){f=true;B+=1;y.push(E)}}}if(f&&this.sortMergedLabels){y.sort(function(l,j){return l-j})}this.ticks=y;for(var x=0;x<this._series.length;x++){var k=this._series[x];for(var u=0;u<k.data.length;u++){if(this.name=="xaxis"||this.name=="x2axis"){E=k.data[u][0]}else{E=k.data[u][1]}var n=a.inArray(E,y)+1;if(this.name=="xaxis"||this.name=="x2axis"){k.data[u][0]=n}else{k.data[u][1]=n}}}if(this.groups>1&&!this._grouped){var r=y.length;var p=parseInt(r/this.groups,10);var e=0;for(var x=p;x<r;x+=p+1){y[x]=" "}this._grouped=true}w=B+0.5;if(this.numberTicks==null){this.numberTicks=2*B+1}var m=w-q;this.min=q;this.max=w;var o=0;var g=parseInt(3+v/20,10);var p=parseInt(B/g,10);if(this.tickInterval==null){this.tickInterval=m/(this.numberTicks-1)}for(var x=0;x<this.numberTicks;x++){b=this.min+x*this.tickInterval;var h=new this.tickRenderer(this.tickOptions);if(x/2==parseInt(x/2,10)){h.showLabel=false;h.showMark=true}else{if(p>0&&o<p){h.showLabel=false;o+=1}else{h.showLabel=true;o=0}h.label=h.formatter(h.formatString,y[(x-1)/2]);h.showMark=false;h.showGridline=false}if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(b,this.name);this._ticks.push(h)}}};a.jqplot.CategoryAxisRenderer.prototype.draw=function(b){if(this.show){this.renderer.createTicks.call(this);var h=0;var c;if(this._elem){this._elem.empty()}this._elem=this._elem||a('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var g=this._label.draw(b);g.appendTo(this._elem)}if(this.showTicks){var f=this._ticks;for(var e=0;e<f.length;e++){var d=f[e];if(d.showLabel&&(!d.isMinorTick||this.showMinorTicks)){var g=d.draw(b);g.appendTo(this._elem)}}}this._groupLabels=[];for(var e=0;e<this.groupLabels.length;e++){var g=a('<div style="position:absolute;" class="jqplot-'+this.name+'-groupLabel"></div>');g.html(this.groupLabels[e]);this._groupLabels.push(g);g.appendTo(this._elem)}}return this._elem};a.jqplot.CategoryAxisRenderer.prototype.set=function(){var e=0;var m;var k=0;var f=0;var d=(this._label==null)?false:this._label.show;if(this.show&&this.showTicks){var n=this._ticks;for(var c=0;c<n.length;c++){var g=n[c];if(g.showLabel&&(!g.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){m=g._elem.outerHeight(true)}else{m=g._elem.outerWidth(true)}if(m>e){e=m}}}var j=0;for(var c=0;c<this._groupLabels.length;c++){var b=this._groupLabels[c];if(this.name=="xaxis"||this.name=="x2axis"){m=b.outerHeight(true)}else{m=b.outerWidth(true)}if(m>j){j=m}}if(d){k=this._label._elem.outerWidth(true);f=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){e+=j+f;this._elem.css({height:e+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){e+=j+f;this._elem.css({height:e+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){e+=j+k;this._elem.css({width:e+"px",left:"0px",top:"0px"});if(d&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",k+"px")}}else{e+=j+k;this._elem.css({width:e+"px",right:"0px",top:"0px"});if(d&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",k+"px")}}}}}};a.jqplot.CategoryAxisRenderer.prototype.pack=function(e,c){var B=this._ticks;var v=this.max;var s=this.min;var n=c.max;var l=c.min;var q=(this._label==null)?false:this._label.show;for(var r in e){this._elem.css(r,e[r])}this._offsets=c;var g=n-l;var k=v-s;this.p2u=function(h){return(h-l)*k/g+s};this.u2p=function(h){return(h-s)*g/k+l};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(h){return(h-s)*g/k};this.series_p2u=function(h){return h*k/g+s}}else{this.series_u2p=function(h){return(h-v)*g/k};this.series_p2u=function(h){return h*k/g+v}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(i=0;i<B.length;i++){var o=B[i];if(o.show&&o.showLabel){var b;if(o.constructor==a.jqplot.CanvasAxisTickRenderer&&o.angle){var z=(this.name=="xaxis")?1:-1;switch(o.labelPosition){case"auto":if(z*o.angle<0){b=-o.getWidth()+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2}else{b=-o._textRenderer.height*Math.sin(o._textRenderer.angle)/2}break;case"end":b=-o.getWidth()+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2;break;case"start":b=-o._textRenderer.height*Math.sin(o._textRenderer.angle)/2;break;case"middle":b=-o.getWidth()/2+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2;break;default:b=-o.getWidth()/2+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2;break}}else{b=-o.getWidth()/2}var C=this.u2p(o.value)+b+"px";o._elem.css("left",C);o.pack()}}var y=["bottom",0];if(q){var m=this._label._elem.outerWidth(true);this._label._elem.css("left",l+g/2-m/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px");y=["bottom",this._label._elem.outerHeight(true)]}else{this._label._elem.css("top","0px");y=["top",this._label._elem.outerHeight(true)]}this._label.pack()}var d=parseInt(this._ticks.length/this.groups,10);for(i=0;i<this._groupLabels.length;i++){var A=0;var f=0;for(var u=i*d;u<=(i+1)*d;u++){if(this._ticks[u]._elem&&this._ticks[u].label!=" "){var o=this._ticks[u]._elem;var r=o.position();A+=r.left+o.outerWidth(true)/2;f++}}A=A/f;this._groupLabels[i].css({left:(A-this._groupLabels[i].outerWidth(true)/2)});this._groupLabels[i].css(y[0],y[1])}}else{for(i=0;i<B.length;i++){var o=B[i];if(o.show&&o.showLabel){var b;if(o.constructor==a.jqplot.CanvasAxisTickRenderer&&o.angle){var z=(this.name=="yaxis")?1:-1;switch(o.labelPosition){case"auto":case"end":if(z*o.angle<0){b=-o._textRenderer.height*Math.cos(-o._textRenderer.angle)/2}else{b=-o.getHeight()+o._textRenderer.height*Math.cos(o._textRenderer.angle)/2}break;case"start":if(o.angle>0){b=-o._textRenderer.height*Math.cos(-o._textRenderer.angle)/2}else{b=-o.getHeight()+o._textRenderer.height*Math.cos(o._textRenderer.angle)/2}break;case"middle":b=-o.getHeight()/2;break;default:b=-o.getHeight()/2;break}}else{b=-o.getHeight()/2}var C=this.u2p(o.value)+b+"px";o._elem.css("top",C);o.pack()}}var y=["left",0];if(q){var x=this._label._elem.outerHeight(true);this._label._elem.css("top",n-g/2-x/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px");y=["left",this._label._elem.outerWidth(true)]}else{this._label._elem.css("right","0px");y=["right",this._label._elem.outerWidth(true)]}this._label.pack()}var d=parseInt(this._ticks.length/this.groups,10);for(i=0;i<this._groupLabels.length;i++){var A=0;var f=0;for(var u=i*d;u<=(i+1)*d;u++){if(this._ticks[u]._elem&&this._ticks[u].label!=" "){var o=this._ticks[u]._elem;var r=o.position();A+=r.top+o.outerHeight()/2;f++}}A=A/f;this._groupLabels[i].css({top:A-this._groupLabels[i].outerHeight()/2});this._groupLabels[i].css(y[0],y[1])}}}}})(jQuery);
@@ -0,0 +1,952 @@
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
+ /**
21
+ * Class: $.jqplot.Cursor
22
+ * Plugin class representing the cursor as displayed on the plot.
23
+ */
24
+ $.jqplot.Cursor = function(options) {
25
+ // Group: Properties
26
+ //
27
+ // prop: style
28
+ // CSS spec for cursor style
29
+ this.style = 'crosshair';
30
+ this.previousCursor = 'auto';
31
+ // prop: show
32
+ // wether to show the cursor or not.
33
+ this.show = $.jqplot.config.enablePlugins;
34
+ // prop: showTooltip
35
+ // show a cursor position tooltip. Location of the tooltip
36
+ // will be controlled by followMouse and tooltipLocation.
37
+ this.showTooltip = true;
38
+ // prop: followMouse
39
+ // Tooltip follows the mouse, it is not at a fixed location.
40
+ // Tooltip will show on the grid at the location given by
41
+ // tooltipLocation, offset from the grid edge by tooltipOffset.
42
+ this.followMouse = false;
43
+ // prop: tooltipLocation
44
+ // Where to position tooltip. If followMouse is true, this is
45
+ // relative to the cursor, otherwise, it is relative to the grid.
46
+ // One of 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
47
+ this.tooltipLocation = 'se';
48
+ // prop: tooltipOffset
49
+ // Pixel offset of tooltip from the grid boudaries or cursor center.
50
+ this.tooltipOffset = 6;
51
+ // prop: showTooltipGridPosition
52
+ // show the grid pixel coordinates of the mouse.
53
+ this.showTooltipGridPosition = false;
54
+ // prop: showTooltipUnitPosition
55
+ // show the unit (data) coordinates of the mouse.
56
+ this.showTooltipUnitPosition = true;
57
+ // prop: showTooltipDataPosition
58
+ // Used with showVerticalLine to show intersecting data points in the tooltip.
59
+ this.showTooltipDataPosition = false;
60
+ // prop: tooltipFormatString
61
+ // sprintf format string for the tooltip.
62
+ // Uses Ash Searle's javascript sprintf implementation
63
+ // found here: http://hexmen.com/blog/2007/03/printf-sprintf/
64
+ // See http://perldoc.perl.org/functions/sprintf.html for reference
65
+ // Note, if showTooltipDataPosition is true, the default tooltipFormatString
66
+ // will be set to the cursorLegendFormatString, not the default given here.
67
+ this.tooltipFormatString = '%.4P, %.4P';
68
+ // prop: useAxesFormatters
69
+ // Use the x and y axes formatters to format the text in the tooltip.
70
+ this.useAxesFormatters = true;
71
+ // prop: tooltipAxisGroups
72
+ // Show position for the specified axes.
73
+ // This is an array like [['xaxis', 'yaxis'], ['xaxis', 'y2axis']]
74
+ // Default is to compute automatically for all visible axes.
75
+ this.tooltipAxisGroups = [];
76
+ // prop: zoom
77
+ // Enable plot zooming.
78
+ this.zoom = false;
79
+ // zoomProxy and zoomTarget properties are not directly set by user.
80
+ // They Will be set through call to zoomProxy method.
81
+ this.zoomProxy = false;
82
+ this.zoomTarget = false;
83
+ // prop: clickReset
84
+ // Will reset plot zoom if single click on plot without drag.
85
+ this.clickReset = false;
86
+ // prop: dblClickReset
87
+ // Will reset plot zoom if double click on plot without drag.
88
+ this.dblClickReset = true;
89
+ // prop: showVerticalLine
90
+ // draw a vertical line across the plot which follows the cursor.
91
+ // When the line is near a data point, a special legend and/or tooltip can
92
+ // be updated with the data values.
93
+ this.showVerticalLine = false;
94
+ // prop: showHorizontalLine
95
+ // draw a horizontal line across the plot which follows the cursor.
96
+ this.showHorizontalLine = false;
97
+ // prop: constrainZoomTo
98
+ // 'none', 'x' or 'y'
99
+ this.constrainZoomTo = 'none';
100
+ // // prop: autoscaleConstraint
101
+ // // when a constrained axis is specified, true will
102
+ // // auatoscale the adjacent axis.
103
+ // this.autoscaleConstraint = true;
104
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
105
+ this._zoom = {start:[], end:[], started: false, zooming:false, isZoomed:false, axes:{start:{}, end:{}}, gridpos:{}, datapos:{}};
106
+ this._tooltipElem;
107
+ this.zoomCanvas;
108
+ this.cursorCanvas;
109
+ // prop: intersectionThreshold
110
+ // pixel distance from data point or marker to consider cursor lines intersecting with point.
111
+ // If data point markers are not shown, this should be >= 1 or will often miss point intersections.
112
+ this.intersectionThreshold = 2;
113
+ // prop: showCursorLegend
114
+ // Replace the plot legend with an enhanced legend displaying intersection information.
115
+ this.showCursorLegend = false;
116
+ // prop: cursorLegendFormatString
117
+ // Format string used in the cursor legend. If showTooltipDataPosition is true,
118
+ // this will also be the default format string used by tooltipFormatString.
119
+ this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString;
120
+ // whether the cursor is over the grid or not.
121
+ this._oldHandlers = {onselectstart: null, ondrag: null, onmousedown: null};
122
+ // prop: constrainOutsideZoom
123
+ // True to limit actual zoom area to edges of grid, even when zooming
124
+ // outside of plot area. That is, can't zoom out by mousing outside plot.
125
+ this.constrainOutsideZoom = true;
126
+ // prop: showTooltipOutsideZoom
127
+ // True will keep updating the tooltip when zooming of the grid.
128
+ this.showTooltipOutsideZoom = false;
129
+ // true if mouse is over grid, false if not.
130
+ this.onGrid = false;
131
+ $.extend(true, this, options);
132
+ };
133
+
134
+ $.jqplot.Cursor.cursorLegendFormatString = '%s x:%s, y:%s';
135
+
136
+ // called with scope of plot
137
+ $.jqplot.Cursor.init = function (target, data, opts){
138
+ // add a cursor attribute to the plot
139
+ var options = opts || {};
140
+ this.plugins.cursor = new $.jqplot.Cursor(options.cursor);
141
+ var c = this.plugins.cursor;
142
+
143
+ if (c.show) {
144
+ $.jqplot.eventListenerHooks.push(['jqplotMouseEnter', handleMouseEnter]);
145
+ $.jqplot.eventListenerHooks.push(['jqplotMouseLeave', handleMouseLeave]);
146
+ $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMouseMove]);
147
+
148
+ if (c.showCursorLegend) {
149
+ opts.legend = opts.legend || {};
150
+ opts.legend.renderer = $.jqplot.CursorLegendRenderer;
151
+ opts.legend.formatString = this.plugins.cursor.cursorLegendFormatString;
152
+ opts.legend.show = true;
153
+ }
154
+
155
+ if (c.zoom) {
156
+ $.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleMouseDown]);
157
+
158
+ if (c.clickReset) {
159
+ $.jqplot.eventListenerHooks.push(['jqplotClick', handleClick]);
160
+ }
161
+
162
+ if (c.dblClickReset) {
163
+ $.jqplot.eventListenerHooks.push(['jqplotDblClick', handleDblClick]);
164
+ }
165
+ }
166
+
167
+ this.resetZoom = function() {
168
+ var axes = this.axes;
169
+ if (!c.zoomProxy) {
170
+ for (var ax in axes) {
171
+ axes[ax].reset();
172
+ }
173
+ this.redraw();
174
+ }
175
+ else {
176
+ var ctx = this.plugins.cursor.zoomCanvas._ctx;
177
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
178
+ }
179
+ this.plugins.cursor._zoom.isZoomed = false;
180
+ this.target.trigger('jqplotResetZoom', [this, this.plugins.cursor]);
181
+ };
182
+
183
+
184
+ if (c.showTooltipDataPosition) {
185
+ c.showTooltipUnitPosition = false;
186
+ c.showTooltipGridPosition = false;
187
+ if (options.cursor.tooltipFormatString == undefined) {
188
+ c.tooltipFormatString = $.jqplot.Cursor.cursorLegendFormatString;
189
+ }
190
+ }
191
+ }
192
+ };
193
+
194
+ // called with context of plot
195
+ $.jqplot.Cursor.postDraw = function() {
196
+ var c = this.plugins.cursor;
197
+ // if (c.zoom) {
198
+ c.zoomCanvas = new $.jqplot.GenericCanvas();
199
+ this.eventCanvas._elem.before(c.zoomCanvas.createElement(this._gridPadding, 'jqplot-zoom-canvas', this._plotDimensions));
200
+ var zctx = c.zoomCanvas.setContext();
201
+ // }
202
+ c._tooltipElem = $('<div class="jqplot-cursor-tooltip" style="position:absolute;display:none"></div>');
203
+ c.zoomCanvas._elem.before(c._tooltipElem);
204
+ if (c.showVerticalLine || c.showHorizontalLine) {
205
+ c.cursorCanvas = new $.jqplot.GenericCanvas();
206
+ this.eventCanvas._elem.before(c.cursorCanvas.createElement(this._gridPadding, 'jqplot-cursor-canvas', this._plotDimensions));
207
+ var zctx = c.cursorCanvas.setContext();
208
+ }
209
+
210
+ // if we are showing the positions in unit coordinates, and no axes groups
211
+ // were specified, create a default set.
212
+ if (c.showTooltipUnitPosition){
213
+ if (c.tooltipAxisGroups.length === 0) {
214
+ var series = this.series;
215
+ var s;
216
+ var temp = [];
217
+ for (var i=0; i<series.length; i++) {
218
+ s = series[i];
219
+ var ax = s.xaxis+','+s.yaxis;
220
+ if ($.inArray(ax, temp) == -1) {
221
+ temp.push(ax);
222
+ }
223
+ }
224
+ for (var i=0; i<temp.length; i++) {
225
+ c.tooltipAxisGroups.push(temp[i].split(','));
226
+ }
227
+ }
228
+ }
229
+ };
230
+
231
+ // Group: methods
232
+ //
233
+ // method: $.jqplot.Cursor.zoomProxy
234
+ // links targetPlot to controllerPlot so that plot zooming of
235
+ // targetPlot will be controlled by zooming on the controllerPlot.
236
+ // controllerPlot will not actually zoom, but acts as an
237
+ // overview plot. Note, the zoom options must be set to true for
238
+ // zoomProxy to work.
239
+ $.jqplot.Cursor.zoomProxy = function(targetPlot, controllerPlot) {
240
+ var tc = targetPlot.plugins.cursor;
241
+ var cc = controllerPlot.plugins.cursor;
242
+ tc.zoomTarget = true;
243
+ tc.zoom = true;
244
+ tc.style = 'auto';
245
+ tc.dblClickReset = false;
246
+ cc.zoom = true;
247
+ cc.zoomProxy = true;
248
+
249
+ controllerPlot.target.bind('jqplotZoom', plotZoom);
250
+ controllerPlot.target.bind('jqplotResetZoom', plotReset);
251
+
252
+ function plotZoom(ev, gridpos, datapos, plot, cursor) {
253
+ tc.doZoom(gridpos, datapos, targetPlot, cursor);
254
+ }
255
+
256
+ function plotReset(ev, plot, cursor) {
257
+ targetPlot.resetZoom();
258
+ }
259
+ };
260
+
261
+ $.jqplot.Cursor.prototype.resetZoom = function(plot, cursor) {
262
+ var axes = plot.axes;
263
+ var cax = cursor._zoom.axes;
264
+ if (!plot.plugins.cursor.zoomProxy && cursor._zoom.isZoomed) {
265
+ for (var ax in axes) {
266
+ axes[ax]._ticks = [];
267
+ axes[ax].min = cax[ax].min;
268
+ axes[ax].max = cax[ax].max;
269
+ axes[ax].numberTicks = cax[ax].numberTicks;
270
+ axes[ax].tickInterval = cax[ax].tickInterval;
271
+ // for date axes
272
+ axes[ax].daTickInterval = cax[ax].daTickInterval;
273
+ }
274
+ plot.redraw();
275
+ cursor._zoom.isZoomed = false;
276
+ }
277
+ else {
278
+ var ctx = cursor.zoomCanvas._ctx;
279
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
280
+ }
281
+ plot.target.trigger('jqplotResetZoom', [plot, cursor]);
282
+ };
283
+
284
+ $.jqplot.Cursor.resetZoom = function(plot) {
285
+ plot.resetZoom();
286
+ };
287
+
288
+ $.jqplot.Cursor.prototype.doZoom = function (gridpos, datapos, plot, cursor) {
289
+ var c = cursor;
290
+ var axes = plot.axes;
291
+ var zaxes = c._zoom.axes;
292
+ var start = zaxes.start;
293
+ var end = zaxes.end;
294
+ var min, max;
295
+ var ctx = plot.plugins.cursor.zoomCanvas._ctx;
296
+ // don't zoom is zoom area is too small (in pixels)
297
+ if ((c.constrainZoomTo == 'none' && Math.abs(gridpos.x - c._zoom.start[0]) > 6 && Math.abs(gridpos.y - c._zoom.start[1]) > 6) || (c.constrainZoomTo == 'x' && Math.abs(gridpos.x - c._zoom.start[0]) > 6) || (c.constrainZoomTo == 'y' && Math.abs(gridpos.y - c._zoom.start[1]) > 6)) {
298
+ if (!plot.plugins.cursor.zoomProxy) {
299
+ for (var ax in datapos) {
300
+ // make a copy of the original axes to revert back.
301
+ if (c._zoom.axes[ax] == undefined) {
302
+ c._zoom.axes[ax] = {};
303
+ c._zoom.axes[ax].numberTicks = axes[ax].numberTicks;
304
+ c._zoom.axes[ax].tickInterval = axes[ax].tickInterval;
305
+ // for date axes...
306
+ c._zoom.axes[ax].daTickInterval = axes[ax].daTickInterval;
307
+ c._zoom.axes[ax].min = axes[ax].min;
308
+ c._zoom.axes[ax].max = axes[ax].max;
309
+ }
310
+ if ((c.constrainZoomTo == 'none') || (c.constrainZoomTo == 'x' && ax.charAt(0) == 'x') || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'y')) {
311
+ dp = datapos[ax];
312
+ if (dp != null) {
313
+ if (dp > start[ax]) {
314
+ axes[ax].min = start[ax];
315
+ axes[ax].max = dp;
316
+ }
317
+ else {
318
+ span = start[ax] - dp;
319
+ axes[ax].max = start[ax];
320
+ axes[ax].min = dp;
321
+ }
322
+ axes[ax].tickInterval = null;
323
+ // for date axes...
324
+ axes[ax].daTickInterval = null;
325
+ axes[ax]._ticks = [];
326
+ }
327
+ }
328
+
329
+ // if ((c.constrainZoomTo == 'x' && ax.charAt(0) == 'y' && c.autoscaleConstraint) || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'x' && c.autoscaleConstraint)) {
330
+ // dp = datapos[ax];
331
+ // if (dp != null) {
332
+ // axes[ax].max == null;
333
+ // axes[ax].min = null;
334
+ // }
335
+ // }
336
+ }
337
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
338
+ plot.redraw();
339
+ c._zoom.isZoomed = true;
340
+ }
341
+ plot.target.trigger('jqplotZoom', [gridpos, datapos, plot, cursor]);
342
+ }
343
+ };
344
+
345
+ $.jqplot.preInitHooks.push($.jqplot.Cursor.init);
346
+ $.jqplot.postDrawHooks.push($.jqplot.Cursor.postDraw);
347
+
348
+ function updateTooltip(gridpos, datapos, plot) {
349
+ var c = plot.plugins.cursor;
350
+ var s = '';
351
+ var addbr = false;
352
+ if (c.showTooltipGridPosition) {
353
+ s = gridpos.x+', '+gridpos.y;
354
+ addbr = true;
355
+ }
356
+ if (c.showTooltipUnitPosition) {
357
+ var g;
358
+ for (var i=0; i<c.tooltipAxisGroups.length; i++) {
359
+ g = c.tooltipAxisGroups[i];
360
+ if (addbr) {
361
+ s += '<br />';
362
+ }
363
+ if (c.useAxesFormatters) {
364
+ var xf = plot.axes[g[0]]._ticks[0].formatter;
365
+ var yf = plot.axes[g[1]]._ticks[0].formatter;
366
+ var xfstr = plot.axes[g[0]]._ticks[0].formatString;
367
+ var yfstr = plot.axes[g[1]]._ticks[0].formatString;
368
+ s += xf(xfstr, datapos[g[0]]) + ', '+ yf(yfstr, datapos[g[1]]);
369
+ }
370
+ else {
371
+ s += $.jqplot.sprintf(c.tooltipFormatString, datapos[g[0]], datapos[g[1]]);
372
+ }
373
+ addbr = true;
374
+ }
375
+ }
376
+
377
+ if (c.showTooltipDataPosition) {
378
+ var series = plot.series;
379
+ var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y);
380
+ var addbr = false;
381
+
382
+ for (var i = 0; i< series.length; i++) {
383
+ if (series[i].show) {
384
+ var idx = series[i].index;
385
+ var label = series[i].label.toString();
386
+ var cellid = $.inArray(idx, ret.indices);
387
+ var sx = undefined;
388
+ var sy = undefined;
389
+ if (cellid != -1) {
390
+ var data = ret.data[cellid].data;
391
+ if (c.useAxesFormatters) {
392
+ var xf = series[i]._xaxis._ticks[0].formatter;
393
+ var yf = series[i]._yaxis._ticks[0].formatter;
394
+ var xfstr = series[i]._xaxis._ticks[0].formatString;
395
+ var yfstr = series[i]._yaxis._ticks[0].formatString;
396
+ sx = xf(xfstr, data[0]);
397
+ sy = yf(yfstr, data[1]);
398
+ }
399
+ else {
400
+ sx = data[0];
401
+ sy = data[1];
402
+ }
403
+ if (addbr) {
404
+ s += '<br />';
405
+ }
406
+ s += $.jqplot.sprintf(c.tooltipFormatString, label, sx, sy);
407
+ addbr = true;
408
+ }
409
+ }
410
+ }
411
+
412
+ }
413
+ c._tooltipElem.html(s);
414
+ }
415
+
416
+ function moveLine(gridpos, plot) {
417
+ var c = plot.plugins.cursor;
418
+ var ctx = c.cursorCanvas._ctx;
419
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
420
+ if (c.showVerticalLine) {
421
+ c.shapeRenderer.draw(ctx, [[gridpos.x, 0], [gridpos.x, ctx.canvas.height]]);
422
+ }
423
+ if (c.showHorizontalLine) {
424
+ c.shapeRenderer.draw(ctx, [[0, gridpos.y], [ctx.canvas.width, gridpos.y]]);
425
+ }
426
+ var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y);
427
+ if (c.showCursorLegend) {
428
+ var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label');
429
+ for (var i=0; i<cells.length; i++) {
430
+ var idx = $(cells[i]).data('seriesIndex');
431
+ var series = plot.series[idx];
432
+ var label = series.label.toString();
433
+ var cellid = $.inArray(idx, ret.indices);
434
+ var sx = undefined;
435
+ var sy = undefined;
436
+ if (cellid != -1) {
437
+ var data = ret.data[cellid].data;
438
+ if (c.useAxesFormatters) {
439
+ var xf = series._xaxis._ticks[0].formatter;
440
+ var yf = series._yaxis._ticks[0].formatter;
441
+ var xfstr = series._xaxis._ticks[0].formatString;
442
+ var yfstr = series._yaxis._ticks[0].formatString;
443
+ sx = xf(xfstr, data[0]);
444
+ sy = yf(yfstr, data[1]);
445
+ }
446
+ else {
447
+ sx = data[0];
448
+ sy = data[1];
449
+ }
450
+ }
451
+ if (plot.legend.escapeHtml) {
452
+ $(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy));
453
+ }
454
+ else {
455
+ $(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy));
456
+ }
457
+ }
458
+ }
459
+ }
460
+
461
+ function getIntersectingPoints(plot, x, y) {
462
+ var ret = {indices:[], data:[]};
463
+ var s, i, d0, d, j, r;
464
+ var threshold;
465
+ var c = plot.plugins.cursor;
466
+ for (var i=0; i<plot.series.length; i++) {
467
+ s = plot.series[i];
468
+ r = s.renderer;
469
+ if (s.show) {
470
+ threshold = c.intersectionThreshold;
471
+ if (s.showMarker) {
472
+ threshold += s.markerRenderer.size/2;
473
+ }
474
+ for (var j=0; j<s.gridData.length; j++) {
475
+ p = s.gridData[j];
476
+ // check vertical line
477
+ if (c.showVerticalLine) {
478
+ if (Math.abs(x-p[0]) <= threshold) {
479
+ ret.indices.push(i);
480
+ ret.data.push({seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]});
481
+ }
482
+ }
483
+ }
484
+ }
485
+ }
486
+ return ret;
487
+ }
488
+
489
+ function moveTooltip(gridpos, plot) {
490
+ var c = plot.plugins.cursor;
491
+ var elem = c._tooltipElem;
492
+ switch (c.tooltipLocation) {
493
+ case 'nw':
494
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
495
+ var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
496
+ break;
497
+ case 'n':
498
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
499
+ var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
500
+ break;
501
+ case 'ne':
502
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
503
+ var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
504
+ break;
505
+ case 'e':
506
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
507
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
508
+ break;
509
+ case 'se':
510
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
511
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
512
+ break;
513
+ case 's':
514
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
515
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
516
+ break;
517
+ case 'sw':
518
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
519
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
520
+ break;
521
+ case 'w':
522
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
523
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
524
+ break;
525
+ default:
526
+ var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
527
+ var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
528
+ break;
529
+ }
530
+
531
+ c._tooltipElem.css('left', x);
532
+ c._tooltipElem.css('top', y);
533
+ }
534
+
535
+ function positionTooltip(plot) {
536
+ // fake a grid for positioning
537
+ var grid = plot._gridPadding;
538
+ var c = plot.plugins.cursor;
539
+ var elem = c._tooltipElem;
540
+ switch (c.tooltipLocation) {
541
+ case 'nw':
542
+ var a = grid.left + c.tooltipOffset;
543
+ var b = grid.top + c.tooltipOffset;
544
+ elem.css('left', a);
545
+ elem.css('top', b);
546
+ break;
547
+ case 'n':
548
+ var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2;
549
+ var b = grid.top + c.tooltipOffset;
550
+ elem.css('left', a);
551
+ elem.css('top', b);
552
+ break;
553
+ case 'ne':
554
+ var a = grid.right + c.tooltipOffset;
555
+ var b = grid.top + c.tooltipOffset;
556
+ elem.css({right:a, top:b});
557
+ break;
558
+ case 'e':
559
+ var a = grid.right + c.tooltipOffset;
560
+ var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2;
561
+ elem.css({right:a, top:b});
562
+ break;
563
+ case 'se':
564
+ var a = grid.right + c.tooltipOffset;
565
+ var b = grid.bottom + c.tooltipOffset;
566
+ elem.css({right:a, bottom:b});
567
+ break;
568
+ case 's':
569
+ var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2;
570
+ var b = grid.bottom + c.tooltipOffset;
571
+ elem.css({left:a, bottom:b});
572
+ break;
573
+ case 'sw':
574
+ var a = grid.left + c.tooltipOffset;
575
+ var b = grid.bottom + c.tooltipOffset;
576
+ elem.css({left:a, bottom:b});
577
+ break;
578
+ case 'w':
579
+ var a = grid.left + c.tooltipOffset;
580
+ var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2;
581
+ elem.css({left:a, top:b});
582
+ break;
583
+ default: // same as 'se'
584
+ var a = grid.right - c.tooltipOffset;
585
+ var b = grid.bottom + c.tooltipOffset;
586
+ elem.css({right:a, bottom:b});
587
+ break;
588
+ }
589
+ }
590
+
591
+ function handleClick (ev, gridpos, datapos, neighbor, plot) {
592
+ ev.preventDefault();
593
+ ev.stopImmediatePropagation();
594
+ var c = plot.plugins.cursor;
595
+ if (c.clickReset) {
596
+ c.resetZoom(plot, c);
597
+ }
598
+ var sel = window.getSelection;
599
+ if (document.selection && document.selection.empty)
600
+ {
601
+ document.selection.empty();
602
+ }
603
+ else if (sel && !sel().isCollapsed) {
604
+ sel().collapse();
605
+ }
606
+ return false;
607
+ }
608
+
609
+ function handleDblClick (ev, gridpos, datapos, neighbor, plot) {
610
+ ev.preventDefault();
611
+ ev.stopImmediatePropagation();
612
+ var c = plot.plugins.cursor;
613
+ if (c.dblClickReset) {
614
+ c.resetZoom(plot, c);
615
+ }
616
+ var sel = window.getSelection;
617
+ if (document.selection && document.selection.empty)
618
+ {
619
+ document.selection.empty();
620
+ }
621
+ else if (sel && !sel().isCollapsed) {
622
+ sel().collapse();
623
+ }
624
+ return false;
625
+ }
626
+
627
+ function handleMouseLeave(ev, gridpos, datapos, neighbor, plot) {
628
+ var c = plot.plugins.cursor;
629
+ c.onGrid = false;
630
+ if (c.show) {
631
+ $(ev.target).css('cursor', c.previousCursor);
632
+ if (c.showTooltip && !(c._zoom.zooming && c.showTooltipOutsideZoom && !c.constrainOutsideZoom)) {
633
+ c._tooltipElem.hide();
634
+ }
635
+ if (c.zoom) {
636
+ c._zoom.gridpos = gridpos;
637
+ c._zoom.datapos = datapos;
638
+ }
639
+ if (c.showVerticalLine || c.showHorizontalLine) {
640
+ var ctx = c.cursorCanvas._ctx;
641
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
642
+ }
643
+ if (c.showCursorLegend) {
644
+ var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label');
645
+ for (var i=0; i<cells.length; i++) {
646
+ var idx = $(cells[i]).data('seriesIndex');
647
+ var series = plot.series[idx];
648
+ var label = series.label.toString();
649
+ if (plot.legend.escapeHtml) {
650
+ $(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined));
651
+ }
652
+ else {
653
+ $(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined));
654
+ }
655
+
656
+ }
657
+ }
658
+ }
659
+ }
660
+
661
+ function handleMouseEnter(ev, gridpos, datapos, neighbor, plot) {
662
+ var c = plot.plugins.cursor;
663
+ c.onGrid = true;
664
+ if (c.show) {
665
+ c.previousCursor = ev.target.style.cursor;
666
+ ev.target.style.cursor = c.style;
667
+ if (c.showTooltip) {
668
+ updateTooltip(gridpos, datapos, plot);
669
+ if (c.followMouse) {
670
+ moveTooltip(gridpos, plot);
671
+ }
672
+ else {
673
+ positionTooltip(plot);
674
+ }
675
+ c._tooltipElem.show();
676
+ }
677
+ if (c.showVerticalLine || c.showHorizontalLine) {
678
+ moveLine(gridpos, plot);
679
+ }
680
+ }
681
+
682
+ }
683
+
684
+ function handleMouseMove(ev, gridpos, datapos, neighbor, plot) {
685
+ var c = plot.plugins.cursor;
686
+ var ctx = c.zoomCanvas._ctx;
687
+ if (c.show) {
688
+ if (c.showTooltip) {
689
+ updateTooltip(gridpos, datapos, plot);
690
+ if (c.followMouse) {
691
+ moveTooltip(gridpos, plot);
692
+ }
693
+ }
694
+ if (c.showVerticalLine || c.showHorizontalLine) {
695
+ moveLine(gridpos, plot);
696
+ }
697
+ }
698
+ }
699
+
700
+ function getEventPosition(ev) {
701
+ var plot = ev.data.plot;
702
+ var go = plot.eventCanvas._elem.offset();
703
+ var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};
704
+ var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null};
705
+ var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];
706
+ var ax = plot.axes;
707
+ var n, axis;
708
+ for (n=11; n>0; n--) {
709
+ axis = an[n-1];
710
+ if (ax[axis].show) {
711
+ dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);
712
+ }
713
+ }
714
+
715
+ return {offsets:go, gridPos:gridPos, dataPos:dataPos};
716
+ }
717
+
718
+ function handleZoomMove(ev) {
719
+ var plot = ev.data.plot;
720
+ var c = plot.plugins.cursor;
721
+ // don't do anything if not on grid.
722
+ if (c.show && c.zoom && c._zoom.started && !c.zoomTarget) {
723
+ var ctx = c.zoomCanvas._ctx;
724
+ var positions = getEventPosition(ev);
725
+ var gridpos = positions.gridPos;
726
+ var datapos = positions.dataPos;
727
+ c._zoom.gridpos = gridpos;
728
+ c._zoom.datapos = datapos;
729
+ c._zoom.zooming = true;
730
+ var xpos = gridpos.x;
731
+ var ypos = gridpos.y;
732
+ var height = ctx.canvas.height;
733
+ var width = ctx.canvas.width;
734
+ if (c.showTooltip && !c.onGrid && c.showTooltipOutsideZoom) {
735
+ updateTooltip(gridpos, datapos, plot);
736
+ if (c.followMouse) {
737
+ moveTooltip(gridpos, plot);
738
+ }
739
+ }
740
+ if (c.constrainZoomTo == 'x') {
741
+ c._zoom.end = [xpos, height];
742
+ }
743
+ else if (c.constrainZoomTo == 'y') {
744
+ c._zoom.end = [width, ypos];
745
+ }
746
+ else {
747
+ c._zoom.end = [xpos, ypos];
748
+ }
749
+ var sel = window.getSelection;
750
+ if (document.selection && document.selection.empty)
751
+ {
752
+ document.selection.empty();
753
+ }
754
+ else if (sel && !sel().isCollapsed) {
755
+ sel().collapse();
756
+ }
757
+ drawZoomBox.call(c);
758
+ }
759
+ }
760
+
761
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
762
+ var c = plot.plugins.cursor;
763
+ $(document).one('mouseup.jqplot_cursor', {plot:plot}, handleMouseUp);
764
+ var axes = plot.axes;
765
+ if (document.onselectstart != undefined) {
766
+ c._oldHandlers.onselectstart = document.onselectstart;
767
+ document.onselectstart = function () { return false; };
768
+ }
769
+ if (document.ondrag != undefined) {
770
+ c._oldHandlers.ondrag = document.ondrag;
771
+ document.ondrag = function () { return false; };
772
+ }
773
+ if (document.onmousedown != undefined) {
774
+ c._oldHandlers.onmousedown = document.onmousedown;
775
+ document.onmousedown = function () { return false; };
776
+ }
777
+ if (c.zoom) {
778
+ if (!c.zoomProxy) {
779
+ var ctx = c.zoomCanvas._ctx;
780
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
781
+ }
782
+ if (c.constrainZoomTo == 'x') {
783
+ c._zoom.start = [gridpos.x, 0];
784
+ }
785
+ else if (c.constrainZoomTo == 'y') {
786
+ c._zoom.start = [0, gridpos.y];
787
+ }
788
+ else {
789
+ c._zoom.start = [gridpos.x, gridpos.y];
790
+ }
791
+ c._zoom.started = true;
792
+ for (var ax in datapos) {
793
+ // get zoom starting position.
794
+ c._zoom.axes.start[ax] = datapos[ax];
795
+ }
796
+ $(document).bind('mousemove.jqplotCursor', {plot:plot}, handleZoomMove);
797
+ }
798
+ }
799
+
800
+ function handleMouseUp(ev) {
801
+ var plot = ev.data.plot;
802
+ var c = plot.plugins.cursor;
803
+ if (c.zoom && c._zoom.zooming && !c.zoomTarget) {
804
+ var xpos = c._zoom.gridpos.x;
805
+ var ypos = c._zoom.gridpos.y;
806
+ var datapos = c._zoom.datapos;
807
+ var height = c.zoomCanvas._ctx.canvas.height;
808
+ var width = c.zoomCanvas._ctx.canvas.width;
809
+ var axes = plot.axes;
810
+
811
+ if (c.constrainOutsideZoom && !c.onGrid) {
812
+ if (xpos < 0) { xpos = 0; }
813
+ else if (xpos > width) { xpos = width; }
814
+ if (ypos < 0) { ypos = 0; }
815
+ else if (ypos > height) { ypos = height; }
816
+
817
+ for (var axis in datapos) {
818
+ if (datapos[axis]) {
819
+ if (axis.charAt(0) == 'x') {
820
+ datapos[axis] = axes[axis].series_p2u(xpos);
821
+ }
822
+ else {
823
+ datapos[axis] = axes[axis].series_p2u(ypos);
824
+ }
825
+ }
826
+ }
827
+ }
828
+
829
+ if (c.constrainZoomTo == 'x') {
830
+ ypos = height;
831
+ }
832
+ else if (c.constrainZoomTo == 'y') {
833
+ xpos = width;
834
+ }
835
+ c._zoom.end = [xpos, ypos];
836
+ c._zoom.gridpos = {x:xpos, y:ypos};
837
+
838
+ c.doZoom(c._zoom.gridpos, datapos, plot, c);
839
+ }
840
+ c._zoom.started = false;
841
+ c._zoom.zooming = false;
842
+
843
+ $(document).unbind('mousemove.jqplotCursor', handleZoomMove);
844
+
845
+ if (document.onselectstart != undefined && c._oldHandlers.onselectstart != null){
846
+ document.onselectstart = c._oldHandlers.onselectstart;
847
+ c._oldHandlers.onselectstart = null;
848
+ }
849
+ if (document.ondrag != undefined && c._oldHandlers.ondrag != null){
850
+ document.ondrag = c._oldHandlers.ondrag;
851
+ c._oldHandlers.ondrag = null;
852
+ }
853
+ if (document.onmousedown != undefined && c._oldHandlers.onmousedown != null){
854
+ document.onmousedown = c._oldHandlers.onmousedown;
855
+ c._oldHandlers.onmousedown = null;
856
+ }
857
+
858
+ }
859
+
860
+ function drawZoomBox() {
861
+ var start = this._zoom.start;
862
+ var end = this._zoom.end;
863
+ var ctx = this.zoomCanvas._ctx;
864
+ var l, t, h, w;
865
+ if (end[0] > start[0]) {
866
+ l = start[0];
867
+ w = end[0] - start[0];
868
+ }
869
+ else {
870
+ l = end[0];
871
+ w = start[0] - end[0];
872
+ }
873
+ if (end[1] > start[1]) {
874
+ t = start[1];
875
+ h = end[1] - start[1];
876
+ }
877
+ else {
878
+ t = end[1];
879
+ h = start[1] - end[1];
880
+ }
881
+ ctx.fillStyle = 'rgba(0,0,0,0.2)';
882
+ ctx.strokeStyle = '#999999';
883
+ ctx.lineWidth = 1.0;
884
+ ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
885
+ ctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height);
886
+ ctx.clearRect(l, t, w, h);
887
+ // IE won't show transparent fill rect, so stroke a rect also.
888
+ ctx.strokeRect(l,t,w,h);
889
+ }
890
+
891
+ $.jqplot.CursorLegendRenderer = function(options) {
892
+ $.jqplot.TableLegendRenderer.call(this, options);
893
+ this.formatString = '%s';
894
+ };
895
+
896
+ $.jqplot.CursorLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
897
+ $.jqplot.CursorLegendRenderer.prototype.constructor = $.jqplot.CursorLegendRenderer;
898
+
899
+ // called in context of a Legend
900
+ $.jqplot.CursorLegendRenderer.prototype.draw = function() {
901
+ if (this.show) {
902
+ var series = this._series;
903
+ // make a table. one line label per row.
904
+ this._elem = $('<table class="jqplot-legend jqplot-cursor-legend" style="position:absolute"></table>');
905
+
906
+ var pad = false;
907
+ for (var i = 0; i< series.length; i++) {
908
+ s = series[i];
909
+ if (s.show) {
910
+ var lt = $.jqplot.sprintf(this.formatString, s.label.toString());
911
+ if (lt) {
912
+ var color = s.color;
913
+ if (s._stack && !s.fill) {
914
+ color = '';
915
+ }
916
+ addrow.call(this, lt, color, pad, i);
917
+ pad = true;
918
+ }
919
+ // let plugins add more rows to legend. Used by trend line plugin.
920
+ for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) {
921
+ var item = $.jqplot.addLegendRowHooks[j].call(this, s);
922
+ if (item) {
923
+ addrow.call(this, item.label, item.color, pad);
924
+ pad = true;
925
+ }
926
+ }
927
+ }
928
+ }
929
+ }
930
+
931
+ function addrow(label, color, pad, idx) {
932
+ var rs = (pad) ? this.rowSpacing : '0';
933
+ var tr = $('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem);
934
+ tr.data('seriesIndex', idx);
935
+ $('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+rs+';">'+
936
+ '<div style="border:1px solid #cccccc;padding:0.2em;">'+
937
+ '<div class="jqplot-cursor-legend-swatch" style="background-color:'+color+';"></div>'+
938
+ '</div></td>').appendTo(tr);
939
+ var td = $('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+rs+';"></td>');
940
+ td.appendTo(tr);
941
+ td.data('seriesIndex', idx);
942
+ if (this.escapeHtml) {
943
+ td.text(label);
944
+ }
945
+ else {
946
+ td.html(label);
947
+ }
948
+ }
949
+ return this._elem;
950
+ };
951
+
952
+ })(jQuery);