reportbuilder 1.2.5 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/Manifest.txt +377 -0
- data/data/flot/API.txt +1024 -0
- data/data/flot/FAQ.txt +71 -0
- data/data/flot/LICENSE.txt +22 -0
- data/data/flot/Makefile +15 -0
- data/data/flot/NEWS.txt +340 -0
- data/data/flot/PLUGINS.txt +105 -0
- data/data/flot/README.txt +81 -0
- data/data/flot/examples/ajax.html +143 -0
- data/data/flot/examples/annotating.html +75 -0
- data/data/flot/examples/arrow-down.gif +0 -0
- data/data/flot/examples/arrow-left.gif +0 -0
- data/data/flot/examples/arrow-right.gif +0 -0
- data/data/flot/examples/arrow-up.gif +0 -0
- data/data/flot/examples/basic.html +38 -0
- data/data/flot/examples/data-eu-gdp-growth-1.json +4 -0
- data/data/flot/examples/data-eu-gdp-growth-2.json +4 -0
- data/data/flot/examples/data-eu-gdp-growth-3.json +4 -0
- data/data/flot/examples/data-eu-gdp-growth-4.json +4 -0
- data/data/flot/examples/data-eu-gdp-growth-5.json +4 -0
- data/data/flot/examples/data-eu-gdp-growth.json +4 -0
- data/data/flot/examples/data-japan-gdp-growth.json +4 -0
- data/data/flot/examples/data-usa-gdp-growth.json +4 -0
- data/data/flot/examples/dual-axis.html +39 -0
- data/data/flot/examples/graph-types.html +75 -0
- data/data/flot/examples/hs-2004-27-a-large_web.jpg +0 -0
- data/data/flot/examples/image.html +45 -0
- data/data/flot/examples/index.html +43 -0
- data/data/flot/examples/interacting.html +93 -0
- data/data/flot/examples/layout.css +6 -0
- data/data/flot/examples/navigate.html +118 -0
- data/data/flot/examples/selection.html +114 -0
- data/data/flot/examples/setting-options.html +65 -0
- data/data/flot/examples/stacking.html +77 -0
- data/data/flot/examples/thresholding.html +54 -0
- data/data/flot/examples/time.html +71 -0
- data/data/flot/examples/tracking.html +95 -0
- data/data/flot/examples/turning-series.html +98 -0
- data/data/flot/examples/visitors.html +90 -0
- data/data/flot/examples/zooming.html +98 -0
- data/data/flot/excanvas.js +1427 -0
- data/data/flot/excanvas.min.js +1 -0
- data/data/flot/jquery.colorhelpers.js +174 -0
- data/data/flot/jquery.colorhelpers.min.js +1 -0
- data/data/flot/jquery.flot.crosshair.js +156 -0
- data/data/flot/jquery.flot.crosshair.min.js +1 -0
- data/data/flot/jquery.flot.image.js +237 -0
- data/data/flot/jquery.flot.image.min.js +1 -0
- data/data/flot/jquery.flot.js +2119 -0
- data/data/flot/jquery.flot.min.js +1 -0
- data/data/flot/jquery.flot.navigate.js +272 -0
- data/data/flot/jquery.flot.navigate.min.js +1 -0
- data/data/flot/jquery.flot.selection.js +299 -0
- data/data/flot/jquery.flot.selection.min.js +1 -0
- data/data/flot/jquery.flot.stack.js +152 -0
- data/data/flot/jquery.flot.stack.min.js +1 -0
- data/data/flot/jquery.flot.threshold.js +103 -0
- data/data/flot/jquery.flot.threshold.min.js +1 -0
- data/data/flot/jquery.js +4376 -0
- data/data/flot/jquery.min.js +19 -0
- data/data/jqplot/MIT-LICENSE.txt +21 -0
- data/data/jqplot/README.txt +73 -0
- data/data/jqplot/changes.txt +261 -0
- data/data/jqplot/copyright.txt +33 -0
- data/data/jqplot/docs/files/MIT-LICENSE-txt.html +39 -0
- data/data/jqplot/docs/files/changes-txt.html +39 -0
- data/data/jqplot/docs/files/gpl-2-0-txt.html +39 -0
- data/data/jqplot/docs/files/images/background.jpg +0 -0
- data/data/jqplot/docs/files/images/basicline.png +0 -0
- data/data/jqplot/docs/files/images/basiclogaxis.png +0 -0
- data/data/jqplot/docs/files/images/basiclogoptions.png +0 -0
- data/data/jqplot/docs/files/images/basicoptions.png +0 -0
- data/data/jqplot/docs/files/images/dualaxis.png +0 -0
- data/data/jqplot/docs/files/images/logo.jpg +0 -0
- data/data/jqplot/docs/files/images/navdocs.png +0 -0
- data/data/jqplot/docs/files/images/navdocsover.png +0 -0
- data/data/jqplot/docs/files/images/navdownload.png +0 -0
- data/data/jqplot/docs/files/images/navdownloadover.png +0 -0
- data/data/jqplot/docs/files/images/navexamples.png +0 -0
- data/data/jqplot/docs/files/images/navexamplesover.png +0 -0
- data/data/jqplot/docs/files/images/navhome.png +0 -0
- data/data/jqplot/docs/files/images/navhomeover.png +0 -0
- data/data/jqplot/docs/files/images/new.png +0 -0
- data/data/jqplot/docs/files/images/sample3.png +0 -0
- data/data/jqplot/docs/files/images/samplesm.png +0 -0
- data/data/jqplot/docs/files/jqPlotCssStyling-txt.html +39 -0
- data/data/jqplot/docs/files/jqPlotOptions-txt.html +292 -0
- data/data/jqplot/docs/files/jqplot-axisLabelRenderer-js.html +47 -0
- data/data/jqplot/docs/files/jqplot-axisTickRenderer-js.html +69 -0
- data/data/jqplot/docs/files/jqplot-canvasGridRenderer-js.html +39 -0
- data/data/jqplot/docs/files/jqplot-core-js.html +353 -0
- data/data/jqplot/docs/files/jqplot-divTitleRenderer-js.html +39 -0
- data/data/jqplot/docs/files/jqplot-lineRenderer-js.html +53 -0
- data/data/jqplot/docs/files/jqplot-linearAxisRenderer-js.html +39 -0
- data/data/jqplot/docs/files/jqplot-markerRenderer-js.html +65 -0
- data/data/jqplot/docs/files/jqplot-shadowRenderer-js.html +61 -0
- data/data/jqplot/docs/files/jqplot-shapeRenderer-js.html +63 -0
- data/data/jqplot/docs/files/jqplot-themeEngine-js.html +190 -0
- data/data/jqplot/docs/files/optionsTutorial-txt.html +119 -0
- data/data/jqplot/docs/files/plugins/jqplot-BezierCurveRenderer-js.html +45 -0
- data/data/jqplot/docs/files/plugins/jqplot-barRenderer-js.html +67 -0
- data/data/jqplot/docs/files/plugins/jqplot-blockRenderer-js.html +53 -0
- data/data/jqplot/docs/files/plugins/jqplot-bubbleRenderer-js.html +71 -0
- data/data/jqplot/docs/files/plugins/jqplot-canvasAxisLabelRenderer-js.html +63 -0
- data/data/jqplot/docs/files/plugins/jqplot-canvasAxisTickRenderer-js.html +79 -0
- data/data/jqplot/docs/files/plugins/jqplot-categoryAxisRenderer-js.html +46 -0
- data/data/jqplot/docs/files/plugins/jqplot-cursor-js.html +91 -0
- data/data/jqplot/docs/files/plugins/jqplot-dateAxisRenderer-js.html +93 -0
- data/data/jqplot/docs/files/plugins/jqplot-donutRenderer-js.html +98 -0
- data/data/jqplot/docs/files/plugins/jqplot-dragable-js.html +45 -0
- data/data/jqplot/docs/files/plugins/jqplot-enhancedLegendRenderer-js.html +49 -0
- data/data/jqplot/docs/files/plugins/jqplot-funnelRenderer-js.html +87 -0
- data/data/jqplot/docs/files/plugins/jqplot-highlighter-js.html +80 -0
- data/data/jqplot/docs/files/plugins/jqplot-logAxisRenderer-js.html +45 -0
- data/data/jqplot/docs/files/plugins/jqplot-mekkoAxisRenderer-js.html +49 -0
- data/data/jqplot/docs/files/plugins/jqplot-mekkoRenderer-js.html +62 -0
- data/data/jqplot/docs/files/plugins/jqplot-meterGaugeRenderer-js.html +103 -0
- data/data/jqplot/docs/files/plugins/jqplot-ohlcRenderer-js.html +65 -0
- data/data/jqplot/docs/files/plugins/jqplot-pieRenderer-js.html +93 -0
- data/data/jqplot/docs/files/plugins/jqplot-pointLabels-js.html +72 -0
- data/data/jqplot/docs/files/plugins/jqplot-trendline-js.html +67 -0
- data/data/jqplot/docs/files/usage-txt.html +58 -0
- data/data/jqplot/docs/index.html +1 -0
- data/data/jqplot/docs/index/Classes.html +58 -0
- data/data/jqplot/docs/index/Files.html +34 -0
- data/data/jqplot/docs/index/Functions.html +66 -0
- data/data/jqplot/docs/index/General.html +46 -0
- data/data/jqplot/docs/index/General2.html +46 -0
- data/data/jqplot/docs/index/General3.html +46 -0
- data/data/jqplot/docs/index/General4.html +50 -0
- data/data/jqplot/docs/index/General5.html +34 -0
- data/data/jqplot/docs/index/General6.html +58 -0
- data/data/jqplot/docs/index/Hooks.html +46 -0
- data/data/jqplot/docs/index/Properties.html +50 -0
- data/data/jqplot/docs/index/Properties2.html +50 -0
- data/data/jqplot/docs/index/Properties3.html +50 -0
- data/data/jqplot/docs/index/Properties4.html +34 -0
- data/data/jqplot/docs/index/Properties5.html +58 -0
- data/data/jqplot/docs/javascript/main.js +836 -0
- data/data/jqplot/docs/javascript/searchdata.js +182 -0
- data/data/jqplot/docs/search/ClassesA.html +20 -0
- data/data/jqplot/docs/search/ClassesG.html +20 -0
- data/data/jqplot/docs/search/ClassesJ.html +20 -0
- data/data/jqplot/docs/search/ClassesL.html +20 -0
- data/data/jqplot/docs/search/ClassesS.html +20 -0
- data/data/jqplot/docs/search/ClassesSymbols.html +20 -0
- data/data/jqplot/docs/search/ClassesT.html +20 -0
- data/data/jqplot/docs/search/FilesJ.html +20 -0
- data/data/jqplot/docs/search/FunctionsC.html +20 -0
- data/data/jqplot/docs/search/FunctionsD.html +20 -0
- data/data/jqplot/docs/search/FunctionsG.html +20 -0
- data/data/jqplot/docs/search/FunctionsI.html +20 -0
- data/data/jqplot/docs/search/FunctionsM.html +20 -0
- data/data/jqplot/docs/search/FunctionsN.html +20 -0
- data/data/jqplot/docs/search/FunctionsR.html +20 -0
- data/data/jqplot/docs/search/FunctionsS.html +20 -0
- data/data/jqplot/docs/search/FunctionsZ.html +20 -0
- data/data/jqplot/docs/search/GeneralA.html +20 -0
- data/data/jqplot/docs/search/GeneralB.html +20 -0
- data/data/jqplot/docs/search/GeneralC.html +20 -0
- data/data/jqplot/docs/search/GeneralD.html +20 -0
- data/data/jqplot/docs/search/GeneralE.html +20 -0
- data/data/jqplot/docs/search/GeneralF.html +20 -0
- data/data/jqplot/docs/search/GeneralG.html +20 -0
- data/data/jqplot/docs/search/GeneralH.html +20 -0
- data/data/jqplot/docs/search/GeneralI.html +20 -0
- data/data/jqplot/docs/search/GeneralJ.html +20 -0
- data/data/jqplot/docs/search/GeneralL.html +20 -0
- data/data/jqplot/docs/search/GeneralM.html +20 -0
- data/data/jqplot/docs/search/GeneralN.html +20 -0
- data/data/jqplot/docs/search/GeneralO.html +20 -0
- data/data/jqplot/docs/search/GeneralP.html +20 -0
- data/data/jqplot/docs/search/GeneralR.html +20 -0
- data/data/jqplot/docs/search/GeneralS.html +20 -0
- data/data/jqplot/docs/search/GeneralSymbols.html +20 -0
- data/data/jqplot/docs/search/GeneralT.html +20 -0
- data/data/jqplot/docs/search/GeneralU.html +20 -0
- data/data/jqplot/docs/search/GeneralV.html +20 -0
- data/data/jqplot/docs/search/GeneralW.html +20 -0
- data/data/jqplot/docs/search/GeneralX.html +20 -0
- data/data/jqplot/docs/search/GeneralY.html +20 -0
- data/data/jqplot/docs/search/GeneralZ.html +20 -0
- data/data/jqplot/docs/search/HooksA.html +20 -0
- data/data/jqplot/docs/search/HooksE.html +20 -0
- data/data/jqplot/docs/search/HooksJ.html +20 -0
- data/data/jqplot/docs/search/HooksP.html +20 -0
- data/data/jqplot/docs/search/NoResults.html +15 -0
- data/data/jqplot/docs/search/PropertiesA.html +20 -0
- data/data/jqplot/docs/search/PropertiesB.html +20 -0
- data/data/jqplot/docs/search/PropertiesC.html +20 -0
- data/data/jqplot/docs/search/PropertiesD.html +20 -0
- data/data/jqplot/docs/search/PropertiesE.html +20 -0
- data/data/jqplot/docs/search/PropertiesF.html +20 -0
- data/data/jqplot/docs/search/PropertiesG.html +20 -0
- data/data/jqplot/docs/search/PropertiesH.html +20 -0
- data/data/jqplot/docs/search/PropertiesI.html +20 -0
- data/data/jqplot/docs/search/PropertiesL.html +20 -0
- data/data/jqplot/docs/search/PropertiesM.html +20 -0
- data/data/jqplot/docs/search/PropertiesN.html +20 -0
- data/data/jqplot/docs/search/PropertiesO.html +20 -0
- data/data/jqplot/docs/search/PropertiesP.html +20 -0
- data/data/jqplot/docs/search/PropertiesR.html +20 -0
- data/data/jqplot/docs/search/PropertiesS.html +20 -0
- data/data/jqplot/docs/search/PropertiesT.html +20 -0
- data/data/jqplot/docs/search/PropertiesU.html +20 -0
- data/data/jqplot/docs/search/PropertiesV.html +20 -0
- data/data/jqplot/docs/search/PropertiesW.html +20 -0
- data/data/jqplot/docs/search/PropertiesX.html +20 -0
- data/data/jqplot/docs/search/PropertiesY.html +20 -0
- data/data/jqplot/docs/search/PropertiesZ.html +20 -0
- data/data/jqplot/docs/styles/1.css +767 -0
- data/data/jqplot/docs/styles/2.css +174 -0
- data/data/jqplot/docs/styles/main.css +2 -0
- data/data/jqplot/examples/.htaccess +1 -0
- data/data/jqplot/examples/OHLC.html +333 -0
- data/data/jqplot/examples/OHLC2.html +193 -0
- data/data/jqplot/examples/area.html +107 -0
- data/data/jqplot/examples/axisLabel.html +117 -0
- data/data/jqplot/examples/axisLabelsRotatedText.html +131 -0
- data/data/jqplot/examples/axisLabelsRotatedText2.html +155 -0
- data/data/jqplot/examples/barLinePieStack.html +198 -0
- data/data/jqplot/examples/barMissingValues.html +64 -0
- data/data/jqplot/examples/barTest.html +283 -0
- data/data/jqplot/examples/barTest2.html +74 -0
- data/data/jqplot/examples/bezierCurve.html +96 -0
- data/data/jqplot/examples/blockPlot.html +149 -0
- data/data/jqplot/examples/bubbleChart2.html +253 -0
- data/data/jqplot/examples/bubblechart.html +69 -0
- data/data/jqplot/examples/catchError.html +53 -0
- data/data/jqplot/examples/categoryHorizontalBar.html +81 -0
- data/data/jqplot/examples/categoryVsLinearAxes.html +74 -0
- data/data/jqplot/examples/chartInTable.html +33 -0
- data/data/jqplot/examples/customHighlighterCursorTrendline.html +72 -0
- data/data/jqplot/examples/customPieTests.html +73 -0
- data/data/jqplot/examples/dataLabels.html +192 -0
- data/data/jqplot/examples/dataTracking.html +91 -0
- data/data/jqplot/examples/donutTest.html +89 -0
- data/data/jqplot/examples/donutTest.js +96 -0
- data/data/jqplot/examples/examples.css +19 -0
- data/data/jqplot/examples/fillToZero.html +126 -0
- data/data/jqplot/examples/filledLine.html +78 -0
- data/data/jqplot/examples/filledLineCategoryAxis.html +80 -0
- data/data/jqplot/examples/funnelTest.html +82 -0
- data/data/jqplot/examples/funnelTest.js +74 -0
- data/data/jqplot/examples/gridCustomization.html +56 -0
- data/data/jqplot/examples/hiddenPlot.html +216 -0
- data/data/jqplot/examples/highlighter.html +95 -0
- data/data/jqplot/examples/highlighter2.html +63 -0
- data/data/jqplot/examples/horizontalLine.html +51 -0
- data/data/jqplot/examples/intticks.html +178 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/data/jqplot/examples/jquery-ui/css/ui-lightness/jquery-ui-1.8.1.custom.css +486 -0
- data/data/jqplot/examples/jquery-ui/js/jquery-1.4.2.min.js +154 -0
- data/data/jqplot/examples/jquery-ui/js/jquery-ui-1.8.1.custom.min.js +756 -0
- data/data/jqplot/examples/legendLabels.html +205 -0
- data/data/jqplot/examples/legendLabels2.html +228 -0
- data/data/jqplot/examples/liz.zip +0 -0
- data/data/jqplot/examples/markerStyles.html +44 -0
- data/data/jqplot/examples/mekkoChart.html +217 -0
- data/data/jqplot/examples/meterGauge.html +132 -0
- data/data/jqplot/examples/meterGauge2.html +158 -0
- data/data/jqplot/examples/minMaxLines.html +61 -0
- data/data/jqplot/examples/missingValues.html +119 -0
- data/data/jqplot/examples/multiAxesRotatedText.html +70 -0
- data/data/jqplot/examples/multipleBarColors.html +149 -0
- data/data/jqplot/examples/multipleLines.html +47 -0
- data/data/jqplot/examples/multipleYAxes.html +85 -0
- data/data/jqplot/examples/nav.inc +35 -0
- data/data/jqplot/examples/pieTest.html +77 -0
- data/data/jqplot/examples/pieTest2.html +87 -0
- data/data/jqplot/examples/pieTest2.js +80 -0
- data/data/jqplot/examples/pieTest3.html +100 -0
- data/data/jqplot/examples/pointLabels.html +94 -0
- data/data/jqplot/examples/pointLabels2.html +47 -0
- data/data/jqplot/examples/prefix.html +90 -0
- data/data/jqplot/examples/resizablePlot.html +150 -0
- data/data/jqplot/examples/rotatedTickLabels.html +61 -0
- data/data/jqplot/examples/rotatedTickLabelsZoom.html +68 -0
- data/data/jqplot/examples/seriesCanvasReorder.html +93 -0
- data/data/jqplot/examples/seriesUpdate.html +123 -0
- data/data/jqplot/examples/shadowTests.html +133 -0
- data/data/jqplot/examples/singlePoint.html +70 -0
- data/data/jqplot/examples/sparkLine.html +48 -0
- data/data/jqplot/examples/stackedBar2.html +104 -0
- data/data/jqplot/examples/stackedBar3.html +76 -0
- data/data/jqplot/examples/stackedBarCategoryVsLinearAxes.html +121 -0
- data/data/jqplot/examples/stackedCategoryAxis.html +89 -0
- data/data/jqplot/examples/stackedFilledLine.html +77 -0
- data/data/jqplot/examples/stackedLine.html +56 -0
- data/data/jqplot/examples/test2.html +64 -0
- data/data/jqplot/examples/theming.html +483 -0
- data/data/jqplot/examples/trendlineDragableCustomization.html +79 -0
- data/data/jqplot/examples/verticalLine.html +52 -0
- data/data/jqplot/examples/waterfall.html +135 -0
- data/data/jqplot/examples/zoom1.html +125 -0
- data/data/jqplot/examples/zoom2.html +73 -0
- data/data/jqplot/examples/zoom3.html +69 -0
- data/data/jqplot/examples/zoomOptions.html +101 -0
- data/data/jqplot/examples/zoomProxy.html +108 -0
- data/data/jqplot/excanvas.js +1416 -0
- data/data/jqplot/excanvas.min.js +35 -0
- data/data/jqplot/gpl-2.0.txt +280 -0
- data/data/jqplot/jqPlotCssStyling.txt +53 -0
- data/data/jqplot/jqPlotOptions.txt +276 -0
- data/data/jqplot/jquery-1.4.1.min.js +152 -0
- data/data/jqplot/jquery-1.4.2.min.js +154 -0
- data/data/jqplot/jquery.jqplot.css +212 -0
- data/data/jqplot/jquery.jqplot.js +7004 -0
- data/data/jqplot/jquery.jqplot.min.css +1 -0
- data/data/jqplot/jquery.jqplot.min.js +34 -0
- data/data/jqplot/optionsTutorial.txt +239 -0
- data/data/jqplot/plugins/jqplot.BezierCurveRenderer.js +300 -0
- data/data/jqplot/plugins/jqplot.BezierCurveRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.barRenderer.js +629 -0
- data/data/jqplot/plugins/jqplot.barRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.blockRenderer.js +221 -0
- data/data/jqplot/plugins/jqplot.blockRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.bubbleRenderer.js +724 -0
- data/data/jqplot/plugins/jqplot.bubbleRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js +187 -0
- data/data/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.canvasAxisTickRenderer.js +226 -0
- data/data/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.canvasTextRenderer.js +408 -0
- data/data/jqplot/plugins/jqplot.canvasTextRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.categoryAxisRenderer.js +630 -0
- data/data/jqplot/plugins/jqplot.categoryAxisRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.cursor.js +952 -0
- data/data/jqplot/plugins/jqplot.cursor.min.js +34 -0
- data/data/jqplot/plugins/jqplot.dateAxisRenderer.js +313 -0
- data/data/jqplot/plugins/jqplot.dateAxisRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.donutRenderer.js +876 -0
- data/data/jqplot/plugins/jqplot.donutRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.dragable.js +206 -0
- data/data/jqplot/plugins/jqplot.dragable.min.js +34 -0
- data/data/jqplot/plugins/jqplot.enhancedLegendRenderer.js +186 -0
- data/data/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.funnelRenderer.js +918 -0
- data/data/jqplot/plugins/jqplot.funnelRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.highlighter.js +374 -0
- data/data/jqplot/plugins/jqplot.highlighter.min.js +34 -0
- data/data/jqplot/plugins/jqplot.logAxisRenderer.js +434 -0
- data/data/jqplot/plugins/jqplot.logAxisRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.mekkoAxisRenderer.js +595 -0
- data/data/jqplot/plugins/jqplot.mekkoAxisRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.mekkoRenderer.js +419 -0
- data/data/jqplot/plugins/jqplot.mekkoRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.meterGaugeRenderer.js +1112 -0
- data/data/jqplot/plugins/jqplot.meterGaugeRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.ohlcRenderer.js +343 -0
- data/data/jqplot/plugins/jqplot.ohlcRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.pieRenderer.js +749 -0
- data/data/jqplot/plugins/jqplot.pieRenderer.min.js +34 -0
- data/data/jqplot/plugins/jqplot.pointLabels.js +325 -0
- data/data/jqplot/plugins/jqplot.pointLabels.min.js +34 -0
- data/data/jqplot/plugins/jqplot.trendline.js +208 -0
- data/data/jqplot/plugins/jqplot.trendline.min.js +34 -0
- data/data/jqplot/usage.txt +119 -0
- data/examples/graph.rb +17 -0
- data/lib/reportbuilder.rb +21 -2
- data/lib/reportbuilder/builder.rb +31 -3
- data/lib/reportbuilder/builder/html.rb +39 -5
- data/lib/reportbuilder/graph.rb +252 -0
- data/lib/reportbuilder/graph/html_flot.rb +149 -0
- data/lib/reportbuilder/graph/html_jqplot.rb +145 -0
- data/lib/reportbuilder/image.rb +178 -78
- data/lib/reportbuilder/table/rtfbuilder.rb +2 -2
- data/test/helper_test.rb +6 -7
- data/test/test_graph.rb +44 -0
- data/test/test_graph_html_flot.rb +36 -0
- data/test/test_graph_html_jqplot.rb +36 -0
- data/test/test_html.rb +4 -7
- data/test/test_image.rb +35 -7
- data/test/test_reportbuilder.rb +4 -6
- data/test/test_table.rb +0 -2
- metadata +402 -7
- 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(j){j.jqplot.Cursor=function(r){this.style="crosshair";this.previousCursor="auto";this.show=j.jqplot.config.enablePlugins;this.showTooltip=true;this.followMouse=false;this.tooltipLocation="se";this.tooltipOffset=6;this.showTooltipGridPosition=false;this.showTooltipUnitPosition=true;this.showTooltipDataPosition=false;this.tooltipFormatString="%.4P, %.4P";this.useAxesFormatters=true;this.tooltipAxisGroups=[];this.zoom=false;this.zoomProxy=false;this.zoomTarget=false;this.clickReset=false;this.dblClickReset=true;this.showVerticalLine=false;this.showHorizontalLine=false;this.constrainZoomTo="none";this.shapeRenderer=new j.jqplot.ShapeRenderer();this._zoom={start:[],end:[],started:false,zooming:false,isZoomed:false,axes:{start:{},end:{}},gridpos:{},datapos:{}};this._tooltipElem;this.zoomCanvas;this.cursorCanvas;this.intersectionThreshold=2;this.showCursorLegend=false;this.cursorLegendFormatString=j.jqplot.Cursor.cursorLegendFormatString;this._oldHandlers={onselectstart:null,ondrag:null,onmousedown:null};this.constrainOutsideZoom=true;this.showTooltipOutsideZoom=false;this.onGrid=false;j.extend(true,this,r)};j.jqplot.Cursor.cursorLegendFormatString="%s x:%s, y:%s";j.jqplot.Cursor.init=function(v,u,t){var r=t||{};this.plugins.cursor=new j.jqplot.Cursor(r.cursor);var w=this.plugins.cursor;if(w.show){j.jqplot.eventListenerHooks.push(["jqplotMouseEnter",b]);j.jqplot.eventListenerHooks.push(["jqplotMouseLeave",f]);j.jqplot.eventListenerHooks.push(["jqplotMouseMove",i]);if(w.showCursorLegend){t.legend=t.legend||{};t.legend.renderer=j.jqplot.CursorLegendRenderer;t.legend.formatString=this.plugins.cursor.cursorLegendFormatString;t.legend.show=true}if(w.zoom){j.jqplot.eventListenerHooks.push(["jqplotMouseDown",a]);if(w.clickReset){j.jqplot.eventListenerHooks.push(["jqplotClick",k])}if(w.dblClickReset){j.jqplot.eventListenerHooks.push(["jqplotDblClick",c])}}this.resetZoom=function(){var z=this.axes;if(!w.zoomProxy){for(var y in z){z[y].reset()}this.redraw()}else{var x=this.plugins.cursor.zoomCanvas._ctx;x.clearRect(0,0,x.canvas.width,x.canvas.height)}this.plugins.cursor._zoom.isZoomed=false;this.target.trigger("jqplotResetZoom",[this,this.plugins.cursor])};if(w.showTooltipDataPosition){w.showTooltipUnitPosition=false;w.showTooltipGridPosition=false;if(r.cursor.tooltipFormatString==undefined){w.tooltipFormatString=j.jqplot.Cursor.cursorLegendFormatString}}}};j.jqplot.Cursor.postDraw=function(){var y=this.plugins.cursor;y.zoomCanvas=new j.jqplot.GenericCanvas();this.eventCanvas._elem.before(y.zoomCanvas.createElement(this._gridPadding,"jqplot-zoom-canvas",this._plotDimensions));var x=y.zoomCanvas.setContext();y._tooltipElem=j('<div class="jqplot-cursor-tooltip" style="position:absolute;display:none"></div>');y.zoomCanvas._elem.before(y._tooltipElem);if(y.showVerticalLine||y.showHorizontalLine){y.cursorCanvas=new j.jqplot.GenericCanvas();this.eventCanvas._elem.before(y.cursorCanvas.createElement(this._gridPadding,"jqplot-cursor-canvas",this._plotDimensions));var x=y.cursorCanvas.setContext()}if(y.showTooltipUnitPosition){if(y.tooltipAxisGroups.length===0){var u=this.series;var v;var r=[];for(var t=0;t<u.length;t++){v=u[t];var w=v.xaxis+","+v.yaxis;if(j.inArray(w,r)==-1){r.push(w)}}for(var t=0;t<r.length;t++){y.tooltipAxisGroups.push(r[t].split(","))}}}};j.jqplot.Cursor.zoomProxy=function(x,t){var r=x.plugins.cursor;var w=t.plugins.cursor;r.zoomTarget=true;r.zoom=true;r.style="auto";r.dblClickReset=false;w.zoom=true;w.zoomProxy=true;t.target.bind("jqplotZoom",v);t.target.bind("jqplotResetZoom",u);function v(z,y,B,A,C){r.doZoom(y,B,x,C)}function u(y,z,A){x.resetZoom()}};j.jqplot.Cursor.prototype.resetZoom=function(w,x){var v=w.axes;var u=x._zoom.axes;if(!w.plugins.cursor.zoomProxy&&x._zoom.isZoomed){for(var t in v){v[t]._ticks=[];v[t].min=u[t].min;v[t].max=u[t].max;v[t].numberTicks=u[t].numberTicks;v[t].tickInterval=u[t].tickInterval;v[t].daTickInterval=u[t].daTickInterval}w.redraw();x._zoom.isZoomed=false}else{var r=x.zoomCanvas._ctx;r.clearRect(0,0,r.canvas.width,r.canvas.height)}w.target.trigger("jqplotResetZoom",[w,x])};j.jqplot.Cursor.resetZoom=function(r){r.resetZoom()};j.jqplot.Cursor.prototype.doZoom=function(y,v,z,D){var B=D;var A=z.axes;var t=B._zoom.axes;var u=t.start;var w=t.end;var x,C;var E=z.plugins.cursor.zoomCanvas._ctx;if((B.constrainZoomTo=="none"&&Math.abs(y.x-B._zoom.start[0])>6&&Math.abs(y.y-B._zoom.start[1])>6)||(B.constrainZoomTo=="x"&&Math.abs(y.x-B._zoom.start[0])>6)||(B.constrainZoomTo=="y"&&Math.abs(y.y-B._zoom.start[1])>6)){if(!z.plugins.cursor.zoomProxy){for(var r in v){if(B._zoom.axes[r]==undefined){B._zoom.axes[r]={};B._zoom.axes[r].numberTicks=A[r].numberTicks;B._zoom.axes[r].tickInterval=A[r].tickInterval;B._zoom.axes[r].daTickInterval=A[r].daTickInterval;B._zoom.axes[r].min=A[r].min;B._zoom.axes[r].max=A[r].max}if((B.constrainZoomTo=="none")||(B.constrainZoomTo=="x"&&r.charAt(0)=="x")||(B.constrainZoomTo=="y"&&r.charAt(0)=="y")){dp=v[r];if(dp!=null){if(dp>u[r]){A[r].min=u[r];A[r].max=dp}else{span=u[r]-dp;A[r].max=u[r];A[r].min=dp}A[r].tickInterval=null;A[r].daTickInterval=null;A[r]._ticks=[]}}}E.clearRect(0,0,E.canvas.width,E.canvas.height);z.redraw();B._zoom.isZoomed=true}z.target.trigger("jqplotZoom",[y,v,z,D])}};j.jqplot.preInitHooks.push(j.jqplot.Cursor.init);j.jqplot.postDrawHooks.push(j.jqplot.Cursor.postDraw);function e(F,t,C){var H=C.plugins.cursor;var x="";var L=false;if(H.showTooltipGridPosition){x=F.x+", "+F.y;L=true}if(H.showTooltipUnitPosition){var E;for(var D=0;D<H.tooltipAxisGroups.length;D++){E=H.tooltipAxisGroups[D];if(L){x+="<br />"}if(H.useAxesFormatters){var B=C.axes[E[0]]._ticks[0].formatter;var r=C.axes[E[1]]._ticks[0].formatter;var I=C.axes[E[0]]._ticks[0].formatString;var w=C.axes[E[1]]._ticks[0].formatString;x+=B(I,t[E[0]])+", "+r(w,t[E[1]])}else{x+=j.jqplot.sprintf(H.tooltipFormatString,t[E[0]],t[E[1]])}L=true}}if(H.showTooltipDataPosition){var v=C.series;var K=d(C,F.x,F.y);var L=false;for(var D=0;D<v.length;D++){if(v[D].show){var z=v[D].index;var u=v[D].label.toString();var G=j.inArray(z,K.indices);var A=undefined;var y=undefined;if(G!=-1){var J=K.data[G].data;if(H.useAxesFormatters){var B=v[D]._xaxis._ticks[0].formatter;var r=v[D]._yaxis._ticks[0].formatter;var I=v[D]._xaxis._ticks[0].formatString;var w=v[D]._yaxis._ticks[0].formatString;A=B(I,J[0]);y=r(w,J[1])}else{A=J[0];y=J[1]}if(L){x+="<br />"}x+=j.jqplot.sprintf(H.tooltipFormatString,u,A,y);L=true}}}}H._tooltipElem.html(x)}function g(E,C){var G=C.plugins.cursor;var B=G.cursorCanvas._ctx;B.clearRect(0,0,B.canvas.width,B.canvas.height);if(G.showVerticalLine){G.shapeRenderer.draw(B,[[E.x,0],[E.x,B.canvas.height]])}if(G.showHorizontalLine){G.shapeRenderer.draw(B,[[0,E.y],[B.canvas.width,E.y]])}var I=d(C,E.x,E.y);if(G.showCursorLegend){var t=j(C.targetId+" td.jqplot-cursor-legend-label");for(var D=0;D<t.length;D++){var x=j(t[D]).data("seriesIndex");var v=C.series[x];var u=v.label.toString();var F=j.inArray(x,I.indices);var z=undefined;var y=undefined;if(F!=-1){var J=I.data[F].data;if(G.useAxesFormatters){var A=v._xaxis._ticks[0].formatter;var r=v._yaxis._ticks[0].formatter;var H=v._xaxis._ticks[0].formatString;var w=v._yaxis._ticks[0].formatString;z=A(H,J[0]);y=r(w,J[1])}else{z=J[0];y=J[1]}}if(C.legend.escapeHtml){j(t[D]).text(j.jqplot.sprintf(G.cursorLegendFormatString,u,z,y))}else{j(t[D]).html(j.jqplot.sprintf(G.cursorLegendFormatString,u,z,y))}}}}function d(A,F,E){var B={indices:[],data:[]};var G,w,u,C,v,t;var z;var D=A.plugins.cursor;for(var w=0;w<A.series.length;w++){G=A.series[w];t=G.renderer;if(G.show){z=D.intersectionThreshold;if(G.showMarker){z+=G.markerRenderer.size/2}for(var v=0;v<G.gridData.length;v++){p=G.gridData[v];if(D.showVerticalLine){if(Math.abs(F-p[0])<=z){B.indices.push(w);B.data.push({seriesIndex:w,pointIndex:v,gridData:p,data:G.data[v]})}}}}}return B}function n(t,v){var z=v.plugins.cursor;var u=z._tooltipElem;switch(z.tooltipLocation){case"nw":var r=t.x+v._gridPadding.left-u.outerWidth(true)-z.tooltipOffset;var w=t.y+v._gridPadding.top-z.tooltipOffset-u.outerHeight(true);break;case"n":var r=t.x+v._gridPadding.left-u.outerWidth(true)/2;var w=t.y+v._gridPadding.top-z.tooltipOffset-u.outerHeight(true);break;case"ne":var r=t.x+v._gridPadding.left+z.tooltipOffset;var w=t.y+v._gridPadding.top-z.tooltipOffset-u.outerHeight(true);break;case"e":var r=t.x+v._gridPadding.left+z.tooltipOffset;var w=t.y+v._gridPadding.top-u.outerHeight(true)/2;break;case"se":var r=t.x+v._gridPadding.left+z.tooltipOffset;var w=t.y+v._gridPadding.top+z.tooltipOffset;break;case"s":var r=t.x+v._gridPadding.left-u.outerWidth(true)/2;var w=t.y+v._gridPadding.top+z.tooltipOffset;break;case"sw":var r=t.x+v._gridPadding.left-u.outerWidth(true)-z.tooltipOffset;var w=t.y+v._gridPadding.top+z.tooltipOffset;break;case"w":var r=t.x+v._gridPadding.left-u.outerWidth(true)-z.tooltipOffset;var w=t.y+v._gridPadding.top-u.outerHeight(true)/2;break;default:var r=t.x+v._gridPadding.left+z.tooltipOffset;var w=t.y+v._gridPadding.top+z.tooltipOffset;break}z._tooltipElem.css("left",r);z._tooltipElem.css("top",w)}function m(w){var u=w._gridPadding;var x=w.plugins.cursor;var v=x._tooltipElem;switch(x.tooltipLocation){case"nw":var t=u.left+x.tooltipOffset;var r=u.top+x.tooltipOffset;v.css("left",t);v.css("top",r);break;case"n":var t=(u.left+(w._plotDimensions.width-u.right))/2-v.outerWidth(true)/2;var r=u.top+x.tooltipOffset;v.css("left",t);v.css("top",r);break;case"ne":var t=u.right+x.tooltipOffset;var r=u.top+x.tooltipOffset;v.css({right:t,top:r});break;case"e":var t=u.right+x.tooltipOffset;var r=(u.top+(w._plotDimensions.height-u.bottom))/2-v.outerHeight(true)/2;v.css({right:t,top:r});break;case"se":var t=u.right+x.tooltipOffset;var r=u.bottom+x.tooltipOffset;v.css({right:t,bottom:r});break;case"s":var t=(u.left+(w._plotDimensions.width-u.right))/2-v.outerWidth(true)/2;var r=u.bottom+x.tooltipOffset;v.css({left:t,bottom:r});break;case"sw":var t=u.left+x.tooltipOffset;var r=u.bottom+x.tooltipOffset;v.css({left:t,bottom:r});break;case"w":var t=u.left+x.tooltipOffset;var r=(u.top+(w._plotDimensions.height-u.bottom))/2-v.outerHeight(true)/2;v.css({left:t,top:r});break;default:var t=u.right-x.tooltipOffset;var r=u.bottom+x.tooltipOffset;v.css({right:t,bottom:r});break}}function k(t,r,x,w,v){t.preventDefault();t.stopImmediatePropagation();var y=v.plugins.cursor;if(y.clickReset){y.resetZoom(v,y)}var u=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(u&&!u().isCollapsed){u().collapse()}}return false}function c(t,r,x,w,v){t.preventDefault();t.stopImmediatePropagation();var y=v.plugins.cursor;if(y.dblClickReset){y.resetZoom(v,y)}var u=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(u&&!u().isCollapsed){u().collapse()}}return false}function f(y,v,r,B,w){var x=w.plugins.cursor;x.onGrid=false;if(x.show){j(y.target).css("cursor",x.previousCursor);if(x.showTooltip&&!(x._zoom.zooming&&x.showTooltipOutsideZoom&&!x.constrainOutsideZoom)){x._tooltipElem.hide()}if(x.zoom){x._zoom.gridpos=v;x._zoom.datapos=r}if(x.showVerticalLine||x.showHorizontalLine){var D=x.cursorCanvas._ctx;D.clearRect(0,0,D.canvas.width,D.canvas.height)}if(x.showCursorLegend){var C=j(w.targetId+" td.jqplot-cursor-legend-label");for(var u=0;u<C.length;u++){var A=j(C[u]).data("seriesIndex");var t=w.series[A];var z=t.label.toString();if(w.legend.escapeHtml){j(C[u]).text(j.jqplot.sprintf(x.cursorLegendFormatString,z,undefined,undefined))}else{j(C[u]).html(j.jqplot.sprintf(x.cursorLegendFormatString,z,undefined,undefined))}}}}}function b(t,r,w,v,u){var x=u.plugins.cursor;x.onGrid=true;if(x.show){x.previousCursor=t.target.style.cursor;t.target.style.cursor=x.style;if(x.showTooltip){e(r,w,u);if(x.followMouse){n(r,u)}else{m(u)}x._tooltipElem.show()}if(x.showVerticalLine||x.showHorizontalLine){g(r,u)}}}function i(u,t,x,w,v){var y=v.plugins.cursor;var r=y.zoomCanvas._ctx;if(y.show){if(y.showTooltip){e(t,x,v);if(y.followMouse){n(t,v)}}if(y.showVerticalLine||y.showHorizontalLine){g(t,v)}}}function o(A){var z=A.data.plot;var v=z.eventCanvas._elem.offset();var y={x:A.pageX-v.left,y:A.pageY-v.top};var w={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null};var x=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var r=z.axes;var t,u;for(t=11;t>0;t--){u=x[t-1];if(r[u].show){w[u]=r[u].series_p2u(y[u.charAt(0)])}}return{offsets:v,gridPos:y,dataPos:w}}function h(B){var z=B.data.plot;var A=z.plugins.cursor;if(A.show&&A.zoom&&A._zoom.started&&!A.zoomTarget){var D=A.zoomCanvas._ctx;var x=o(B);var y=x.gridPos;var v=x.dataPos;A._zoom.gridpos=y;A._zoom.datapos=v;A._zoom.zooming=true;var w=y.x;var u=y.y;var C=D.canvas.height;var r=D.canvas.width;if(A.showTooltip&&!A.onGrid&&A.showTooltipOutsideZoom){e(y,v,z);if(A.followMouse){n(y,z)}}if(A.constrainZoomTo=="x"){A._zoom.end=[w,C]}else{if(A.constrainZoomTo=="y"){A._zoom.end=[r,u]}else{A._zoom.end=[w,u]}}var t=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(t&&!t().isCollapsed){t().collapse()}}l.call(A)}}function a(y,u,t,z,v){var x=v.plugins.cursor;j(document).one("mouseup.jqplot_cursor",{plot:v},q);var w=v.axes;if(document.onselectstart!=undefined){x._oldHandlers.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!=undefined){x._oldHandlers.ondrag=document.ondrag;document.ondrag=function(){return false}}if(document.onmousedown!=undefined){x._oldHandlers.onmousedown=document.onmousedown;document.onmousedown=function(){return false}}if(x.zoom){if(!x.zoomProxy){var A=x.zoomCanvas._ctx;A.clearRect(0,0,A.canvas.width,A.canvas.height)}if(x.constrainZoomTo=="x"){x._zoom.start=[u.x,0]}else{if(x.constrainZoomTo=="y"){x._zoom.start=[0,u.y]}else{x._zoom.start=[u.x,u.y]}}x._zoom.started=true;for(var r in t){x._zoom.axes.start[r]=t[r]}j(document).bind("mousemove.jqplotCursor",{plot:v},h)}}function q(A){var x=A.data.plot;var z=x.plugins.cursor;if(z.zoom&&z._zoom.zooming&&!z.zoomTarget){var w=z._zoom.gridpos.x;var t=z._zoom.gridpos.y;var v=z._zoom.datapos;var B=z.zoomCanvas._ctx.canvas.height;var r=z.zoomCanvas._ctx.canvas.width;var y=x.axes;if(z.constrainOutsideZoom&&!z.onGrid){if(w<0){w=0}else{if(w>r){w=r}}if(t<0){t=0}else{if(t>B){t=B}}for(var u in v){if(v[u]){if(u.charAt(0)=="x"){v[u]=y[u].series_p2u(w)}else{v[u]=y[u].series_p2u(t)}}}}if(z.constrainZoomTo=="x"){t=B}else{if(z.constrainZoomTo=="y"){w=r}}z._zoom.end=[w,t];z._zoom.gridpos={x:w,y:t};z.doZoom(z._zoom.gridpos,v,x,z)}z._zoom.started=false;z._zoom.zooming=false;j(document).unbind("mousemove.jqplotCursor",h);if(document.onselectstart!=undefined&&z._oldHandlers.onselectstart!=null){document.onselectstart=z._oldHandlers.onselectstart;z._oldHandlers.onselectstart=null}if(document.ondrag!=undefined&&z._oldHandlers.ondrag!=null){document.ondrag=z._oldHandlers.ondrag;z._oldHandlers.ondrag=null}if(document.onmousedown!=undefined&&z._oldHandlers.onmousedown!=null){document.onmousedown=z._oldHandlers.onmousedown;z._oldHandlers.onmousedown=null}}function l(){var A=this._zoom.start;var x=this._zoom.end;var v=this.zoomCanvas._ctx;var u,y,z,r;if(x[0]>A[0]){u=A[0];r=x[0]-A[0]}else{u=x[0];r=A[0]-x[0]}if(x[1]>A[1]){y=A[1];z=x[1]-A[1]}else{y=x[1];z=A[1]-x[1]}v.fillStyle="rgba(0,0,0,0.2)";v.strokeStyle="#999999";v.lineWidth=1;v.clearRect(0,0,v.canvas.width,v.canvas.height);v.fillRect(0,0,v.canvas.width,v.canvas.height);v.clearRect(u,y,r,z);v.strokeRect(u,y,r,z)}j.jqplot.CursorLegendRenderer=function(r){j.jqplot.TableLegendRenderer.call(this,r);this.formatString="%s"};j.jqplot.CursorLegendRenderer.prototype=new j.jqplot.TableLegendRenderer();j.jqplot.CursorLegendRenderer.prototype.constructor=j.jqplot.CursorLegendRenderer;j.jqplot.CursorLegendRenderer.prototype.draw=function(){if(this.show){var w=this._series;this._elem=j('<table class="jqplot-legend jqplot-cursor-legend" style="position:absolute"></table>');var z=false;for(var v=0;v<w.length;v++){s=w[v];if(s.show){var r=j.jqplot.sprintf(this.formatString,s.label.toString());if(r){var t=s.color;if(s._stack&&!s.fill){t=""}x.call(this,r,t,z,v);z=true}for(var u=0;u<j.jqplot.addLegendRowHooks.length;u++){var y=j.jqplot.addLegendRowHooks[u].call(this,s);if(y){x.call(this,y.label,y.color,z);z=true}}}}}function x(D,C,F,A){var B=(F)?this.rowSpacing:"0";var E=j('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem);E.data("seriesIndex",A);j('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+B+';"><div style="border:1px solid #cccccc;padding:0.2em;"><div class="jqplot-cursor-legend-swatch" style="background-color:'+C+';"></div></div></td>').appendTo(E);var G=j('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+B+';"></td>');G.appendTo(E);G.data("seriesIndex",A);if(this.escapeHtml){G.text(D)}else{G.html(D)}}return this._elem}})(jQuery);
|
|
@@ -0,0 +1,313 @@
|
|
|
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.DateAxisRenderer
|
|
21
|
+
* A plugin for a jqPlot to render an axis as a series of date values.
|
|
22
|
+
* This renderer has no options beyond those supplied by the <Axis> class.
|
|
23
|
+
* It supplies it's own tick formatter, so the tickOptions.formatter option
|
|
24
|
+
* should not be overridden.
|
|
25
|
+
*
|
|
26
|
+
* Thanks to Ken Synder for his enhanced Date instance methods which are
|
|
27
|
+
* included with this code <http://kendsnyder.com/sandbox/date/>.
|
|
28
|
+
*
|
|
29
|
+
* To use this renderer, include the plugin in your source
|
|
30
|
+
* > <script type="text/javascript" language="javascript" src="plugins/jqplot.dateAxisRenderer.js"></script>
|
|
31
|
+
*
|
|
32
|
+
* and supply the appropriate options to your plot
|
|
33
|
+
*
|
|
34
|
+
* > {axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}}
|
|
35
|
+
*
|
|
36
|
+
* Dates can be passed into the axis in almost any recognizable value and
|
|
37
|
+
* will be parsed. They will be rendered on the axis in the format
|
|
38
|
+
* specified by tickOptions.formatString. e.g. tickOptions.formatString = '%Y-%m-%d'.
|
|
39
|
+
*
|
|
40
|
+
* Accecptable format codes
|
|
41
|
+
* are:
|
|
42
|
+
*
|
|
43
|
+
* > Code Result Description
|
|
44
|
+
* > == Years ==
|
|
45
|
+
* > %Y 2008 Four-digit year
|
|
46
|
+
* > %y 08 Two-digit year
|
|
47
|
+
* > == Months ==
|
|
48
|
+
* > %m 09 Two-digit month
|
|
49
|
+
* > %#m 9 One or two-digit month
|
|
50
|
+
* > %B September Full month name
|
|
51
|
+
* > %b Sep Abbreviated month name
|
|
52
|
+
* > == Days ==
|
|
53
|
+
* > %d 05 Two-digit day of month
|
|
54
|
+
* > %#d 5 One or two-digit day of month
|
|
55
|
+
* > %e 5 One or two-digit day of month
|
|
56
|
+
* > %A Sunday Full name of the day of the week
|
|
57
|
+
* > %a Sun Abbreviated name of the day of the week
|
|
58
|
+
* > %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday)
|
|
59
|
+
* > %o th The ordinal suffix string following the day of the month
|
|
60
|
+
* > == Hours ==
|
|
61
|
+
* > %H 23 Hours in 24-hour format (two digits)
|
|
62
|
+
* > %#H 3 Hours in 24-hour integer format (one or two digits)
|
|
63
|
+
* > %I 11 Hours in 12-hour format (two digits)
|
|
64
|
+
* > %#I 3 Hours in 12-hour integer format (one or two digits)
|
|
65
|
+
* > %p PM AM or PM
|
|
66
|
+
* > == Minutes ==
|
|
67
|
+
* > %M 09 Minutes (two digits)
|
|
68
|
+
* > %#M 9 Minutes (one or two digits)
|
|
69
|
+
* > == Seconds ==
|
|
70
|
+
* > %S 02 Seconds (two digits)
|
|
71
|
+
* > %#S 2 Seconds (one or two digits)
|
|
72
|
+
* > %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00)
|
|
73
|
+
* > == Milliseconds ==
|
|
74
|
+
* > %N 008 Milliseconds (three digits)
|
|
75
|
+
* > %#N 8 Milliseconds (one to three digits)
|
|
76
|
+
* > == Timezone ==
|
|
77
|
+
* > %O 360 difference in minutes between local time and GMT
|
|
78
|
+
* > %Z Mountain Standard Time Name of timezone as reported by browser
|
|
79
|
+
* > %G -06:00 Hours and minutes between GMT
|
|
80
|
+
* > == Shortcuts ==
|
|
81
|
+
* > %F 2008-03-26 %Y-%m-%d
|
|
82
|
+
* > %T 05:06:30 %H:%M:%S
|
|
83
|
+
* > %X 05:06:30 %H:%M:%S
|
|
84
|
+
* > %x 03/26/08 %m/%d/%y
|
|
85
|
+
* > %D 03/26/08 %m/%d/%y
|
|
86
|
+
* > %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y
|
|
87
|
+
* > %v 3-Sep-2008 %e-%b-%Y
|
|
88
|
+
* > %R 15:31 %H:%M
|
|
89
|
+
* > %r 3:31:00 PM %I:%M:%S %p
|
|
90
|
+
* > == Characters ==
|
|
91
|
+
* > %n \n Newline
|
|
92
|
+
* > %t \t Tab
|
|
93
|
+
* > %% % Percent Symbol
|
|
94
|
+
*/
|
|
95
|
+
$.jqplot.DateAxisRenderer = function() {
|
|
96
|
+
$.jqplot.LinearAxisRenderer.call(this);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
$.jqplot.DateAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
|
100
|
+
$.jqplot.DateAxisRenderer.prototype.constructor = $.jqplot.DateAxisRenderer;
|
|
101
|
+
|
|
102
|
+
$.jqplot.DateTickFormatter = function(format, val) {
|
|
103
|
+
if (!format) {
|
|
104
|
+
format = '%Y/%m/%d';
|
|
105
|
+
}
|
|
106
|
+
return Date.create(val).strftime(format);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
$.jqplot.DateAxisRenderer.prototype.init = function(options){
|
|
110
|
+
// prop: tickRenderer
|
|
111
|
+
// A class of a rendering engine for creating the ticks labels displayed on the plot,
|
|
112
|
+
// See <$.jqplot.AxisTickRenderer>.
|
|
113
|
+
// this.tickRenderer = $.jqplot.AxisTickRenderer;
|
|
114
|
+
// this.labelRenderer = $.jqplot.AxisLabelRenderer;
|
|
115
|
+
this.tickOptions.formatter = $.jqplot.DateTickFormatter;
|
|
116
|
+
this.daTickInterval = null;
|
|
117
|
+
this._daTickInterval = null;
|
|
118
|
+
$.extend(true, this, options);
|
|
119
|
+
var db = this._dataBounds;
|
|
120
|
+
// Go through all the series attached to this axis and find
|
|
121
|
+
// the min/max bounds for this axis.
|
|
122
|
+
for (var i=0; i<this._series.length; i++) {
|
|
123
|
+
var s = this._series[i];
|
|
124
|
+
var d = s.data;
|
|
125
|
+
var pd = s._plotData;
|
|
126
|
+
var sd = s._stackData;
|
|
127
|
+
|
|
128
|
+
for (var j=0; j<d.length; j++) {
|
|
129
|
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
|
130
|
+
d[j][0] = Date.create(d[j][0]).getTime();
|
|
131
|
+
pd[j][0] = Date.create(d[j][0]).getTime();
|
|
132
|
+
sd[j][0] = Date.create(d[j][0]).getTime();
|
|
133
|
+
if (d[j][0] < db.min || db.min == null) {
|
|
134
|
+
db.min = d[j][0];
|
|
135
|
+
}
|
|
136
|
+
if (d[j][0] > db.max || db.max == null) {
|
|
137
|
+
db.max = d[j][0];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
d[j][1] = Date.create(d[j][1]).getTime();
|
|
142
|
+
pd[j][1] = Date.create(d[j][1]).getTime();
|
|
143
|
+
sd[j][1] = Date.create(d[j][1]).getTime();
|
|
144
|
+
if (d[j][1] < db.min || db.min == null) {
|
|
145
|
+
db.min = d[j][1];
|
|
146
|
+
}
|
|
147
|
+
if (d[j][1] > db.max || db.max == null) {
|
|
148
|
+
db.max = d[j][1];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// called with scope of an axis
|
|
156
|
+
$.jqplot.DateAxisRenderer.prototype.reset = function() {
|
|
157
|
+
this.min = this._min;
|
|
158
|
+
this.max = this._max;
|
|
159
|
+
this.tickInterval = this._tickInterval;
|
|
160
|
+
this.numberTicks = this._numberTicks;
|
|
161
|
+
this.daTickInterval = this._daTickInterval;
|
|
162
|
+
// this._ticks = this.__ticks;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
$.jqplot.DateAxisRenderer.prototype.createTicks = function() {
|
|
166
|
+
// we're are operating on an axis here
|
|
167
|
+
var ticks = this._ticks;
|
|
168
|
+
var userTicks = this.ticks;
|
|
169
|
+
var name = this.name;
|
|
170
|
+
// databounds were set on axis initialization.
|
|
171
|
+
var db = this._dataBounds;
|
|
172
|
+
var dim, interval;
|
|
173
|
+
var min, max;
|
|
174
|
+
var pos1, pos2;
|
|
175
|
+
var tt, i;
|
|
176
|
+
|
|
177
|
+
// if we already have ticks, use them.
|
|
178
|
+
// ticks must be in order of increasing value.
|
|
179
|
+
|
|
180
|
+
if (userTicks.length) {
|
|
181
|
+
// ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
|
|
182
|
+
for (i=0; i<userTicks.length; i++){
|
|
183
|
+
var ut = userTicks[i];
|
|
184
|
+
var t = new this.tickRenderer(this.tickOptions);
|
|
185
|
+
if (ut.constructor == Array) {
|
|
186
|
+
t.value = Date.create(ut[0]).getTime();
|
|
187
|
+
t.label = ut[1];
|
|
188
|
+
if (!this.showTicks) {
|
|
189
|
+
t.showLabel = false;
|
|
190
|
+
t.showMark = false;
|
|
191
|
+
}
|
|
192
|
+
else if (!this.showTickMarks) {
|
|
193
|
+
t.showMark = false;
|
|
194
|
+
}
|
|
195
|
+
t.setTick(t.value, this.name);
|
|
196
|
+
this._ticks.push(t);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
else {
|
|
200
|
+
t.value = Date.create(ut).getTime();
|
|
201
|
+
if (!this.showTicks) {
|
|
202
|
+
t.showLabel = false;
|
|
203
|
+
t.showMark = false;
|
|
204
|
+
}
|
|
205
|
+
else if (!this.showTickMarks) {
|
|
206
|
+
t.showMark = false;
|
|
207
|
+
}
|
|
208
|
+
t.setTick(t.value, this.name);
|
|
209
|
+
this._ticks.push(t);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
this.numberTicks = userTicks.length;
|
|
213
|
+
this.min = this._ticks[0].value;
|
|
214
|
+
this.max = this._ticks[this.numberTicks-1].value;
|
|
215
|
+
this.daTickInterval = [(this.max - this.min) / (this.numberTicks - 1)/1000, 'seconds'];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// we don't have any ticks yet, let's make some!
|
|
219
|
+
else {
|
|
220
|
+
if (name == 'xaxis' || name == 'x2axis') {
|
|
221
|
+
dim = this._plotDimensions.width;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
dim = this._plotDimensions.height;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// if min, max and number of ticks specified, user can't specify interval.
|
|
228
|
+
if (this.min != null && this.max != null && this.numberTicks != null) {
|
|
229
|
+
this.tickInterval = null;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// if user specified a tick interval, convert to usable.
|
|
233
|
+
if (this.tickInterval != null)
|
|
234
|
+
{
|
|
235
|
+
// if interval is a number or can be converted to one, use it.
|
|
236
|
+
// Assume it is in SECONDS!!!
|
|
237
|
+
if (Number(this.tickInterval)) {
|
|
238
|
+
this.daTickInterval = [Number(this.tickInterval), 'seconds'];
|
|
239
|
+
}
|
|
240
|
+
// else, parse out something we can build from.
|
|
241
|
+
else if (typeof this.tickInterval == "string") {
|
|
242
|
+
var parts = this.tickInterval.split(' ');
|
|
243
|
+
if (parts.length == 1) {
|
|
244
|
+
this.daTickInterval = [1, parts[0]];
|
|
245
|
+
}
|
|
246
|
+
else if (parts.length == 2) {
|
|
247
|
+
this.daTickInterval = [parts[0], parts[1]];
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
min = ((this.min != null) ? Date.create(this.min).getTime() : db.min);
|
|
253
|
+
max = ((this.max != null) ? Date.create(this.max).getTime() : db.max);
|
|
254
|
+
|
|
255
|
+
// if min and max are same, space them out a bit
|
|
256
|
+
if (min == max) {
|
|
257
|
+
var adj = 24*60*60*500; // 1/2 day
|
|
258
|
+
min -= adj;
|
|
259
|
+
max += adj;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
var range = max - min;
|
|
263
|
+
var rmin, rmax;
|
|
264
|
+
|
|
265
|
+
rmin = (this.min != null) ? Date.create(this.min).getTime() : min - range/2*(this.padMin - 1);
|
|
266
|
+
rmax = (this.max != null) ? Date.create(this.max).getTime() : max + range/2*(this.padMax - 1);
|
|
267
|
+
this.min = rmin;
|
|
268
|
+
this.max = rmax;
|
|
269
|
+
range = this.max - this.min;
|
|
270
|
+
|
|
271
|
+
if (this.numberTicks == null){
|
|
272
|
+
// if tickInterval is specified by user, we will ignore computed maximum.
|
|
273
|
+
// max will be equal or greater to fit even # of ticks.
|
|
274
|
+
if (this.daTickInterval != null) {
|
|
275
|
+
var nc = Date.create(this.max).diff(this.min, this.daTickInterval[1], true);
|
|
276
|
+
this.numberTicks = Math.ceil(nc/this.daTickInterval[0]) +1;
|
|
277
|
+
// this.max = Date.create(this.min).add(this.numberTicks-1, this.daTickInterval[1]).getTime();
|
|
278
|
+
this.max = Date.create(this.min).add((this.numberTicks-1) * this.daTickInterval[0], this.daTickInterval[1]).getTime();
|
|
279
|
+
}
|
|
280
|
+
else if (dim > 200) {
|
|
281
|
+
this.numberTicks = parseInt(3+(dim-200)/100, 10);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
this.numberTicks = 2;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (this.daTickInterval == null) {
|
|
289
|
+
this.daTickInterval = [range / (this.numberTicks-1)/1000, 'seconds'];
|
|
290
|
+
}
|
|
291
|
+
for (var i=0; i<this.numberTicks; i++){
|
|
292
|
+
var min = Date.create(this.min);
|
|
293
|
+
tt = min.add(i*this.daTickInterval[0], this.daTickInterval[1]).getTime();
|
|
294
|
+
var t = new this.tickRenderer(this.tickOptions);
|
|
295
|
+
// var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
|
|
296
|
+
if (!this.showTicks) {
|
|
297
|
+
t.showLabel = false;
|
|
298
|
+
t.showMark = false;
|
|
299
|
+
}
|
|
300
|
+
else if (!this.showTickMarks) {
|
|
301
|
+
t.showMark = false;
|
|
302
|
+
}
|
|
303
|
+
t.setTick(tt, this.name);
|
|
304
|
+
this._ticks.push(t);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (this._daTickInterval == null) {
|
|
308
|
+
this._daTickInterval = this.daTickInterval;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
})(jQuery);
|
|
313
|
+
|
|
@@ -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.DateAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this)};a.jqplot.DateAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.DateAxisRenderer.prototype.constructor=a.jqplot.DateAxisRenderer;a.jqplot.DateTickFormatter=function(b,c){if(!b){b="%Y/%m/%d"}return Date.create(c).strftime(b)};a.jqplot.DateAxisRenderer.prototype.init=function(f){this.tickOptions.formatter=a.jqplot.DateTickFormatter;this.daTickInterval=null;this._daTickInterval=null;a.extend(true,this,f);var c=this._dataBounds;for(var g=0;g<this._series.length;g++){var h=this._series[g];var l=h.data;var b=h._plotData;var k=h._stackData;for(var e=0;e<l.length;e++){if(this.name=="xaxis"||this.name=="x2axis"){l[e][0]=Date.create(l[e][0]).getTime();b[e][0]=Date.create(l[e][0]).getTime();k[e][0]=Date.create(l[e][0]).getTime();if(l[e][0]<c.min||c.min==null){c.min=l[e][0]}if(l[e][0]>c.max||c.max==null){c.max=l[e][0]}}else{l[e][1]=Date.create(l[e][1]).getTime();b[e][1]=Date.create(l[e][1]).getTime();k[e][1]=Date.create(l[e][1]).getTime();if(l[e][1]<c.min||c.min==null){c.min=l[e][1]}if(l[e][1]>c.max||c.max==null){c.max=l[e][1]}}}}};a.jqplot.DateAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks;this.daTickInterval=this._daTickInterval};a.jqplot.DateAxisRenderer.prototype.createTicks=function(){var v=this._ticks;var r=this.ticks;var w=this.name;var u=this._dataBounds;var o,s;var m,p;var d,c;var b,q;if(r.length){for(q=0;q<r.length;q++){var f=r[q];var h=new this.tickRenderer(this.tickOptions);if(f.constructor==Array){h.value=Date.create(f[0]).getTime();h.label=f[1];if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(h.value,this.name);this._ticks.push(h)}else{h.value=Date.create(f).getTime();if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(h.value,this.name);this._ticks.push(h)}}this.numberTicks=r.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.daTickInterval=[(this.max-this.min)/(this.numberTicks-1)/1000,"seconds"]}else{if(w=="xaxis"||w=="x2axis"){o=this._plotDimensions.width}else{o=this._plotDimensions.height}if(this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}if(this.tickInterval!=null){if(Number(this.tickInterval)){this.daTickInterval=[Number(this.tickInterval),"seconds"]}else{if(typeof this.tickInterval=="string"){var k=this.tickInterval.split(" ");if(k.length==1){this.daTickInterval=[1,k[0]]}else{if(k.length==2){this.daTickInterval=[k[0],k[1]]}}}}}m=((this.min!=null)?Date.create(this.min).getTime():u.min);p=((this.max!=null)?Date.create(this.max).getTime():u.max);if(m==p){var g=24*60*60*500;m-=g;p+=g}var j=p-m;var l,n;l=(this.min!=null)?Date.create(this.min).getTime():m-j/2*(this.padMin-1);n=(this.max!=null)?Date.create(this.max).getTime():p+j/2*(this.padMax-1);this.min=l;this.max=n;j=this.max-this.min;if(this.numberTicks==null){if(this.daTickInterval!=null){var e=Date.create(this.max).diff(this.min,this.daTickInterval[1],true);this.numberTicks=Math.ceil(e/this.daTickInterval[0])+1;this.max=Date.create(this.min).add((this.numberTicks-1)*this.daTickInterval[0],this.daTickInterval[1]).getTime()}else{if(o>200){this.numberTicks=parseInt(3+(o-200)/100,10)}else{this.numberTicks=2}}}if(this.daTickInterval==null){this.daTickInterval=[j/(this.numberTicks-1)/1000,"seconds"]}for(var q=0;q<this.numberTicks;q++){var m=Date.create(this.min);b=m.add(q*this.daTickInterval[0],this.daTickInterval[1]).getTime();var h=new this.tickRenderer(this.tickOptions);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)}}if(this._daTickInterval==null){this._daTickInterval=this.daTickInterval}}})(jQuery);
|
|
@@ -0,0 +1,876 @@
|
|
|
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.DonutRenderer
|
|
21
|
+
* Plugin renderer to draw a donut chart.
|
|
22
|
+
* x values, if present, will be used as slice labels.
|
|
23
|
+
* y values give slice size.
|
|
24
|
+
*
|
|
25
|
+
* To use this renderer, you need to include the
|
|
26
|
+
* donut renderer plugin, for example:
|
|
27
|
+
*
|
|
28
|
+
* > <script type="text/javascript" src="plugins/jqplot.donutRenderer.js"></script>
|
|
29
|
+
*
|
|
30
|
+
* Properties described here are passed into the $.jqplot function
|
|
31
|
+
* as options on the series renderer. For example:
|
|
32
|
+
*
|
|
33
|
+
* > plot2 = $.jqplot('chart2', [s1, s2], {
|
|
34
|
+
* > seriesDefaults: {
|
|
35
|
+
* > renderer:$.jqplot.DonutRenderer,
|
|
36
|
+
* > rendererOptions:{
|
|
37
|
+
* > sliceMargin: 2,
|
|
38
|
+
* > innerDiameter: 110,
|
|
39
|
+
* > startAngle: -90
|
|
40
|
+
* > }
|
|
41
|
+
* > }
|
|
42
|
+
* > });
|
|
43
|
+
*
|
|
44
|
+
* A donut plot will trigger events on the plot target
|
|
45
|
+
* according to user interaction. All events return the event object,
|
|
46
|
+
* the series index, the point (slice) index, and the point data for
|
|
47
|
+
* the appropriate slice.
|
|
48
|
+
*
|
|
49
|
+
* 'jqplotDataMouseOver' - triggered when user mouseing over a slice.
|
|
50
|
+
* 'jqplotDataHighlight' - triggered the first time user mouses over a slice,
|
|
51
|
+
* if highlighting is enabled.
|
|
52
|
+
* 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
|
|
53
|
+
* a highlighted slice.
|
|
54
|
+
* 'jqplotDataClick' - triggered when the user clicks on a slice.
|
|
55
|
+
* 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if
|
|
56
|
+
* the "captureRightClick" option is set to true on the plot.
|
|
57
|
+
*/
|
|
58
|
+
$.jqplot.DonutRenderer = function(){
|
|
59
|
+
$.jqplot.LineRenderer.call(this);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
$.jqplot.DonutRenderer.prototype = new $.jqplot.LineRenderer();
|
|
63
|
+
$.jqplot.DonutRenderer.prototype.constructor = $.jqplot.DonutRenderer;
|
|
64
|
+
|
|
65
|
+
// called with scope of a series
|
|
66
|
+
$.jqplot.DonutRenderer.prototype.init = function(options, plot) {
|
|
67
|
+
// Group: Properties
|
|
68
|
+
//
|
|
69
|
+
// prop: diameter
|
|
70
|
+
// Outer diameter of the donut, auto computed by default
|
|
71
|
+
this.diameter = null;
|
|
72
|
+
// prop: innerDiameter
|
|
73
|
+
// Inner diameter of teh donut, auto calculated by default.
|
|
74
|
+
// If specified will override thickness value.
|
|
75
|
+
this.innerDiameter = null;
|
|
76
|
+
// prop: thickness
|
|
77
|
+
// thickness of the donut, auto computed by default
|
|
78
|
+
// Overridden by if innerDiameter is specified.
|
|
79
|
+
this.thickness = null;
|
|
80
|
+
// prop: padding
|
|
81
|
+
// padding between the donut and plot edges, legend, etc.
|
|
82
|
+
this.padding = 20;
|
|
83
|
+
// prop: sliceMargin
|
|
84
|
+
// angular spacing between donut slices in degrees.
|
|
85
|
+
this.sliceMargin = 0;
|
|
86
|
+
// prop: ringMargin
|
|
87
|
+
// pixel distance between rings, or multiple series in a donut plot.
|
|
88
|
+
// null will compute ringMargin based on sliceMargin.
|
|
89
|
+
this.ringMargin = null;
|
|
90
|
+
// prop: fill
|
|
91
|
+
// true or false, wether to fil the slices.
|
|
92
|
+
this.fill = true;
|
|
93
|
+
// prop: shadowOffset
|
|
94
|
+
// offset of the shadow from the slice and offset of
|
|
95
|
+
// each succesive stroke of the shadow from the last.
|
|
96
|
+
this.shadowOffset = 2;
|
|
97
|
+
// prop: shadowAlpha
|
|
98
|
+
// transparency of the shadow (0 = transparent, 1 = opaque)
|
|
99
|
+
this.shadowAlpha = 0.07;
|
|
100
|
+
// prop: shadowDepth
|
|
101
|
+
// number of strokes to apply to the shadow,
|
|
102
|
+
// each stroke offset shadowOffset from the last.
|
|
103
|
+
this.shadowDepth = 5;
|
|
104
|
+
// prop: highlightMouseOver
|
|
105
|
+
// True to highlight slice when moused over.
|
|
106
|
+
// This must be false to enable highlightMouseDown to highlight when clicking on a slice.
|
|
107
|
+
this.highlightMouseOver = true;
|
|
108
|
+
// prop: highlightMouseDown
|
|
109
|
+
// True to highlight when a mouse button is pressed over a slice.
|
|
110
|
+
// This will be disabled if highlightMouseOver is true.
|
|
111
|
+
this.highlightMouseDown = false;
|
|
112
|
+
// prop: highlightColors
|
|
113
|
+
// an array of colors to use when highlighting a slice.
|
|
114
|
+
this.highlightColors = [];
|
|
115
|
+
// prop: dataLabels
|
|
116
|
+
// Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
|
|
117
|
+
// Defaults to percentage of each pie slice.
|
|
118
|
+
this.dataLabels = 'percent';
|
|
119
|
+
// prop: showDataLabels
|
|
120
|
+
// true to show data labels on slices.
|
|
121
|
+
this.showDataLabels = false;
|
|
122
|
+
// prop: dataLabelFormatString
|
|
123
|
+
// Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
|
|
124
|
+
this.dataLabelFormatString = null;
|
|
125
|
+
// prop: dataLabelThreshold
|
|
126
|
+
// Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed.
|
|
127
|
+
// This applies to all label types, not just to percentage labels.
|
|
128
|
+
this.dataLabelThreshold = 3;
|
|
129
|
+
// prop: dataLabelPositionFactor
|
|
130
|
+
// A Multiplier (0-1) of the pie radius which controls position of label on slice.
|
|
131
|
+
// Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie.
|
|
132
|
+
this.dataLabelPositionFactor = 0.5;
|
|
133
|
+
// prop: dataLabelNudge
|
|
134
|
+
// Number of pixels to slide the label away from (+) or toward (-) the center of the pie.
|
|
135
|
+
this.dataLabelNudge = 0;
|
|
136
|
+
// prop: startAngle
|
|
137
|
+
// Angle to start drawing donut in degrees.
|
|
138
|
+
// According to orientation of canvas coordinate system:
|
|
139
|
+
// 0 = on the positive x axis
|
|
140
|
+
// -90 = on the positive y axis.
|
|
141
|
+
// 90 = on the negaive y axis.
|
|
142
|
+
// 180 or - 180 = on the negative x axis.
|
|
143
|
+
this.startAngle = 0;
|
|
144
|
+
this.tickRenderer = $.jqplot.DonutTickRenderer;
|
|
145
|
+
|
|
146
|
+
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
|
|
147
|
+
if (options.highlightMouseDown && options.highlightMouseOver == null) {
|
|
148
|
+
options.highlightMouseOver = false;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
$.extend(true, this, options);
|
|
152
|
+
if (this.diameter != null) {
|
|
153
|
+
this.diameter = this.diameter - this.sliceMargin;
|
|
154
|
+
}
|
|
155
|
+
this._diameter = null;
|
|
156
|
+
this._innerDiameter = null;
|
|
157
|
+
this._radius = null;
|
|
158
|
+
this._innerRadius = null;
|
|
159
|
+
this._thickness = null;
|
|
160
|
+
// references to the previous series in the plot to properly calculate diameters
|
|
161
|
+
// and thicknesses of nested rings.
|
|
162
|
+
this._previousSeries = [];
|
|
163
|
+
this._numberSeries = 1;
|
|
164
|
+
// array of [start,end] angles arrays, one for each slice. In radians.
|
|
165
|
+
this._sliceAngles = [];
|
|
166
|
+
// index of the currenty highlighted point, if any
|
|
167
|
+
this._highlightedPoint = null;
|
|
168
|
+
|
|
169
|
+
// set highlight colors if none provided
|
|
170
|
+
if (this.highlightColors.length == 0) {
|
|
171
|
+
for (var i=0; i<this.seriesColors.length; i++){
|
|
172
|
+
var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
|
|
173
|
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
|
174
|
+
var sum = newrgb[0] + newrgb[1] + newrgb[2];
|
|
175
|
+
for (var j=0; j<3; j++) {
|
|
176
|
+
// when darkening, lowest color component can be is 60.
|
|
177
|
+
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
|
|
178
|
+
newrgb[j] = parseInt(newrgb[j], 10);
|
|
179
|
+
}
|
|
180
|
+
this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
plot.postParseOptionsHooks.addOnce(postParseOptions);
|
|
185
|
+
plot.postInitHooks.addOnce(postInit);
|
|
186
|
+
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
|
|
187
|
+
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
|
|
188
|
+
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
|
|
189
|
+
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
|
|
190
|
+
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
|
|
191
|
+
plot.postDrawHooks.addOnce(postPlotDraw);
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
$.jqplot.DonutRenderer.prototype.setGridData = function(plot) {
|
|
197
|
+
// set gridData property. This will hold angle in radians of each data point.
|
|
198
|
+
var stack = [];
|
|
199
|
+
var td = [];
|
|
200
|
+
var sa = this.startAngle/180*Math.PI;
|
|
201
|
+
var tot = 0;
|
|
202
|
+
for (var i=0; i<this.data.length; i++){
|
|
203
|
+
stack.push(this.data[i][1]);
|
|
204
|
+
td.push([this.data[i][0]]);
|
|
205
|
+
if (i>0) {
|
|
206
|
+
stack[i] += stack[i-1];
|
|
207
|
+
}
|
|
208
|
+
tot += this.data[i][1];
|
|
209
|
+
}
|
|
210
|
+
var fact = Math.PI*2/stack[stack.length - 1];
|
|
211
|
+
|
|
212
|
+
for (var i=0; i<stack.length; i++) {
|
|
213
|
+
td[i][1] = stack[i] * fact;
|
|
214
|
+
td[i][2] = this.data[i][1]/tot;
|
|
215
|
+
}
|
|
216
|
+
this.gridData = td;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
$.jqplot.DonutRenderer.prototype.makeGridData = function(data, plot) {
|
|
220
|
+
var stack = [];
|
|
221
|
+
var td = [];
|
|
222
|
+
var tot = 0;
|
|
223
|
+
var sa = this.startAngle/180*Math.PI;
|
|
224
|
+
for (var i=0; i<data.length; i++){
|
|
225
|
+
stack.push(data[i][1]);
|
|
226
|
+
td.push([data[i][0]]);
|
|
227
|
+
if (i>0) {
|
|
228
|
+
stack[i] += stack[i-1];
|
|
229
|
+
}
|
|
230
|
+
tot += data[i][1];
|
|
231
|
+
}
|
|
232
|
+
var fact = Math.PI*2/stack[stack.length - 1];
|
|
233
|
+
|
|
234
|
+
for (var i=0; i<stack.length; i++) {
|
|
235
|
+
td[i][1] = stack[i] * fact;
|
|
236
|
+
td[i][2] = data[i][1]/tot;
|
|
237
|
+
}
|
|
238
|
+
return td;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
$.jqplot.DonutRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) {
|
|
242
|
+
var r = this._diameter / 2;
|
|
243
|
+
var ri = r - this._thickness;
|
|
244
|
+
var fill = this.fill;
|
|
245
|
+
// var lineWidth = this.lineWidth;
|
|
246
|
+
ctx.save();
|
|
247
|
+
ctx.translate(this._center[0], this._center[1]);
|
|
248
|
+
// ctx.translate(this.sliceMargin*Math.cos((ang1+ang2)/2), this.sliceMargin*Math.sin((ang1+ang2)/2));
|
|
249
|
+
|
|
250
|
+
if (isShadow) {
|
|
251
|
+
for (var i=0; i<this.shadowDepth; i++) {
|
|
252
|
+
ctx.save();
|
|
253
|
+
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
|
|
254
|
+
doDraw();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
else {
|
|
259
|
+
doDraw();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function doDraw () {
|
|
263
|
+
// Fix for IE and Chrome that can't seem to draw circles correctly.
|
|
264
|
+
// ang2 should always be <= 2 pi since that is the way the data is converted.
|
|
265
|
+
if (ang2 > 6.282 + this.startAngle) {
|
|
266
|
+
ang2 = 6.282 + this.startAngle;
|
|
267
|
+
if (ang1 > ang2) {
|
|
268
|
+
ang1 = 6.281 + this.startAngle;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// Fix for IE, where it can't seem to handle 0 degree angles. Also avoids
|
|
272
|
+
// ugly line on unfilled donuts.
|
|
273
|
+
if (ang1 == ang2) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
ctx.beginPath();
|
|
277
|
+
ctx.fillStyle = color;
|
|
278
|
+
ctx.strokeStyle = color;
|
|
279
|
+
// ctx.lineWidth = lineWidth;
|
|
280
|
+
ctx.arc(0, 0, r, ang1, ang2, false);
|
|
281
|
+
ctx.lineTo(ri*Math.cos(ang2), ri*Math.sin(ang2));
|
|
282
|
+
ctx.arc(0,0, ri, ang2, ang1, true);
|
|
283
|
+
ctx.closePath();
|
|
284
|
+
if (fill) {
|
|
285
|
+
ctx.fill();
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
ctx.stroke();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (isShadow) {
|
|
293
|
+
for (var i=0; i<this.shadowDepth; i++) {
|
|
294
|
+
ctx.restore();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
ctx.restore();
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// called with scope of series
|
|
302
|
+
$.jqplot.DonutRenderer.prototype.draw = function (ctx, gd, options, plot) {
|
|
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
|
+
// var colorGenerator = new this.colorGenerator(this.seriesColors);
|
|
310
|
+
if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
|
|
311
|
+
var li = options.legendInfo;
|
|
312
|
+
switch (li.location) {
|
|
313
|
+
case 'nw':
|
|
314
|
+
offx = li.width + li.xoffset;
|
|
315
|
+
break;
|
|
316
|
+
case 'w':
|
|
317
|
+
offx = li.width + li.xoffset;
|
|
318
|
+
break;
|
|
319
|
+
case 'sw':
|
|
320
|
+
offx = li.width + li.xoffset;
|
|
321
|
+
break;
|
|
322
|
+
case 'ne':
|
|
323
|
+
offx = li.width + li.xoffset;
|
|
324
|
+
trans = -1;
|
|
325
|
+
break;
|
|
326
|
+
case 'e':
|
|
327
|
+
offx = li.width + li.xoffset;
|
|
328
|
+
trans = -1;
|
|
329
|
+
break;
|
|
330
|
+
case 'se':
|
|
331
|
+
offx = li.width + li.xoffset;
|
|
332
|
+
trans = -1;
|
|
333
|
+
break;
|
|
334
|
+
case 'n':
|
|
335
|
+
offy = li.height + li.yoffset;
|
|
336
|
+
break;
|
|
337
|
+
case 's':
|
|
338
|
+
offy = li.height + li.yoffset;
|
|
339
|
+
trans = -1;
|
|
340
|
+
break;
|
|
341
|
+
default:
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
|
347
|
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
|
348
|
+
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
|
|
349
|
+
var cw = ctx.canvas.width;
|
|
350
|
+
var ch = ctx.canvas.height;
|
|
351
|
+
var w = cw - offx - 2 * this.padding;
|
|
352
|
+
var h = ch - offy - 2 * this.padding;
|
|
353
|
+
var mindim = Math.min(w,h);
|
|
354
|
+
var d = mindim;
|
|
355
|
+
var ringmargin = (this.ringMargin == null) ? this.sliceMargin * 2.0 : this.ringMargin;
|
|
356
|
+
|
|
357
|
+
for (var i=0; i<this._previousSeries.length; i++) {
|
|
358
|
+
d -= 2.0 * this._previousSeries[i]._thickness + 2.0 * ringmargin;
|
|
359
|
+
}
|
|
360
|
+
this._diameter = this.diameter || d;
|
|
361
|
+
if (this.innerDiameter != null) {
|
|
362
|
+
var od = (this._numberSeries > 1 && this.index > 0) ? this._previousSeries[0]._diameter : this._diameter;
|
|
363
|
+
this._thickness = this.thickness || (od - this.innerDiameter - 2.0*ringmargin*this._numberSeries) / this._numberSeries/2.0;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
this._thickness = this.thickness || mindim / 2 / (this._numberSeries + 1) * 0.85;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
var r = this._radius = this._diameter/2;
|
|
370
|
+
this._innerRadius = this._radius - this._thickness;
|
|
371
|
+
var sa = this.startAngle / 180 * Math.PI;
|
|
372
|
+
this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
|
|
373
|
+
|
|
374
|
+
if (this.shadow) {
|
|
375
|
+
var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
|
|
376
|
+
for (var i=0; i<gd.length; i++) {
|
|
377
|
+
var ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
|
|
378
|
+
// Adjust ang1 and ang2 for sliceMargin
|
|
379
|
+
ang1 += this.sliceMargin/180*Math.PI;
|
|
380
|
+
this.renderer.drawSlice.call (this, ctx, ang1, gd[i][1]+sa, shadowColor, true);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
}
|
|
384
|
+
for (var i=0; i<gd.length; i++) {
|
|
385
|
+
var ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
|
|
386
|
+
// Adjust ang1 and ang2 for sliceMargin
|
|
387
|
+
ang1 += this.sliceMargin/180*Math.PI;
|
|
388
|
+
var ang2 = gd[i][1] + sa;
|
|
389
|
+
this._sliceAngles.push([ang1, ang2]);
|
|
390
|
+
this.renderer.drawSlice.call (this, ctx, ang1, ang2, this.seriesColors[i], false);
|
|
391
|
+
|
|
392
|
+
if (this.showDataLabels && gd[i][2]*100 >= this.dataLabelThreshold) {
|
|
393
|
+
var fstr, avgang = (ang1+ang2)/2, label;
|
|
394
|
+
|
|
395
|
+
if (this.dataLabels == 'label') {
|
|
396
|
+
fstr = this.dataLabelFormatString || '%s';
|
|
397
|
+
label = $.jqplot.sprintf(fstr, gd[i][0]);
|
|
398
|
+
}
|
|
399
|
+
else if (this.dataLabels == 'value') {
|
|
400
|
+
fstr = this.dataLabelFormatString || '%d';
|
|
401
|
+
label = $.jqplot.sprintf(fstr, gd[i][1]);
|
|
402
|
+
}
|
|
403
|
+
else if (this.dataLabels == 'percent') {
|
|
404
|
+
fstr = this.dataLabelFormatString || '%d%%';
|
|
405
|
+
label = $.jqplot.sprintf(fstr, gd[i][2]*100);
|
|
406
|
+
}
|
|
407
|
+
else if (this.dataLabels.constructor == Array) {
|
|
408
|
+
fstr = this.dataLabelFormatString || '%s';
|
|
409
|
+
label = $.jqplot.sprintf(fstr, this.dataLabels[i]);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
var fact = this._innerRadius + this._thickness * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
|
|
413
|
+
|
|
414
|
+
var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left;
|
|
415
|
+
var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top;
|
|
416
|
+
|
|
417
|
+
var labelelem = $('<span class="jqplot-donut-series jqplot-data-label" style="position:absolute;">' + label + '</span>').insertBefore(plot.eventCanvas._elem);
|
|
418
|
+
x -= labelelem.width()/2;
|
|
419
|
+
y -= labelelem.height()/2;
|
|
420
|
+
x = Math.round(x);
|
|
421
|
+
y = Math.round(y);
|
|
422
|
+
labelelem.css({left: x, top: y});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
$.jqplot.DonutAxisRenderer = function() {
|
|
429
|
+
$.jqplot.LinearAxisRenderer.call(this);
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
$.jqplot.DonutAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
|
433
|
+
$.jqplot.DonutAxisRenderer.prototype.constructor = $.jqplot.DonutAxisRenderer;
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
// There are no traditional axes on a donut chart. We just need to provide
|
|
437
|
+
// dummy objects with properties so the plot will render.
|
|
438
|
+
// called with scope of axis object.
|
|
439
|
+
$.jqplot.DonutAxisRenderer.prototype.init = function(options){
|
|
440
|
+
//
|
|
441
|
+
this.tickRenderer = $.jqplot.DonutTickRenderer;
|
|
442
|
+
$.extend(true, this, options);
|
|
443
|
+
// I don't think I'm going to need _dataBounds here.
|
|
444
|
+
// have to go Axis scaling in a way to fit chart onto plot area
|
|
445
|
+
// and provide u2p and p2u functionality for mouse cursor, etc.
|
|
446
|
+
// for convienence set _dataBounds to 0 and 100 and
|
|
447
|
+
// set min/max to 0 and 100.
|
|
448
|
+
this._dataBounds = {min:0, max:100};
|
|
449
|
+
this.min = 0;
|
|
450
|
+
this.max = 100;
|
|
451
|
+
this.showTicks = false;
|
|
452
|
+
this.ticks = [];
|
|
453
|
+
this.showMark = false;
|
|
454
|
+
this.show = false;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
$.jqplot.DonutLegendRenderer = function(){
|
|
461
|
+
$.jqplot.TableLegendRenderer.call(this);
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
$.jqplot.DonutLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
|
|
465
|
+
$.jqplot.DonutLegendRenderer.prototype.constructor = $.jqplot.DonutLegendRenderer;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Class: $.jqplot.DonutLegendRenderer
|
|
469
|
+
* Legend Renderer specific to donut plots. Set by default
|
|
470
|
+
* when user creates a donut plot.
|
|
471
|
+
*/
|
|
472
|
+
$.jqplot.DonutLegendRenderer.prototype.init = function(options) {
|
|
473
|
+
// Group: Properties
|
|
474
|
+
//
|
|
475
|
+
// prop: numberRows
|
|
476
|
+
// Maximum number of rows in the legend. 0 or null for unlimited.
|
|
477
|
+
this.numberRows = null;
|
|
478
|
+
// prop: numberColumns
|
|
479
|
+
// Maximum number of columns in the legend. 0 or null for unlimited.
|
|
480
|
+
this.numberColumns = null;
|
|
481
|
+
$.extend(true, this, options);
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
// called with context of legend
|
|
485
|
+
$.jqplot.DonutLegendRenderer.prototype.draw = function() {
|
|
486
|
+
var legend = this;
|
|
487
|
+
if (this.show) {
|
|
488
|
+
var series = this._series;
|
|
489
|
+
var ss = 'position:absolute;';
|
|
490
|
+
ss += (this.background) ? 'background:'+this.background+';' : '';
|
|
491
|
+
ss += (this.border) ? 'border:'+this.border+';' : '';
|
|
492
|
+
ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
|
|
493
|
+
ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
|
|
494
|
+
ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
|
|
495
|
+
ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
|
|
496
|
+
ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
|
|
497
|
+
ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
|
|
498
|
+
ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
|
|
499
|
+
this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
|
|
500
|
+
// Donut charts legends don't go by number of series, but by number of data points
|
|
501
|
+
// in the series. Refactor things here for that.
|
|
502
|
+
|
|
503
|
+
var pad = false,
|
|
504
|
+
reverse = false,
|
|
505
|
+
nr, nc;
|
|
506
|
+
var s = series[0];
|
|
507
|
+
var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
|
|
508
|
+
|
|
509
|
+
if (s.show) {
|
|
510
|
+
var pd = s.data;
|
|
511
|
+
if (this.numberRows) {
|
|
512
|
+
nr = this.numberRows;
|
|
513
|
+
if (!this.numberColumns){
|
|
514
|
+
nc = Math.ceil(pd.length/nr);
|
|
515
|
+
}
|
|
516
|
+
else{
|
|
517
|
+
nc = this.numberColumns;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
else if (this.numberColumns) {
|
|
521
|
+
nc = this.numberColumns;
|
|
522
|
+
nr = Math.ceil(pd.length/this.numberColumns);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
nr = pd.length;
|
|
526
|
+
nc = 1;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
var i, j, tr, td1, td2, lt, rs, color;
|
|
530
|
+
var idx = 0;
|
|
531
|
+
|
|
532
|
+
for (i=0; i<nr; i++) {
|
|
533
|
+
if (reverse){
|
|
534
|
+
tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
|
|
535
|
+
}
|
|
536
|
+
else{
|
|
537
|
+
tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
|
|
538
|
+
}
|
|
539
|
+
for (j=0; j<nc; j++) {
|
|
540
|
+
if (idx < pd.length){
|
|
541
|
+
lt = this.labels[idx] || pd[idx][0].toString();
|
|
542
|
+
color = colorGenerator.next();
|
|
543
|
+
if (!reverse){
|
|
544
|
+
if (i>0){
|
|
545
|
+
pad = true;
|
|
546
|
+
}
|
|
547
|
+
else{
|
|
548
|
+
pad = false;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
else{
|
|
552
|
+
if (i == nr -1){
|
|
553
|
+
pad = false;
|
|
554
|
+
}
|
|
555
|
+
else{
|
|
556
|
+
pad = true;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
rs = (pad) ? this.rowSpacing : '0';
|
|
560
|
+
|
|
561
|
+
td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
|
|
562
|
+
'<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
|
|
563
|
+
'</div></td>');
|
|
564
|
+
td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
|
|
565
|
+
if (this.escapeHtml){
|
|
566
|
+
td2.text(lt);
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
td2.html(lt);
|
|
570
|
+
}
|
|
571
|
+
if (reverse) {
|
|
572
|
+
td2.prependTo(tr);
|
|
573
|
+
td1.prependTo(tr);
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
td1.appendTo(tr);
|
|
577
|
+
td2.appendTo(tr);
|
|
578
|
+
}
|
|
579
|
+
pad = true;
|
|
580
|
+
}
|
|
581
|
+
idx++;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return this._elem;
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// $.jqplot.DonutLegendRenderer.prototype.pack = function(offsets) {
|
|
590
|
+
// if (this.show) {
|
|
591
|
+
// // fake a grid for positioning
|
|
592
|
+
// var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
|
|
593
|
+
// if (this.placement == 'insideGrid') {
|
|
594
|
+
// switch (this.location) {
|
|
595
|
+
// case 'nw':
|
|
596
|
+
// var a = grid._left + this.xoffset;
|
|
597
|
+
// var b = grid._top + this.yoffset;
|
|
598
|
+
// this._elem.css('left', a);
|
|
599
|
+
// this._elem.css('top', b);
|
|
600
|
+
// break;
|
|
601
|
+
// case 'n':
|
|
602
|
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
|
603
|
+
// var b = grid._top + this.yoffset;
|
|
604
|
+
// this._elem.css('left', a);
|
|
605
|
+
// this._elem.css('top', b);
|
|
606
|
+
// break;
|
|
607
|
+
// case 'ne':
|
|
608
|
+
// var a = offsets.right + this.xoffset;
|
|
609
|
+
// var b = grid._top + this.yoffset;
|
|
610
|
+
// this._elem.css({right:a, top:b});
|
|
611
|
+
// break;
|
|
612
|
+
// case 'e':
|
|
613
|
+
// var a = offsets.right + this.xoffset;
|
|
614
|
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
|
615
|
+
// this._elem.css({right:a, top:b});
|
|
616
|
+
// break;
|
|
617
|
+
// case 'se':
|
|
618
|
+
// var a = offsets.right + this.xoffset;
|
|
619
|
+
// var b = offsets.bottom + this.yoffset;
|
|
620
|
+
// this._elem.css({right:a, bottom:b});
|
|
621
|
+
// break;
|
|
622
|
+
// case 's':
|
|
623
|
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
|
624
|
+
// var b = offsets.bottom + this.yoffset;
|
|
625
|
+
// this._elem.css({left:a, bottom:b});
|
|
626
|
+
// break;
|
|
627
|
+
// case 'sw':
|
|
628
|
+
// var a = grid._left + this.xoffset;
|
|
629
|
+
// var b = offsets.bottom + this.yoffset;
|
|
630
|
+
// this._elem.css({left:a, bottom:b});
|
|
631
|
+
// break;
|
|
632
|
+
// case 'w':
|
|
633
|
+
// var a = grid._left + this.xoffset;
|
|
634
|
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
|
635
|
+
// this._elem.css({left:a, top:b});
|
|
636
|
+
// break;
|
|
637
|
+
// default: // same as 'se'
|
|
638
|
+
// var a = grid._right - this.xoffset;
|
|
639
|
+
// var b = grid._bottom + this.yoffset;
|
|
640
|
+
// this._elem.css({right:a, bottom:b});
|
|
641
|
+
// break;
|
|
642
|
+
// }
|
|
643
|
+
//
|
|
644
|
+
// }
|
|
645
|
+
// else {
|
|
646
|
+
// switch (this.location) {
|
|
647
|
+
// case 'nw':
|
|
648
|
+
// var a = this._plotDimensions.width - grid._left + this.xoffset;
|
|
649
|
+
// var b = grid._top + this.yoffset;
|
|
650
|
+
// this._elem.css('right', a);
|
|
651
|
+
// this._elem.css('top', b);
|
|
652
|
+
// break;
|
|
653
|
+
// case 'n':
|
|
654
|
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
|
655
|
+
// var b = this._plotDimensions.height - grid._top + this.yoffset;
|
|
656
|
+
// this._elem.css('left', a);
|
|
657
|
+
// this._elem.css('bottom', b);
|
|
658
|
+
// break;
|
|
659
|
+
// case 'ne':
|
|
660
|
+
// var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
|
661
|
+
// var b = grid._top + this.yoffset;
|
|
662
|
+
// this._elem.css({left:a, top:b});
|
|
663
|
+
// break;
|
|
664
|
+
// case 'e':
|
|
665
|
+
// var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
|
666
|
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
|
667
|
+
// this._elem.css({left:a, top:b});
|
|
668
|
+
// break;
|
|
669
|
+
// case 'se':
|
|
670
|
+
// var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
|
671
|
+
// var b = offsets.bottom + this.yoffset;
|
|
672
|
+
// this._elem.css({left:a, bottom:b});
|
|
673
|
+
// break;
|
|
674
|
+
// case 's':
|
|
675
|
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
|
676
|
+
// var b = this._plotDimensions.height - offsets.bottom + this.yoffset;
|
|
677
|
+
// this._elem.css({left:a, top:b});
|
|
678
|
+
// break;
|
|
679
|
+
// case 'sw':
|
|
680
|
+
// var a = this._plotDimensions.width - grid._left + this.xoffset;
|
|
681
|
+
// var b = offsets.bottom + this.yoffset;
|
|
682
|
+
// this._elem.css({right:a, bottom:b});
|
|
683
|
+
// break;
|
|
684
|
+
// case 'w':
|
|
685
|
+
// var a = this._plotDimensions.width - grid._left + this.xoffset;
|
|
686
|
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
|
687
|
+
// this._elem.css({right:a, top:b});
|
|
688
|
+
// break;
|
|
689
|
+
// default: // same as 'se'
|
|
690
|
+
// var a = grid._right - this.xoffset;
|
|
691
|
+
// var b = grid._bottom + this.yoffset;
|
|
692
|
+
// this._elem.css({right:a, bottom:b});
|
|
693
|
+
// break;
|
|
694
|
+
// }
|
|
695
|
+
// }
|
|
696
|
+
// }
|
|
697
|
+
// };
|
|
698
|
+
|
|
699
|
+
// setup default renderers for axes and legend so user doesn't have to
|
|
700
|
+
// called with scope of plot
|
|
701
|
+
function preInit(target, data, options) {
|
|
702
|
+
options = options || {};
|
|
703
|
+
options.axesDefaults = options.axesDefaults || {};
|
|
704
|
+
options.legend = options.legend || {};
|
|
705
|
+
options.seriesDefaults = options.seriesDefaults || {};
|
|
706
|
+
// only set these if there is a donut series
|
|
707
|
+
var setopts = false;
|
|
708
|
+
if (options.seriesDefaults.renderer == $.jqplot.DonutRenderer) {
|
|
709
|
+
setopts = true;
|
|
710
|
+
}
|
|
711
|
+
else if (options.series) {
|
|
712
|
+
for (var i=0; i < options.series.length; i++) {
|
|
713
|
+
if (options.series[i].renderer == $.jqplot.DonutRenderer) {
|
|
714
|
+
setopts = true;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
if (setopts) {
|
|
720
|
+
options.axesDefaults.renderer = $.jqplot.DonutAxisRenderer;
|
|
721
|
+
options.legend.renderer = $.jqplot.DonutLegendRenderer;
|
|
722
|
+
options.legend.preDraw = true;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// called with scope of plot.
|
|
727
|
+
function postInit(target, data, options) {
|
|
728
|
+
// if multiple series, add a reference to the previous one so that
|
|
729
|
+
// donut rings can nest.
|
|
730
|
+
for (var i=1; i<this.series.length; i++) {
|
|
731
|
+
if (!this.series[i]._previousSeries.length){
|
|
732
|
+
for (var j=0; j<i; j++) {
|
|
733
|
+
if (this.series[i].renderer.constructor == $.jqplot.DonutRenderer && this.series[j].renderer.constructor == $.jqplot.DonutRenderer) {
|
|
734
|
+
this.series[i]._previousSeries.push(this.series[j]);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
for (i=0; i<this.series.length; i++) {
|
|
740
|
+
if (this.series[i].renderer.constructor == $.jqplot.DonutRenderer) {
|
|
741
|
+
this.series[i]._numberSeries = this.series.length;
|
|
742
|
+
// don't allow mouseover and mousedown at same time.
|
|
743
|
+
if (this.series[i].highlightMouseOver) {
|
|
744
|
+
this.series[i].highlightMouseDown = false;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
this.target.bind('mouseout', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
var postParseOptionsRun = false;
|
|
752
|
+
// called with scope of plot
|
|
753
|
+
function postParseOptions(options) {
|
|
754
|
+
for (var i=0; i<this.series.length; i++) {
|
|
755
|
+
this.series[i].seriesColors = this.seriesColors;
|
|
756
|
+
this.series[i].colorGenerator = this.colorGenerator;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
function highlight (plot, sidx, pidx) {
|
|
761
|
+
var s = plot.series[sidx];
|
|
762
|
+
var canvas = plot.plugins.donutRenderer.highlightCanvas;
|
|
763
|
+
canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
|
764
|
+
s._highlightedPoint = pidx;
|
|
765
|
+
plot.plugins.donutRenderer.highlightedSeriesIndex = sidx;
|
|
766
|
+
s.renderer.drawSlice.call(s, canvas._ctx, s._sliceAngles[pidx][0], s._sliceAngles[pidx][1], s.highlightColors[pidx], false);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function unhighlight (plot) {
|
|
770
|
+
var canvas = plot.plugins.donutRenderer.highlightCanvas;
|
|
771
|
+
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
|
772
|
+
for (var i=0; i<plot.series.length; i++) {
|
|
773
|
+
plot.series[i]._highlightedPoint = null;
|
|
774
|
+
}
|
|
775
|
+
plot.plugins.donutRenderer.highlightedSeriesIndex = null;
|
|
776
|
+
plot.target.trigger('jqplotDataUnhighlight');
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
|
780
|
+
if (neighbor) {
|
|
781
|
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
|
782
|
+
var evt1 = jQuery.Event('jqplotDataMouseOver');
|
|
783
|
+
evt1.pageX = ev.pageX;
|
|
784
|
+
evt1.pageY = ev.pageY;
|
|
785
|
+
plot.target.trigger(evt1, ins);
|
|
786
|
+
if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.donutRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
|
787
|
+
var evt = jQuery.Event('jqplotDataHighlight');
|
|
788
|
+
evt.pageX = ev.pageX;
|
|
789
|
+
evt.pageY = ev.pageY;
|
|
790
|
+
plot.target.trigger(evt, ins);
|
|
791
|
+
highlight (plot, ins[0], ins[1]);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
else if (neighbor == null) {
|
|
795
|
+
unhighlight (plot);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
|
|
800
|
+
if (neighbor) {
|
|
801
|
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
|
802
|
+
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.donutRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
|
803
|
+
var evt = jQuery.Event('jqplotDataHighlight');
|
|
804
|
+
evt.pageX = ev.pageX;
|
|
805
|
+
evt.pageY = ev.pageY;
|
|
806
|
+
plot.target.trigger(evt, ins);
|
|
807
|
+
highlight (plot, ins[0], ins[1]);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
else if (neighbor == null) {
|
|
811
|
+
unhighlight (plot);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
|
|
816
|
+
var idx = plot.plugins.donutRenderer.highlightedSeriesIndex;
|
|
817
|
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
|
818
|
+
unhighlight(plot);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function handleClick(ev, gridpos, datapos, neighbor, plot) {
|
|
823
|
+
if (neighbor) {
|
|
824
|
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
|
825
|
+
var evt = jQuery.Event('jqplotDataClick');
|
|
826
|
+
evt.pageX = ev.pageX;
|
|
827
|
+
evt.pageY = ev.pageY;
|
|
828
|
+
plot.target.trigger(evt, ins);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
|
|
833
|
+
if (neighbor) {
|
|
834
|
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
|
835
|
+
var idx = plot.plugins.donutRenderer.highlightedSeriesIndex;
|
|
836
|
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
|
837
|
+
unhighlight(plot);
|
|
838
|
+
}
|
|
839
|
+
var evt = jQuery.Event('jqplotDataRightClick');
|
|
840
|
+
evt.pageX = ev.pageX;
|
|
841
|
+
evt.pageY = ev.pageY;
|
|
842
|
+
plot.target.trigger(evt, ins);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// called within context of plot
|
|
847
|
+
// create a canvas which we can draw on.
|
|
848
|
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
|
849
|
+
function postPlotDraw() {
|
|
850
|
+
this.plugins.donutRenderer = {highlightedSeriesIndex:null};
|
|
851
|
+
this.plugins.donutRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
|
|
852
|
+
// do we have any data labels? if so, put highlight canvas before those
|
|
853
|
+
// Fix for broken jquery :first selector with canvas (VML) elements.
|
|
854
|
+
var labels = $(this.targetId+' .jqplot-data-label');
|
|
855
|
+
if (labels.length) {
|
|
856
|
+
$(labels[0]).before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-donutRenderer-highlight-canvas', this._plotDimensions));
|
|
857
|
+
}
|
|
858
|
+
// else put highlight canvas before event canvas.
|
|
859
|
+
else {
|
|
860
|
+
this.eventCanvas._elem.before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-donutRenderer-highlight-canvas', this._plotDimensions));
|
|
861
|
+
}
|
|
862
|
+
var hctx = this.plugins.donutRenderer.highlightCanvas.setContext();
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
$.jqplot.preInitHooks.push(preInit);
|
|
866
|
+
|
|
867
|
+
$.jqplot.DonutTickRenderer = function() {
|
|
868
|
+
$.jqplot.AxisTickRenderer.call(this);
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
$.jqplot.DonutTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
|
|
872
|
+
$.jqplot.DonutTickRenderer.prototype.constructor = $.jqplot.DonutTickRenderer;
|
|
873
|
+
|
|
874
|
+
})(jQuery);
|
|
875
|
+
|
|
876
|
+
|