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(b){b.jqplot.MekkoRenderer=function(){this.shapeRenderer=new b.jqplot.ShapeRenderer();this.borderColor=null;this.showBorders=true};b.jqplot.MekkoRenderer.prototype.init=function(c,e){this.fill=false;this.fillRect=true;this.strokeRect=true;this.shadow=false;this._xwidth=0;this._xstart=0;b.extend(true,this.renderer,c);var d={lineJoin:"miter",lineCap:"butt",isarc:false,fillRect:this.fillRect,strokeRect:this.strokeRect};this.renderer.shapeRenderer.init(d);e.axes.x2axis._series.push(this)};b.jqplot.MekkoRenderer.prototype.setGridData=function(h){var e=this._xaxis.series_u2p;var c=this._yaxis.series_u2p;var g=this._plotData;this.gridData=[];this._xwidth=e(this._sumy)-e(0);if(this.index>0){this._xstart=h.series[this.index-1]._xstart+h.series[this.index-1]._xwidth}var l=this.canvas.getHeight();var d=0;var k;var j;for(var f=0;f<g.length;f++){if(g[f]!=null){d+=g[f][1];k=l-(d/this._sumy*l);j=g[f][1]/this._sumy*l;this.gridData.push([this._xstart,k,this._xwidth,j])}}};b.jqplot.MekkoRenderer.prototype.makeGridData=function(f,g){var d=this._xaxis.series_u2p;var l=this.canvas.getHeight();var c=0;var j;var h;var k=[];for(var e=0;e<f.length;e++){if(f[e]!=null){c+=f[e][1];j=l-(c/this._sumy*l);h=f[e][1]/this._sumy*l;k.push([this._xstart,j,this._xwidth,h])}}return k};b.jqplot.MekkoRenderer.prototype.draw=function(c,h,d){var e;var g=(d!=undefined)?d:{};var f=(g.showLine!=undefined)?g.showLine:this.showLine;var j=new b.jqplot.ColorGenerator(this.seriesColors);c.save();if(h.length){if(f){for(e=0;e<h.length;e++){g.fillStyle=j.next();if(this.renderer.showBorders){g.strokeStyle=this.renderer.borderColor}else{g.strokeStyle=g.fillStyle}this.renderer.shapeRenderer.draw(c,h[e],g)}}}c.restore()};b.jqplot.MekkoRenderer.prototype.drawShadow=function(c,e,d){};b.jqplot.MekkoLegendRenderer=function(){};b.jqplot.MekkoLegendRenderer.prototype.init=function(c){this.numberRows=null;this.numberColumns=null;this.placement="outside";b.extend(true,this,c)};b.jqplot.MekkoLegendRenderer.prototype.draw=function(){var f=this;if(this.show){var o=this._series;var r="position:absolute;";r+=(this.background)?"background:"+this.background+";":"";r+=(this.border)?"border:"+this.border+";":"";r+=(this.fontSize)?"font-size:"+this.fontSize+";":"";r+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";r+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=b('<table class="jqplot-table-legend" style="'+r+'"></table>');var w=false,n=true,c,l;var p=o[0];var d=new b.jqplot.ColorGenerator(p.seriesColors);if(p.show){var x=p.data;if(this.numberRows){c=this.numberRows;if(!this.numberColumns){l=Math.ceil(x.length/c)}else{l=this.numberColumns}}else{if(this.numberColumns){l=this.numberColumns;c=Math.ceil(x.length/this.numberColumns)}else{c=x.length;l=1}}var v,u,e,h,g,k,m,t;var q=0;for(v=0;v<c;v++){if(n){e=b('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem)}else{e=b('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem)}for(u=0;u<l;u++){if(q<x.length){k=this.labels[q]||x[q][0].toString();t=d.next();if(!n){if(v>0){w=true}else{w=false}}else{if(v==c-1){w=false}else{w=true}}m=(w)?this.rowSpacing:"0";h=b('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+m+';"><div><div class="jqplot-table-legend-swatch" style="border-color:'+t+';"></div></div></td>');g=b('<td class="jqplot-table-legend" style="padding-top:'+m+';"></td>');if(this.escapeHtml){g.text(k)}else{g.html(k)}if(n){g.prependTo(e);h.prependTo(e)}else{h.appendTo(e);g.appendTo(e)}w=true}q++}}}}return this._elem};b.jqplot.MekkoLegendRenderer.prototype.pack=function(f){if(this.show){var e={_top:f.top,_left:f.left,_right:f.right,_bottom:this._plotDimensions.height-f.bottom};if(this.placement=="insideGrid"){switch(this.location){case"nw":var d=e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"ne":var d=f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({right:d,top:c});break;case"e":var d=f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;case"se":var d=f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"sw":var d=e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"w":var d=e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}else{switch(this.location){case"nw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("right",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-e._top+this.yoffset;this._elem.css("left",d);this._elem.css("bottom",c);break;case"ne":var d=this._plotDimensions.width-f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({left:d,top:c});break;case"e":var d=this._plotDimensions.width-f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;case"se":var d=this._plotDimensions.width-f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-f.bottom+this.yoffset;this._elem.css({left:d,top:c});break;case"sw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"w":var d=this._plotDimensions.width-e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}}};function a(g,f,d){d=d||{};d.axesDefaults=d.axesDefaults||{};d.legend=d.legend||{};d.seriesDefaults=d.seriesDefaults||{};var c=false;if(d.seriesDefaults.renderer==b.jqplot.MekkoRenderer){c=true}else{if(d.series){for(var e=0;e<d.series.length;e++){if(d.series[e].renderer==b.jqplot.MekkoRenderer){c=true}}}}if(c){d.axesDefaults.renderer=b.jqplot.MekkoAxisRenderer;d.legend.renderer=b.jqplot.MekkoLegendRenderer;d.legend.preDraw=true}}b.jqplot.preInitHooks.push(a)})(jQuery);
@@ -0,0 +1,1112 @@
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.MeterGaugeRenderer
21
+ * Plugin renderer to draw a meter gauge chart.
22
+ *
23
+ * Data consists of a single series with 1 data point to position the gauge needle.
24
+ *
25
+ * To use this renderer, you need to include the
26
+ * meter gauge renderer plugin, for example:
27
+ *
28
+ * > <script type="text/javascript" src="plugins/jqplot.meterGaugeRenderer.js"></script>
29
+ *
30
+ * Properties described here are passed into the $.jqplot function
31
+ * as options on the series renderer. For example:
32
+ *
33
+ * > plot0 = $.jqplot('chart0',[[18]],{
34
+ * > title: 'Network Speed',
35
+ * > seriesDefaults: {
36
+ * > renderer: $.jqplot.MeterGaugeRenderer,
37
+ * > rendererOptions: {
38
+ * > label: 'MB/s'
39
+ * > }
40
+ * > }
41
+ * > });
42
+ *
43
+ * A meterGauge plot does not support events.
44
+ */
45
+ $.jqplot.MeterGaugeRenderer = function(){
46
+ $.jqplot.LineRenderer.call(this);
47
+ };
48
+
49
+ $.jqplot.MeterGaugeRenderer.prototype = new $.jqplot.LineRenderer();
50
+ $.jqplot.MeterGaugeRenderer.prototype.constructor = $.jqplot.MeterGaugeRenderer;
51
+
52
+ // called with scope of a series
53
+ $.jqplot.MeterGaugeRenderer.prototype.init = function(options) {
54
+ // Group: Properties
55
+ //
56
+ // prop: diameter
57
+ // Outer diameter of the meterGauge, auto computed by default
58
+ this.diameter = null;
59
+ // prop: padding
60
+ // padding between the meterGauge and plot edges, auto
61
+ // calculated by default.
62
+ this.padding = null;
63
+ // prop: shadowOffset
64
+ // offset of the shadow from the gauge ring and offset of
65
+ // each succesive stroke of the shadow from the last.
66
+ this.shadowOffset = 2;
67
+ // prop: shadowAlpha
68
+ // transparency of the shadow (0 = transparent, 1 = opaque)
69
+ this.shadowAlpha = 0.07;
70
+ // prop: shadowDepth
71
+ // number of strokes to apply to the shadow,
72
+ // each stroke offset shadowOffset from the last.
73
+ this.shadowDepth = 4;
74
+ // prop: background
75
+ // background color of the inside of the gauge.
76
+ this.background = "#efefef";
77
+ // prop: ringColor
78
+ // color of the outer ring, hub, and needle of the gauge.
79
+ this.ringColor = "#BBC6D0";
80
+ // needle color not implemented yet.
81
+ this.needleColor = "#C3D3E5";
82
+ // prop: tickColor
83
+ // color of the tick marks around the gauge.
84
+ this.tickColor = "989898";
85
+ // prop: ringWidth
86
+ // width of the ring around the gauge. Auto computed by default.
87
+ this.ringWidth = null;
88
+ // prop: min
89
+ // Minimum value on the gauge. Auto computed by default
90
+ this.min;
91
+ // prop: max
92
+ // Maximum value on the gauge. Auto computed by default
93
+ this.max;
94
+ // prop: ticks
95
+ // Array of tick values. Auto computed by default.
96
+ this.ticks = [];
97
+ // prop: showTicks
98
+ // true to show ticks around gauge.
99
+ this.showTicks = true;
100
+ // prop: showTickLabels
101
+ // true to show tick labels next to ticks.
102
+ this.showTickLabels = true;
103
+ // prop: label
104
+ // A gauge label like 'kph' or 'Volts'
105
+ this.label = null;
106
+ // prop: labelHeightAdjust
107
+ // Number of Pixels to offset the label up (-) or down (+) from its default position.
108
+ this.labelHeightAdjust = 0;
109
+ // prop: labelPosition
110
+ // Where to position the label, either 'inside' or 'bottom'.
111
+ this.labelPosition = 'inside';
112
+ // prop: intervals
113
+ // Array of ranges to be drawn around the gauge.
114
+ // Array of form:
115
+ // > [value1, value2, ...]
116
+ // indicating the values for the first, second, ... intervals.
117
+ this.intervals = [];
118
+ // prop: intervalColors
119
+ // Array of colors to use for the intervals.
120
+ this.intervalColors = [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"];
121
+ // prop: intervalInnerRadius
122
+ // Radius of the inner circle of the interval ring.
123
+ this.intervalInnerRadius = null;
124
+ // prop: intervalOuterRadius
125
+ // Radius of the outer circle of the interval ring.
126
+ this.intervalOuterRadius = null;
127
+ this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
128
+ // ticks spaced every 1, 2, 2.5, 5, 10, 20, .1, .2, .25, .5, etc.
129
+ this.tickPositions = [1, 2, 2.5, 5, 10];
130
+ // prop: tickSpacing
131
+ // Degrees between ticks. This is a target number, if
132
+ // incompatible span and ticks are supplied, a suitable
133
+ // spacing close to this value will be computed.
134
+ this.tickSpacing = 30;
135
+ this.numberMinorTicks = null;
136
+ // prop: hubRadius
137
+ // Radius of the hub at the bottom center of gauge which the needle attaches to.
138
+ // Auto computed by default
139
+ this.hubRadius = null;
140
+ // prop: tickPadding
141
+ // padding of the tick marks to the outer ring and the tick labels to marks.
142
+ // Auto computed by default.
143
+ this.tickPadding = null;
144
+ // prop: needleThickness
145
+ // Maximum thickness the needle. Auto computed by default.
146
+ this.needleThickness = null;
147
+ // prop: needlePad
148
+ // Padding between needle and inner edge of the ring when the needle is at the min or max gauge value.
149
+ this.needlePad = 6;
150
+ // prop: pegNeedle
151
+ // True will stop needle just below/above the min/max values if data is below/above min/max,
152
+ // as if the meter is "pegged".
153
+ this.pegNeedle = true;
154
+
155
+ $.extend(true, this, options);
156
+ this.type = null;
157
+ this.numberTicks = null;
158
+ this.tickInterval = null;
159
+ // span, the sweep (in degrees) from min to max. This gauge is
160
+ // a semi-circle.
161
+ this.span = 180;
162
+ // get rid of this nonsense
163
+ // this.innerSpan = this.span;
164
+ if (this.type == 'circular') {
165
+ this.semiCircular = false;
166
+ }
167
+ else if (this.type != 'circular') {
168
+ this.semiCircular = true;
169
+ }
170
+ else {
171
+ this.semiCircular = (this.span <= 180) ? true : false;
172
+ }
173
+ this._tickPoints = [];
174
+ // reference to label element.
175
+ this._labelElm = null;
176
+
177
+ // start the gauge at the beginning of the span
178
+ this.startAngle = (90 + (360 - this.span)/2) * Math.PI/180;
179
+ this.endAngle = (90 - (360 - this.span)/2) * Math.PI/180;
180
+
181
+ this.setmin = !!(this.min == null);
182
+ this.setmax = !!(this.max == null);
183
+
184
+ // if given intervals and is an array of values, create labels and colors.
185
+ if (this.intervals.length) {
186
+ if (this.intervals[0].length == null || this.intervals.length == 1) {
187
+ for (var i=0; i<this.intervals.length; i++) {
188
+ this.intervals[i] = [this.intervals[i], this.intervals[i], this.intervalColors[i]];
189
+ }
190
+ }
191
+ else if (this.intervals[0].length == 2) {
192
+ for (i=0; i<this.intervals.length; i++) {
193
+ this.intervals[i] = [this.intervals[i][0], this.intervals[i][1], this.intervalColors[i]];
194
+ }
195
+ }
196
+ }
197
+
198
+ // compute min, max and ticks if not supplied:
199
+ if (this.ticks.length) {
200
+ if (this.ticks[0].length == null || this.ticks[0].length == 1) {
201
+ for (var i=0; i<this.ticks.length; i++) {
202
+ this.ticks[i] = [this.ticks[i], this.ticks[i]];
203
+ }
204
+ }
205
+ this.min = (this.min == null) ? this.ticks[0][0] : this.min;
206
+ this.max = (this.max == null) ? this.ticks[this.ticks.length-1][0] : this.max;
207
+ this.setmin = false;
208
+ this.setmax = false;
209
+ this.numberTicks = this.ticks.length;
210
+ this.tickInterval = this.ticks[1][0] - this.ticks[0][0];
211
+ this.tickFactor = Math.floor(parseFloat((Math.log(this.tickInterval)/Math.log(10)).toFixed(11)));
212
+ // use the first interal to calculate minor ticks;
213
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
214
+ if (!this.numberMinorTicks) {
215
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
216
+ }
217
+ if (!this.numberMinorTicks) {
218
+ this.numberMinorTicks = 1;
219
+ }
220
+ }
221
+
222
+ else if (this.intervals.length) {
223
+ this.min = (this.min == null) ? 0 : this.min;
224
+ this.setmin = false;
225
+ if (this.max == null) {
226
+ if (this.intervals[this.intervals.length-1][0] >= this.data[0][1]) {
227
+ this.max = this.intervals[this.intervals.length-1][0];
228
+ this.setmax = false;
229
+ }
230
+ }
231
+ else {
232
+ this.setmax = false;
233
+ }
234
+ }
235
+
236
+ else {
237
+ // no ticks and no intervals supplied, put needle in middle
238
+ this.min = (this.min == null) ? 0 : this.min;
239
+ this.setmin = false;
240
+ if (this.max == null) {
241
+ this.max = this.data[0][1] * 1.25;
242
+ this.setmax = true;
243
+ }
244
+ else {
245
+ this.setmax = false;
246
+ }
247
+ }
248
+ };
249
+
250
+ $.jqplot.MeterGaugeRenderer.prototype.setGridData = function(plot) {
251
+ // set gridData property. This will hold angle in radians of each data point.
252
+ var stack = [];
253
+ var td = [];
254
+ var sa = this.startAngle;
255
+ for (var i=0; i<this.data.length; i++){
256
+ stack.push(this.data[i][1]);
257
+ td.push([this.data[i][0]]);
258
+ if (i>0) {
259
+ stack[i] += stack[i-1];
260
+ }
261
+ }
262
+ var fact = Math.PI*2/stack[stack.length - 1];
263
+
264
+ for (var i=0; i<stack.length; i++) {
265
+ td[i][1] = stack[i] * fact;
266
+ }
267
+ this.gridData = td;
268
+ };
269
+
270
+ $.jqplot.MeterGaugeRenderer.prototype.makeGridData = function(data, plot) {
271
+ var stack = [];
272
+ var td = [];
273
+ var sa = this.startAngle;
274
+ for (var i=0; i<data.length; i++){
275
+ stack.push(data[i][1]);
276
+ td.push([data[i][0]]);
277
+ if (i>0) {
278
+ stack[i] += stack[i-1];
279
+ }
280
+ }
281
+ var fact = Math.PI*2/stack[stack.length - 1];
282
+
283
+ for (var i=0; i<stack.length; i++) {
284
+ td[i][1] = stack[i] * fact;
285
+ }
286
+ return td;
287
+ };
288
+
289
+
290
+ function getnmt(pos, interval, fact) {
291
+ var temp;
292
+ for (i=pos.length-1; i>=0; i--) {
293
+ temp = interval/(pos[i] * Math.pow(10, fact));
294
+ if (temp == 4 || temp == 5) {
295
+ return temp - 1;
296
+ }
297
+ }
298
+ return null;
299
+ }
300
+
301
+ // called with scope of series
302
+ $.jqplot.MeterGaugeRenderer.prototype.draw = function (ctx, gd, options) {
303
+ var i;
304
+ var opts = (options != undefined) ? options : {};
305
+ // offset and direction of offset due to legend placement
306
+ var offx = 0;
307
+ var offy = 0;
308
+ var trans = 1;
309
+ if (options.legendInfo && options.legendInfo.placement == 'inside') {
310
+ var li = options.legendInfo;
311
+ switch (li.location) {
312
+ case 'nw':
313
+ offx = li.width + li.xoffset;
314
+ break;
315
+ case 'w':
316
+ offx = li.width + li.xoffset;
317
+ break;
318
+ case 'sw':
319
+ offx = li.width + li.xoffset;
320
+ break;
321
+ case 'ne':
322
+ offx = li.width + li.xoffset;
323
+ trans = -1;
324
+ break;
325
+ case 'e':
326
+ offx = li.width + li.xoffset;
327
+ trans = -1;
328
+ break;
329
+ case 'se':
330
+ offx = li.width + li.xoffset;
331
+ trans = -1;
332
+ break;
333
+ case 'n':
334
+ offy = li.height + li.yoffset;
335
+ break;
336
+ case 's':
337
+ offy = li.height + li.yoffset;
338
+ trans = -1;
339
+ break;
340
+ default:
341
+ break;
342
+ }
343
+ }
344
+
345
+
346
+
347
+ // pre-draw so can get it's dimensions.
348
+ if (this.label) {
349
+ this._labelElem = $('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+'</div>');
350
+ this.canvas._elem.after(this._labelElem);
351
+ }
352
+
353
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
354
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
355
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
356
+ var cw = ctx.canvas.width;
357
+ var ch = ctx.canvas.height;
358
+ if (this.padding == null) {
359
+ this.padding = Math.round(Math.min(cw, ch)/30);
360
+ }
361
+ var w = cw - offx - 2 * this.padding;
362
+ var h = ch - offy - 2 * this.padding;
363
+ if (this.labelPosition == 'bottom' && this.label) {
364
+ h -= this._labelElem.outerHeight(true);
365
+ }
366
+ var mindim = Math.min(w,h);
367
+ var d = mindim;
368
+
369
+ if (!this.diameter) {
370
+ if (this.semiCircular) {
371
+ if ( w >= 2*h) {
372
+ if (!this.ringWidth) {
373
+ this.ringWidth = 2*h/35;
374
+ }
375
+ this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
376
+ this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
377
+ this.diameter = 2 * (h - 2*this.innerPad);
378
+ }
379
+ else {
380
+ if (!this.ringWidth) {
381
+ this.ringWidth = w/35;
382
+ }
383
+ this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
384
+ this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
385
+ this.diameter = w - 2*this.innerPad;
386
+ }
387
+ // center taking into account legend and over draw for gauge bottom below hub.
388
+ // this will be center of hub.
389
+ this._center = [(cw - trans * offx)/2 + trans * offx, (ch + trans*offy - this.padding - this.ringWidth - this.innerPad)];
390
+ }
391
+ else {
392
+ if (!this.ringWidth) {
393
+ this.ringWidth = d/35;
394
+ }
395
+ this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
396
+ this.innerPad = 0;
397
+ this.diameter = d - this.ringWidth;
398
+ // center in middle of canvas taking into account legend.
399
+ // will be center of hub.
400
+ this._center = [(cw-trans*offx)/2 + trans * offx, (ch-trans*offy)/2 + trans * offy];
401
+ }
402
+ }
403
+
404
+ if (this._labelElem && this.labelPosition == 'bottom') {
405
+ this._center[1] -= this._labelElem.outerHeight(true);
406
+ }
407
+
408
+ this._radius = this.diameter/2;
409
+
410
+ this.tickSpacing = 6000/this.diameter;
411
+
412
+ if (!this.hubRadius) {
413
+ this.hubRadius = this.diameter/18;
414
+ }
415
+
416
+ this.shadowOffset = 0.5 + this.ringWidth/9;
417
+ this.shadowWidth = this.ringWidth*1;
418
+
419
+ this.tickPadding = 3 + Math.pow(this.diameter/20, 0.7);
420
+ this.tickOuterRadius = this._radius - this.ringWidth/2 - this.tickPadding;
421
+ this.tickLength = (this.showTicks) ? this._radius/13 : 0;
422
+
423
+ if (this.ticks.length == 0) {
424
+ // no ticks, lets make some.
425
+ var max = this.max,
426
+ min = this.min,
427
+ setmax = this.setmax,
428
+ setmin = this.setmin,
429
+ ti = (max - min) * this.tickSpacing / this.span;
430
+ var tf = Math.floor(parseFloat((Math.log(ti)/Math.log(10)).toFixed(11)));
431
+ var tp = (ti/Math.pow(10, tf));
432
+ (tp > 2 && tp <= 2.5) ? tp = 2.5 : tp = Math.ceil(tp);
433
+ var t = this.tickPositions;
434
+ var tpindex, nt;
435
+
436
+ for (i=0; i<t.length; i++) {
437
+ if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
438
+ ti = t[i]*Math.pow(10, tf);
439
+ tpindex = i;
440
+ }
441
+ }
442
+
443
+ for (i=0; i<t.length; i++) {
444
+ if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
445
+ ti = t[i]*Math.pow(10, tf);
446
+ nt = Math.ceil((max - min) / ti);
447
+ }
448
+ }
449
+
450
+ // both max and min are free
451
+ if (setmax && setmin) {
452
+ var tmin = (min > 0) ? min - min % ti : min - min % ti - ti;
453
+ if (!this.forceZero) {
454
+ var diff = Math.min(min - tmin, 0.8*ti);
455
+ var ntp = Math.floor(diff/t[tpindex]);
456
+ if (ntp > 1) {
457
+ tmin = tmin + t[tpindex] * (ntp-1);
458
+ if (parseInt(tmin, 10) != tmin && parseInt(tmin-t[tpindex], 10) == tmin-t[tpindex]) {
459
+ tmin = tmin - t[tpindex];
460
+ }
461
+ }
462
+ }
463
+ if (min == tmin) {
464
+ min -= ti;
465
+ }
466
+ else {
467
+ // tmin should always be lower than dataMin
468
+ if (min - tmin > 0.23*ti) {
469
+ min = tmin;
470
+ }
471
+ else {
472
+ min = tmin -ti;
473
+ nt += 1;
474
+ }
475
+ }
476
+ nt += 1;
477
+ var tmax = min + (nt - 1) * ti;
478
+ if (max >= tmax) {
479
+ tmax += ti;
480
+ nt += 1;
481
+ }
482
+ // now tmax should always be mroe than dataMax
483
+ if (tmax - max < 0.23*ti) {
484
+ tmax += ti;
485
+ nt += 1;
486
+ }
487
+ this.max = max = tmax;
488
+ this.min = min;
489
+
490
+ this.tickInterval = ti;
491
+ this.numberTicks = nt;
492
+ var it;
493
+ for (i=0; i<nt; i++) {
494
+ it = parseFloat((min+i*ti).toFixed(11));
495
+ this.ticks.push([it, it]);
496
+ }
497
+ this.max = this.ticks[nt-1][1];
498
+
499
+ this.tickFactor = tf;
500
+ // determine number of minor ticks
501
+
502
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
503
+
504
+ if (!this.numberMinorTicks) {
505
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
506
+ }
507
+ }
508
+ // max is free, min is fixed
509
+ else if (setmax) {
510
+ var tmax = min + (nt - 1) * ti;
511
+ if (max >= tmax) {
512
+ max = tmax + ti;
513
+ nt += 1;
514
+ }
515
+ else {
516
+ max = tmax;
517
+ }
518
+
519
+ this.tickInterval = this.tickInterval || ti;
520
+ this.numberTicks = this.numberTicks || nt;
521
+ var it;
522
+ for (i=0; i<this.numberTicks; i++) {
523
+ it = parseFloat((min+i*this.tickInterval).toFixed(11));
524
+ this.ticks.push([it, it]);
525
+ }
526
+ this.max = this.ticks[this.numberTicks-1][1];
527
+
528
+ this.tickFactor = tf;
529
+ // determine number of minor ticks
530
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
531
+
532
+ if (!this.numberMinorTicks) {
533
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
534
+ }
535
+ }
536
+
537
+ // not setting max or min
538
+ if (!setmax && !setmin) {
539
+ var range = this.max - this.min;
540
+ tf = Math.floor(parseFloat((Math.log(range)/Math.log(10)).toFixed(11))) - 1;
541
+ var nticks = [5,6,4,7,3], res, numticks;
542
+ for (i=0; i<nticks.length; i++) {
543
+ res = range/(nticks[i]-1)/Math.pow(10, tf);
544
+ if (res == parseInt(res, 10)) {
545
+ this.numberTicks = nticks[i];
546
+ this.tickInterval = range/(this.numberTicks-1);
547
+ this.tickFactor = tf+1;
548
+ break;
549
+ }
550
+ }
551
+ var it;
552
+ for (i=0; i<this.numberTicks; i++) {
553
+ it = parseFloat((this.min+i*this.tickInterval).toFixed(11));
554
+ this.ticks.push([it, it]);
555
+ }
556
+ // determine number of minor ticks
557
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
558
+
559
+ if (!this.numberMinorTicks) {
560
+ this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
561
+ }
562
+
563
+ if (!this.numberMinorTicks) {
564
+ this.numberMinorTicks = 1;
565
+ }
566
+ }
567
+ }
568
+
569
+
570
+ var r = this._radius,
571
+ sa = this.startAngle,
572
+ ea = this.endAngle,
573
+ pi = Math.PI,
574
+ hpi = Math.PI/2;
575
+
576
+ if (this.semiCircular) {
577
+ var overAngle = Math.atan(this.innerPad/r),
578
+ outersa = this.outerStartAngle = sa - overAngle,
579
+ outerea = this.outerEndAngle = ea + overAngle,
580
+ hubsa = this.hubStartAngle = sa - Math.atan(this.innerPad/this.hubRadius*2),
581
+ hubea = this.hubEndAngle = ea + Math.atan(this.innerPad/this.hubRadius*2);
582
+
583
+ ctx.save();
584
+
585
+ ctx.translate(this._center[0], this._center[1]);
586
+ ctx.lineJoin = "round";
587
+ ctx.lineCap = "round";
588
+
589
+ // draw the innerbackground
590
+ ctx.save();
591
+ ctx.beginPath();
592
+ ctx.fillStyle = this.background;
593
+ ctx.arc(0, 0, r, outersa, outerea, false);
594
+ ctx.closePath();
595
+ ctx.fill();
596
+ ctx.restore();
597
+
598
+ // draw the shadow
599
+ // the outer ring.
600
+ var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
601
+ ctx.save();
602
+ for (var i=0; i<this.shadowDepth; i++) {
603
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
604
+ ctx.beginPath();
605
+ ctx.strokeStyle = shadowColor;
606
+ ctx.lineWidth = this.shadowWidth;
607
+ ctx.arc(0 ,0, r, outersa, outerea, false);
608
+ ctx.closePath();
609
+ ctx.stroke();
610
+ }
611
+ ctx.restore();
612
+
613
+ // the inner hub.
614
+ ctx.save();
615
+ var tempd = parseInt((this.shadowDepth+1)/2, 10);
616
+ for (var i=0; i<tempd; i++) {
617
+ ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
618
+ ctx.beginPath();
619
+ ctx.fillStyle = shadowColor;
620
+ ctx.arc(0 ,0, this.hubRadius, hubsa, hubea, false);
621
+ ctx.closePath();
622
+ ctx.fill();
623
+ }
624
+ ctx.restore();
625
+
626
+ // draw the outer ring.
627
+ ctx.save();
628
+ ctx.beginPath();
629
+ ctx.strokeStyle = this.ringColor;
630
+ ctx.lineWidth = this.ringWidth;
631
+ ctx.arc(0 ,0, r, outersa, outerea, false);
632
+ ctx.closePath();
633
+ ctx.stroke();
634
+ ctx.restore();
635
+
636
+ // draw the hub
637
+
638
+ ctx.save();
639
+ ctx.beginPath();
640
+ ctx.fillStyle = this.ringColor;
641
+ ctx.arc(0 ,0, this.hubRadius,hubsa, hubea, false);
642
+ ctx.closePath();
643
+ ctx.fill();
644
+ ctx.restore();
645
+
646
+ // draw the ticks
647
+ if (this.showTicks) {
648
+ ctx.save();
649
+ var orad = this.tickOuterRadius,
650
+ tl = this.tickLength,
651
+ mtl = tl/2,
652
+ nmt = this.numberMinorTicks,
653
+ ts = this.span * Math.PI / 180 / (this.ticks.length-1),
654
+ mts = ts/(nmt + 1);
655
+
656
+ for (i = 0; i<this.ticks.length; i++) {
657
+ ctx.beginPath();
658
+ ctx.lineWidth = 1.5 + this.diameter/360;
659
+ ctx.strokeStyle = this.ringColor;
660
+ var wps = ts*i+sa;
661
+ ctx.moveTo(-orad * Math.cos(ts*i+sa), orad * Math.sin(ts*i+sa));
662
+ ctx.lineTo(-(orad-tl) * Math.cos(ts*i+sa), (orad - tl) * Math.sin(ts*i+sa));
663
+ this._tickPoints.push([(orad-tl) * Math.cos(ts*i+sa) + this._center[0] + this.canvas._offsets.left, (orad - tl) * Math.sin(ts*i+sa) + this._center[1] + this.canvas._offsets.top, ts*i+sa]);
664
+ ctx.stroke();
665
+ ctx.lineWidth = 1.0 + this.diameter/440;
666
+ if (i<this.ticks.length-1) {
667
+ for (var j=1; j<=nmt; j++) {
668
+ ctx.beginPath();
669
+ ctx.moveTo(-orad * Math.cos(ts*i+mts*j+sa), orad * Math.sin(ts*i+mts*j+sa));
670
+ ctx.lineTo(-(orad-mtl) * Math.cos(ts*i+mts*j+sa), (orad-mtl) * Math.sin(ts*i+mts*j+sa));
671
+ ctx.stroke();
672
+ }
673
+ }
674
+ }
675
+ ctx.restore();
676
+ }
677
+
678
+ // draw the tick labels
679
+ if (this.showTickLabels) {
680
+ var elem, l, t, ew, dim, maxdim=0;
681
+ var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
682
+ for (i=0; i<this.ticks.length; i++) {
683
+ elem = $('<div class="jqplot-meterGauge-tick" style="position:absolute;">'+this.ticks[i][1]+'</div>');
684
+ this.canvas._elem.after(elem);
685
+ ew = elem.outerWidth(true);
686
+ eh = elem.outerHeight(true);
687
+ l = this._tickPoints[i][0] - ew * (this._tickPoints[i][2]-Math.PI)/Math.PI - tp * Math.cos(this._tickPoints[i][2]);
688
+ t = this._tickPoints[i][1] - eh/2 + eh/2 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) + tp/3 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) ;
689
+ // t = this._tickPoints[i][1] - eh/2 - eh/2 * Math.sin(this._tickPoints[i][2]) - tp/2 * Math.sin(this._tickPoints[i][2]);
690
+ elem.css({left:l, top:t});
691
+ dim = ew*Math.cos(this._tickPoints[i][2]) + eh*Math.sin(Math.PI/2+this._tickPoints[i][2]/2);
692
+ maxdim = (dim > maxdim) ? dim : maxdim;
693
+ }
694
+ }
695
+
696
+ // draw the gauge label
697
+ if (this.label && this.labelPosition == 'inside') {
698
+ var l = this._center[0] + this.canvas._offsets.left;
699
+ var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
700
+ var t = 0.5*(this._center[1] + this.canvas._offsets.top - this.hubRadius) + 0.5*(this._center[1] + this.canvas._offsets.top - this.tickOuterRadius + this.tickLength + tp) + this.labelHeightAdjust;
701
+ // this._labelElem = $('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+'</div>');
702
+ // this.canvas._elem.after(this._labelElem);
703
+ l -= this._labelElem.outerWidth(true)/2;
704
+ t -= this._labelElem.outerHeight(true)/2;
705
+ this._labelElem.css({left:l, top:t});
706
+ }
707
+
708
+ else if (this.label && this.labelPosition == 'bottom') {
709
+ var l = this._center[0] + this.canvas._offsets.left - this._labelElem.outerWidth(true)/2;
710
+ var t = this._center[1] + this.canvas._offsets.top + this.innerPad + + this.ringWidth + this.padding + this.labelHeightAdjust;
711
+ this._labelElem.css({left:l, top:t});
712
+
713
+ }
714
+
715
+ // draw the intervals
716
+
717
+ ctx.save();
718
+ var inner = this.intervalInnerRadius || this.hubRadius * 1.5;
719
+ if (this.intervalOuterRadius == null) {
720
+ if (this.showTickLabels) {
721
+ var outer = (this.tickOuterRadius - this.tickLength - this.tickPadding - this.diameter/8);
722
+ }
723
+ else {
724
+ var outer = (this.tickOuterRadius - this.tickLength - this.diameter/16);
725
+ }
726
+ }
727
+ else {
728
+ var outer = this.intervalOuterRadius;
729
+ }
730
+ var range = this.max - this.min;
731
+ var intrange = this.intervals[this.intervals.length-1] - this.min;
732
+ var start, end, span = this.span*Math.PI/180;
733
+ for (i=0; i<this.intervals.length; i++) {
734
+ start = (i == 0) ? sa : sa + (this.intervals[i-1][0] - this.min)*span/range;
735
+ if (start < 0) {
736
+ start = 0;
737
+ }
738
+ end = sa + (this.intervals[i][0] - this.min)*span/range;
739
+ if (end < 0) {
740
+ end = 0;
741
+ }
742
+ ctx.beginPath();
743
+ ctx.fillStyle = this.intervals[i][2];
744
+ ctx.arc(0, 0, inner, start, end, false);
745
+ ctx.lineTo(outer*Math.cos(end), outer*Math.sin(end));
746
+ ctx.arc(0, 0, outer, end, start, true);
747
+ ctx.lineTo(inner*Math.cos(start), inner*Math.sin(start));
748
+ ctx.closePath();
749
+ ctx.fill();
750
+ }
751
+ ctx.restore();
752
+
753
+ // draw the needle
754
+ var datapoint = this.data[0][1];
755
+ var dataspan = this.max - this.min;
756
+ if (this.pegNeedle) {
757
+ if (this.data[0][1] > this.max + dataspan*3/this.span) {
758
+ datapoint = this.max + dataspan*3/this.span;
759
+ }
760
+ if (this.data[0][1] < this.min - dataspan*3/this.span) {
761
+ datapoint = this.min - dataspan*3/this.span;
762
+ }
763
+ }
764
+ var dataang = (datapoint - this.min)/dataspan * this.span * Math.PI/180 + this.startAngle;
765
+
766
+
767
+ ctx.save();
768
+ ctx.beginPath();
769
+ ctx.fillStyle = this.ringColor;
770
+ ctx.strokeStyle = this.ringColor;
771
+ this.needleLength = (this.tickOuterRadius - this.tickLength) * 0.85;
772
+ this.needleThickness = (this.needleThickness < 2) ? 2 : this.needleThickness;
773
+ var endwidth = this.needleThickness * 0.4;
774
+
775
+
776
+ var dl = this.needleLength/10;
777
+ var dt = (this.needleThickness - endwidth)/10;
778
+ var templ;
779
+ for (var i=0; i<10; i++) {
780
+ templ = this.needleThickness - i*dt;
781
+ ctx.moveTo(dl*i*Math.cos(dataang), dl*i*Math.sin(dataang));
782
+ ctx.lineWidth = templ;
783
+ ctx.lineTo(dl*(i+1)*Math.cos(dataang), dl*(i+1)*Math.sin(dataang));
784
+ ctx.stroke();
785
+ }
786
+
787
+ ctx.restore();
788
+ }
789
+ else {
790
+ this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
791
+ }
792
+ };
793
+
794
+ $.jqplot.MeterGaugeAxisRenderer = function() {
795
+ $.jqplot.LinearAxisRenderer.call(this);
796
+ };
797
+
798
+ $.jqplot.MeterGaugeAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
799
+ $.jqplot.MeterGaugeAxisRenderer.prototype.constructor = $.jqplot.MeterGaugeAxisRenderer;
800
+
801
+
802
+ // There are no traditional axes on a gauge chart. We just need to provide
803
+ // dummy objects with properties so the plot will render.
804
+ // called with scope of axis object.
805
+ $.jqplot.MeterGaugeAxisRenderer.prototype.init = function(options){
806
+ //
807
+ this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
808
+ $.extend(true, this, options);
809
+ // I don't think I'm going to need _dataBounds here.
810
+ // have to go Axis scaling in a way to fit chart onto plot area
811
+ // and provide u2p and p2u functionality for mouse cursor, etc.
812
+ // for convienence set _dataBounds to 0 and 100 and
813
+ // set min/max to 0 and 100.
814
+ this._dataBounds = {min:0, max:100};
815
+ this.min = 0;
816
+ this.max = 100;
817
+ this.showTicks = false;
818
+ this.ticks = [];
819
+ this.showMark = false;
820
+ this.show = false;
821
+ };
822
+
823
+ $.jqplot.MeterGaugeLegendRenderer = function(){
824
+ $.jqplot.TableLegendRenderer.call(this);
825
+ };
826
+
827
+ $.jqplot.MeterGaugeLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
828
+ $.jqplot.MeterGaugeLegendRenderer.prototype.constructor = $.jqplot.MeterGaugeLegendRenderer;
829
+
830
+ /**
831
+ * Class: $.jqplot.MeterGaugeLegendRenderer
832
+ *Meter gauges don't typically have a legend, this overrides the default legend renderer.
833
+ */
834
+ $.jqplot.MeterGaugeLegendRenderer.prototype.init = function(options) {
835
+
836
+ // Maximum number of rows in the legend. 0 or null for unlimited.
837
+ this.numberRows = null;
838
+ // Maximum number of columns in the legend. 0 or null for unlimited.
839
+ this.numberColumns = null;
840
+ $.extend(true, this, options);
841
+ };
842
+
843
+ // called with context of legend
844
+ $.jqplot.MeterGaugeLegendRenderer.prototype.draw = function() {
845
+ var legend = this;
846
+ if (this.show) {
847
+ var series = this._series;
848
+ var ss = 'position:absolute;';
849
+ ss += (this.background) ? 'background:'+this.background+';' : '';
850
+ ss += (this.border) ? 'border:'+this.border+';' : '';
851
+ ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
852
+ ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
853
+ ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
854
+ ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
855
+ ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
856
+ ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
857
+ ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
858
+ this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
859
+ // MeterGauge charts legends don't go by number of series, but by number of data points
860
+ // in the series. Refactor things here for that.
861
+
862
+ var pad = false,
863
+ reverse = false,
864
+ nr, nc;
865
+ var s = series[0];
866
+
867
+ if (s.show) {
868
+ var pd = s.data;
869
+ if (this.numberRows) {
870
+ nr = this.numberRows;
871
+ if (!this.numberColumns){
872
+ nc = Math.ceil(pd.length/nr);
873
+ }
874
+ else{
875
+ nc = this.numberColumns;
876
+ }
877
+ }
878
+ else if (this.numberColumns) {
879
+ nc = this.numberColumns;
880
+ nr = Math.ceil(pd.length/this.numberColumns);
881
+ }
882
+ else {
883
+ nr = pd.length;
884
+ nc = 1;
885
+ }
886
+
887
+ var i, j, tr, td1, td2, lt, rs, color;
888
+ var idx = 0;
889
+
890
+ for (i=0; i<nr; i++) {
891
+ if (reverse){
892
+ tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
893
+ }
894
+ else{
895
+ tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
896
+ }
897
+ for (j=0; j<nc; j++) {
898
+ if (idx < pd.length){
899
+ lt = this.labels[idx] || pd[idx][0].toString();
900
+ color = colorGenerator.next();
901
+ if (!reverse){
902
+ if (i>0){
903
+ pad = true;
904
+ }
905
+ else{
906
+ pad = false;
907
+ }
908
+ }
909
+ else{
910
+ if (i == nr -1){
911
+ pad = false;
912
+ }
913
+ else{
914
+ pad = true;
915
+ }
916
+ }
917
+ rs = (pad) ? this.rowSpacing : '0';
918
+
919
+ td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
920
+ '<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
921
+ '</div></td>');
922
+ td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
923
+ if (this.escapeHtml){
924
+ td2.text(lt);
925
+ }
926
+ else {
927
+ td2.html(lt);
928
+ }
929
+ if (reverse) {
930
+ td2.prependTo(tr);
931
+ td1.prependTo(tr);
932
+ }
933
+ else {
934
+ td1.appendTo(tr);
935
+ td2.appendTo(tr);
936
+ }
937
+ pad = true;
938
+ }
939
+ idx++;
940
+ }
941
+ }
942
+ }
943
+ }
944
+ return this._elem;
945
+ };
946
+
947
+ // $.jqplot.MeterGaugeLegendRenderer.prototype.pack = function(offsets) {
948
+ // if (this.show) {
949
+ // // fake a grid for positioning
950
+ // var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
951
+ // if (this.placement == 'insideGrid') {
952
+ // switch (this.location) {
953
+ // case 'nw':
954
+ // var a = grid._left + this.xoffset;
955
+ // var b = grid._top + this.yoffset;
956
+ // this._elem.css('left', a);
957
+ // this._elem.css('top', b);
958
+ // break;
959
+ // case 'n':
960
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
961
+ // var b = grid._top + this.yoffset;
962
+ // this._elem.css('left', a);
963
+ // this._elem.css('top', b);
964
+ // break;
965
+ // case 'ne':
966
+ // var a = offsets.right + this.xoffset;
967
+ // var b = grid._top + this.yoffset;
968
+ // this._elem.css({right:a, top:b});
969
+ // break;
970
+ // case 'e':
971
+ // var a = offsets.right + this.xoffset;
972
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
973
+ // this._elem.css({right:a, top:b});
974
+ // break;
975
+ // case 'se':
976
+ // var a = offsets.right + this.xoffset;
977
+ // var b = offsets.bottom + this.yoffset;
978
+ // this._elem.css({right:a, bottom:b});
979
+ // break;
980
+ // case 's':
981
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
982
+ // var b = offsets.bottom + this.yoffset;
983
+ // this._elem.css({left:a, bottom:b});
984
+ // break;
985
+ // case 'sw':
986
+ // var a = grid._left + this.xoffset;
987
+ // var b = offsets.bottom + this.yoffset;
988
+ // this._elem.css({left:a, bottom:b});
989
+ // break;
990
+ // case 'w':
991
+ // var a = grid._left + this.xoffset;
992
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
993
+ // this._elem.css({left:a, top:b});
994
+ // break;
995
+ // default: // same as 'se'
996
+ // var a = grid._right - this.xoffset;
997
+ // var b = grid._bottom + this.yoffset;
998
+ // this._elem.css({right:a, bottom:b});
999
+ // break;
1000
+ // }
1001
+ //
1002
+ // }
1003
+ // else {
1004
+ // switch (this.location) {
1005
+ // case 'nw':
1006
+ // var a = this._plotDimensions.width - grid._left + this.xoffset;
1007
+ // var b = grid._top + this.yoffset;
1008
+ // this._elem.css('right', a);
1009
+ // this._elem.css('top', b);
1010
+ // break;
1011
+ // case 'n':
1012
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
1013
+ // var b = this._plotDimensions.height - grid._top + this.yoffset;
1014
+ // this._elem.css('left', a);
1015
+ // this._elem.css('bottom', b);
1016
+ // break;
1017
+ // case 'ne':
1018
+ // var a = this._plotDimensions.width - offsets.right + this.xoffset;
1019
+ // var b = grid._top + this.yoffset;
1020
+ // this._elem.css({left:a, top:b});
1021
+ // break;
1022
+ // case 'e':
1023
+ // var a = this._plotDimensions.width - offsets.right + this.xoffset;
1024
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
1025
+ // this._elem.css({left:a, top:b});
1026
+ // break;
1027
+ // case 'se':
1028
+ // var a = this._plotDimensions.width - offsets.right + this.xoffset;
1029
+ // var b = offsets.bottom + this.yoffset;
1030
+ // this._elem.css({left:a, bottom:b});
1031
+ // break;
1032
+ // case 's':
1033
+ // var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
1034
+ // var b = this._plotDimensions.height - offsets.bottom + this.yoffset;
1035
+ // this._elem.css({left:a, top:b});
1036
+ // break;
1037
+ // case 'sw':
1038
+ // var a = this._plotDimensions.width - grid._left + this.xoffset;
1039
+ // var b = offsets.bottom + this.yoffset;
1040
+ // this._elem.css({right:a, bottom:b});
1041
+ // break;
1042
+ // case 'w':
1043
+ // var a = this._plotDimensions.width - grid._left + this.xoffset;
1044
+ // var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
1045
+ // this._elem.css({right:a, top:b});
1046
+ // break;
1047
+ // default: // same as 'se'
1048
+ // var a = grid._right - this.xoffset;
1049
+ // var b = grid._bottom + this.yoffset;
1050
+ // this._elem.css({right:a, bottom:b});
1051
+ // break;
1052
+ // }
1053
+ // }
1054
+ // }
1055
+ // };
1056
+
1057
+ // setup default renderers for axes and legend so user doesn't have to
1058
+ // called with scope of plot
1059
+ function preInit(target, data, options) {
1060
+ options = options || {};
1061
+ options.axesDefaults = options.axesDefaults || {};
1062
+ options.legend = options.legend || {};
1063
+ options.seriesDefaults = options.seriesDefaults || {};
1064
+ options.grid = options.grid || {};
1065
+ options.gridPadding = options.gridPadding || {};
1066
+
1067
+ // only set these if there is a gauge series
1068
+ var setopts = false;
1069
+ if (options.seriesDefaults.renderer == $.jqplot.MeterGaugeRenderer) {
1070
+ setopts = true;
1071
+ }
1072
+ else if (options.series) {
1073
+ for (var i=0; i < options.series.length; i++) {
1074
+ if (options.series[i].renderer == $.jqplot.MeterGaugeRenderer) {
1075
+ setopts = true;
1076
+ }
1077
+ }
1078
+ }
1079
+
1080
+ if (setopts) {
1081
+ options.axesDefaults.renderer = $.jqplot.MeterGaugeAxisRenderer;
1082
+ options.legend.renderer = $.jqplot.MeterGaugeLegendRenderer;
1083
+ options.legend.preDraw = true;
1084
+ options.grid.background = options.grid.background || 'white';
1085
+ options.grid.drawGridlines = false;
1086
+ options.grid.borderWidth = (options.grid.borderWidth != null) ? options.grid.borderWidth : 0;
1087
+ options.grid.shadow = (options.grid.shadow != null) ? options.grid.shadow : false;
1088
+ options.gridPadding.top = (options.gridPadding.top != null) ? options.gridPadding.top : 0;
1089
+ options.gridPadding.bottom = (options.gridPadding.bottom != null) ? options.gridPadding.bottom : 0;
1090
+ options.gridPadding.left = (options.gridPadding.left != null) ? options.gridPadding.left : 0;
1091
+ options.gridPadding.right = (options.gridPadding.right != null) ? options.gridPadding.right : 0;
1092
+ }
1093
+ }
1094
+
1095
+ // called with scope of plot
1096
+ function postParseOptions(options) {
1097
+ //
1098
+ }
1099
+
1100
+ $.jqplot.preInitHooks.push(preInit);
1101
+ $.jqplot.postParseOptionsHooks.push(postParseOptions);
1102
+
1103
+ $.jqplot.MeterGaugeTickRenderer = function() {
1104
+ $.jqplot.AxisTickRenderer.call(this);
1105
+ };
1106
+
1107
+ $.jqplot.MeterGaugeTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
1108
+ $.jqplot.MeterGaugeTickRenderer.prototype.constructor = $.jqplot.MeterGaugeTickRenderer;
1109
+
1110
+ })(jQuery);
1111
+
1112
+