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(e){e.jqplot.FunnelRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.FunnelRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.FunnelRenderer.prototype.constructor=e.jqplot.FunnelRenderer;e.jqplot.FunnelRenderer.prototype.init=function(q,u){this.padding={top:20,right:20,bottom:20,left:20};this.sectionMargin=6;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.widthRatio=0.2;this.lineWidth=2;this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.tickRenderer=e.jqplot.FunnelTickRenderer;if(q.highlightMouseDown&&q.highlightMouseOver==null){q.highlightMouseOver=false}e.extend(true,this,q);this._highlightedPoint=null;this._bases=[];this._atot;this._areas=[];this._lengths=[];this._angle;this._dataIndices=[];this._unorderedData=e.extend(true,[],this.data);var p=e.extend(true,[],this.data);for(var s=0;s<p.length;s++){p[s].push(s)}this.data.sort(function(w,v){return v[1]-w[1]});p.sort(function(w,v){return v[1]-w[1]});for(var s=0;s<p.length;s++){this._dataIndices.push(p[s][2])}if(this.highlightColors.length==0){for(var s=0;s<this.seriesColors.length;s++){var r=e.jqplot.getColorComponents(this.seriesColors[s]);var n=[r[0],r[1],r[2]];var t=n[0]+n[1]+n[2];for(var o=0;o<3;o++){n[o]=(t>570)?n[o]*0.8:n[o]+0.4*(255-n[o]);n[o]=parseInt(n[o],10)}this.highlightColors.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}}u.postParseOptionsHooks.addOnce(l);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",a);u.eventListenerHooks.addOnce("jqplotMouseDown",b);u.eventListenerHooks.addOnce("jqplotMouseUp",k);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",m);u.postDrawHooks.addOnce(h)};e.jqplot.FunnelRenderer.prototype.setGridData=function(p){var o=0;var q=[];for(var n=0;n<this.data.length;n++){o+=this.data[n][1];q.push([this.data[n][0],this.data[n][1]])}for(var n=0;n<q.length;n++){q[n][1]=q[n][1]/o}this._bases=new Array(q.length+1);this._lengths=new Array(q.length);this.gridData=q};e.jqplot.FunnelRenderer.prototype.makeGridData=function(p,q){var o=0;var r=[];for(var n=0;n<this.data.length;n++){o+=this.data[n][1];r.push([this.data[n][0],this.data[n][1]])}for(var n=0;n<r.length;n++){r[n][1]=r[n][1]/o}this._bases=new Array(r.length+1);this._lengths=new Array(r.length);return r};e.jqplot.FunnelRenderer.prototype.drawSection=function(o,q,p,t){var u=this.fill;var n=this.lineWidth;o.save();if(t){for(var s=0;s<this.shadowDepth;s++){o.save();o.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));r()}}else{r()}function r(){o.beginPath();o.fillStyle=p;o.strokeStyle=p;o.lineWidth=n;o.moveTo(q[0][0],q[0][1]);for(var v=1;v<4;v++){o.lineTo(q[v][0],q[v][1])}o.closePath();if(u){o.fill()}else{o.stroke()}}if(t){for(var s=0;s<this.shadowDepth;s++){o.restore()}}o.restore()};e.jqplot.FunnelRenderer.prototype.draw=function(H,C,K,q){var Z;var M=(K!=undefined)?K:{};var z=0;var w=0;var S=1;this._areas=[];if(K.legendInfo&&K.legendInfo.placement=="insideGrid"){var P=K.legendInfo;switch(P.location){case"nw":z=P.width+P.xoffset;break;case"w":z=P.width+P.xoffset;break;case"sw":z=P.width+P.xoffset;break;case"ne":z=P.width+P.xoffset;S=-1;break;case"e":z=P.width+P.xoffset;S=-1;break;case"se":z=P.width+P.xoffset;S=-1;break;case"n":w=P.height+P.yoffset;break;case"s":w=P.height+P.yoffset;S=-1;break;default:break}}var u=(S==1)?this.padding.left+z:this.padding.left;var G=(S==1)?this.padding.top+w:this.padding.top;var N=(S==-1)?this.padding.right+z:this.padding.right;var p=(S==-1)?this.padding.bottom+w:this.padding.bottom;var Q=(M.shadow!=undefined)?M.shadow:this.shadow;var r=(M.showLine!=undefined)?M.showLine:this.showLine;var D=(M.fill!=undefined)?M.fill:this.fill;var I=H.canvas.width;var O=H.canvas.height;this._bases[0]=I-u-N;var J=this._length=O-G-p;var s=this._bases[0]*this.widthRatio;this._atot=J/2*(this._bases[0]+this._bases[0]*this.widthRatio);this._angle=Math.atan((this._bases[0]-s)/2/J);for(Z=0;Z<C.length;Z++){this._areas.push(C[Z][1]*this._atot)}var F,ab,X,R=0;var o=0.0001;for(Z=0;Z<this._areas.length;Z++){F=this._areas[Z]/this._bases[Z];ab=999999;this._lengths[Z]=F;X=0;while(ab>this._lengths[Z]*o&&X<100){this._lengths[Z]=this._areas[Z]/(this._bases[Z]-this._lengths[Z]*Math.tan(this._angle));ab=Math.abs(this._lengths[Z]-F);this._bases[Z+1]=this._bases[Z]-(2*this._lengths[Z]*Math.tan(this._angle));F=this._lengths[Z];X++}R+=this._lengths[Z]}this._vertices=new Array(C.length);var af=[u,G],ae=[u+this._bases[0],G],ad=[u+(this._bases[0]-this._bases[this._bases.length-1])/2,G+this._length],ac=[ad[0]+this._bases[this._bases.length-1],ad[1]];function W(ah){var x=(af[1]-ad[1])/(af[0]-ad[0]);var v=af[1]-x*af[0];var ai=ah+af[1];return[(ai-v)/x,ai]}function E(ah){var x=(ae[1]-ac[1])/(ae[0]-ac[0]);var v=ae[1]-x*ae[0];var ai=ah+ae[1];return[(ai-v)/x,ai]}var U=z,T=w;var aa=0,n=0;for(Z=0;Z<C.length;Z++){this._vertices[Z]=new Array();var V=this._vertices[Z];var B=this.sectionMargin;if(Z==0){n=0}if(Z==1){n=B/3}else{if(Z>0&&Z<C.length-1){n=B/2}else{if(Z==C.length-1){n=2*B/3}}}V.push(W(aa+n));V.push(E(aa+n));aa+=this._lengths[Z];if(Z==0){n=-2*B/3}else{if(Z>0&&Z<C.length-1){n=-B/2}else{if(Z==C.length-1){n=0}}}V.push(E(aa+n));V.push(W(aa+n))}if(this.shadow){var ag="rgba(0,0,0,"+this.shadowAlpha+")";for(var Z=0;Z<C.length;Z++){this.renderer.drawSection.call(this,H,this._vertices[Z],ag,true)}}for(var Z=0;Z<C.length;Z++){var V=this._vertices[Z];this.renderer.drawSection.call(this,H,V,this.seriesColors[Z]);if(this.showDataLabels&&C[Z][1]*100>=this.dataLabelThreshold){var L,Y;if(this.dataLabels=="label"){L=this.dataLabelFormatString||"%s";Y=e.jqplot.sprintf(L,C[Z][0])}else{if(this.dataLabels=="value"){L=this.dataLabelFormatString||"%d";Y=e.jqplot.sprintf(L,this.data[Z][1])}else{if(this.dataLabels=="percent"){L=this.dataLabelFormatString||"%d%%";Y=e.jqplot.sprintf(L,C[Z][1]*100)}else{if(this.dataLabels.constructor==Array){L=this.dataLabelFormatString||"%s";Y=e.jqplot.sprintf(L,this.dataLabels[this._dataIndices[Z]])}}}}var t=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var U=(V[0][0]+V[1][0])/2+this.canvas._offsets.left;var T=(V[1][1]+V[2][1])/2+this.canvas._offsets.top;var A=e('<span class="jqplot-funnel-series jqplot-data-label" style="position:absolute;">'+Y+"</span>").insertBefore(q.eventCanvas._elem);U-=A.width()/2;T-=A.height()/2;U=Math.round(U);T=Math.round(T);A.css({left:U,top:T})}}};e.jqplot.FunnelAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.FunnelAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.FunnelAxisRenderer.prototype.constructor=e.jqplot.FunnelAxisRenderer;e.jqplot.FunnelAxisRenderer.prototype.init=function(n){this.tickRenderer=e.jqplot.FunnelTickRenderer;e.extend(true,this,n);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.FunnelLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.FunnelLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.FunnelLegendRenderer.prototype.constructor=e.jqplot.FunnelLegendRenderer;e.jqplot.FunnelLegendRenderer.prototype.init=function(n){this.numberRows=null;this.numberColumns=null;e.extend(true,this,n)};e.jqplot.FunnelLegendRenderer.prototype.draw=function(){var q=this;if(this.show){var y=this._series;var B="position:absolute;";B+=(this.background)?"background:"+this.background+";":"";B+=(this.border)?"border:"+this.border+";":"";B+=(this.fontSize)?"font-size:"+this.fontSize+";":"";B+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";B+=(this.textColor)?"color:"+this.textColor+";":"";B+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";B+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";B+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";B+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=e('<table class="jqplot-table-legend" style="'+B+'"></table>');var F=false,x=false,n,v;var z=y[0];var o=new e.jqplot.ColorGenerator(z.seriesColors);if(z.show){var G=z.data;if(this.numberRows){n=this.numberRows;if(!this.numberColumns){v=Math.ceil(G.length/n)}else{v=this.numberColumns}}else{if(this.numberColumns){v=this.numberColumns;n=Math.ceil(G.length/this.numberColumns)}else{n=G.length;v=1}}var E,D,p,t,r,u,w,C;var A=0;for(E=0;E<n;E++){if(x){p=e('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem)}else{p=e('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem)}for(D=0;D<v;D++){if(A<G.length){u=this.labels[A]||G[A][0].toString();C=o.next();if(!x){if(E>0){F=true}else{F=false}}else{if(E==n-1){F=false}else{F=true}}w=(F)?this.rowSpacing:"0";t=e('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+w+';"><div><div class="jqplot-table-legend-swatch" style="border-color:'+C+';"></div></div></td>');r=e('<td class="jqplot-table-legend" style="padding-top:'+w+';"></td>');if(this.escapeHtml){r.text(u)}else{r.html(u)}if(x){r.prependTo(p);t.prependTo(p)}else{t.appendTo(p);r.appendTo(p)}F=true}A++}}}}return this._elem};function c(r,q,o){o=o||{};o.axesDefaults=o.axesDefaults||{};o.legend=o.legend||{};o.seriesDefaults=o.seriesDefaults||{};var n=false;if(o.seriesDefaults.renderer==e.jqplot.FunnelRenderer){n=true}else{if(o.series){for(var p=0;p<o.series.length;p++){if(o.series[p].renderer==e.jqplot.FunnelRenderer){n=true}}}}if(n){o.axesDefaults.renderer=e.jqplot.FunnelAxisRenderer;o.legend.renderer=e.jqplot.FunnelLegendRenderer;o.legend.preDraw=true;o.sortData=false}}function g(p,o,n){for(i=0;i<this.series.length;i++){if(this.series[i].renderer.constructor==e.jqplot.FunnelRenderer){if(this.series[i].highlightMouseOver){this.series[i].highlightMouseDown=false}}}this.target.bind("mouseout",{plot:this},function(q){j(q.data.plot)})}function l(n){for(var o=0;o<this.series.length;o++){this.series[o].seriesColors=this.seriesColors;this.series[o].colorGenerator=this.colorGenerator}}function d(r,q,p){var o=r.series[q];var n=r.plugins.funnelRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);o._highlightedPoint=p;r.plugins.funnelRenderer.highlightedSeriesIndex=q;o.renderer.drawSection.call(o,n._ctx,o._vertices[p],o.highlightColors[p],false)}function j(p){var n=p.plugins.funnelRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);for(var o=0;o<p.series.length;o++){p.series[o]._highlightedPoint=null}p.plugins.funnelRenderer.highlightedSeriesIndex=null;p.target.trigger("jqplotDataUnhighlight")}function a(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var o=jQuery.Event("jqplotDataMouseOver");o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p);if(s.series[p[0]].highlightMouseOver&&!(p[0]==s.plugins.funnelRenderer.highlightedSeriesIndex&&p[1]==s.series[p[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.pageX=r.pageX;n.pageY=r.pageY;s.target.trigger(n,p);d(s,p[0],p[1])}}else{if(t==null){j(s)}}}function b(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];if(r.series[o[0]].highlightMouseDown&&!(o[0]==r.plugins.funnelRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o);d(r,o[0],o[1])}}else{if(s==null){j(r)}}}function k(p,o,s,r,q){var n=q.plugins.funnelRenderer.highlightedSeriesIndex;if(n!=null&&q.series[n].highlightMouseDown){j(q)}}function f(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];var n=jQuery.Event("jqplotDataClick");n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o)}}function m(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var n=s.plugins.funnelRenderer.highlightedSeriesIndex;if(n!=null&&s.series[n].highlightMouseDown){j(s)}var o=jQuery.Event("jqplotDataRightClick");o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p)}}function h(){this.plugins.funnelRenderer={};this.plugins.funnelRenderer.highlightCanvas=new e.jqplot.GenericCanvas();var o=e(this.targetId+" .jqplot-data-label");if(o.length){e(o[0]).before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-funnelRenderer-highlight-canvas",this._plotDimensions))}else{this.eventCanvas._elem.before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-funnelRenderer-highlight-canvas",this._plotDimensions))}var n=this.plugins.funnelRenderer.highlightCanvas.setContext()}e.jqplot.preInitHooks.push(c);e.jqplot.FunnelTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)};e.jqplot.FunnelTickRenderer.prototype=new e.jqplot.AxisTickRenderer();e.jqplot.FunnelTickRenderer.prototype.constructor=e.jqplot.FunnelTickRenderer})(jQuery);
|
|
@@ -0,0 +1,374 @@
|
|
|
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
|
+
$.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Class: $.jqplot.Highlighter
|
|
23
|
+
* Plugin which will highlight data points when they are moused over.
|
|
24
|
+
*
|
|
25
|
+
* To use this plugin, include the js
|
|
26
|
+
* file in your source:
|
|
27
|
+
*
|
|
28
|
+
* > <script type="text/javascript" src="plugins/jqplot.highlighter.js"></script>
|
|
29
|
+
*
|
|
30
|
+
* A tooltip providing information about the data point is enabled by default.
|
|
31
|
+
* To disable the tooltip, set "showTooltip" to false.
|
|
32
|
+
*
|
|
33
|
+
* You can control what data is displayed in the tooltip with various
|
|
34
|
+
* options. The "tooltipAxes" option controls wether the x, y or both
|
|
35
|
+
* data values are displayed.
|
|
36
|
+
*
|
|
37
|
+
* Some chart types (e.g. hi-low-close) have more than one y value per
|
|
38
|
+
* data point. To display the additional values in the tooltip, set the
|
|
39
|
+
* "yvalues" option to the desired number of y values present (3 for a hlc chart).
|
|
40
|
+
*
|
|
41
|
+
* By default, data values will be formatted with the same formatting
|
|
42
|
+
* specifiers as used to format the axis ticks. A custom format code
|
|
43
|
+
* can be supplied with the tooltipFormatString option. This will apply
|
|
44
|
+
* to all values in the tooltip.
|
|
45
|
+
*
|
|
46
|
+
* For more complete control, the "formatString" option can be set. This
|
|
47
|
+
* Allows conplete control over tooltip formatting. Values are passed to
|
|
48
|
+
* the format string in an order determined by the "tooltipAxes" and "yvalues"
|
|
49
|
+
* options. So, if you have a hi-low-close chart and you just want to display
|
|
50
|
+
* the hi-low-close values in the tooltip, you could set a formatString like:
|
|
51
|
+
*
|
|
52
|
+
* > highlighter: {
|
|
53
|
+
* > tooltipAxes: 'y',
|
|
54
|
+
* > yvalues: 3,
|
|
55
|
+
* > formatString:'<table class="jqplot-highlighter">
|
|
56
|
+
* > <tr><td>hi:</td><td>%s</td></tr>
|
|
57
|
+
* > <tr><td>low:</td><td>%s</td></tr>
|
|
58
|
+
* > <tr><td>close:</td><td>%s</td></tr></table>'
|
|
59
|
+
* > }
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
$.jqplot.Highlighter = function(options) {
|
|
63
|
+
// Group: Properties
|
|
64
|
+
//
|
|
65
|
+
//prop: show
|
|
66
|
+
// true to show the highlight.
|
|
67
|
+
this.show = $.jqplot.config.enablePlugins;
|
|
68
|
+
// prop: markerRenderer
|
|
69
|
+
// Renderer used to draw the marker of the highlighted point.
|
|
70
|
+
// Renderer will assimilate attributes from the data point being highlighted,
|
|
71
|
+
// so no attributes need set on the renderer directly.
|
|
72
|
+
// Default is to turn off shadow drawing on the highlighted point.
|
|
73
|
+
this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false});
|
|
74
|
+
// prop: showMarker
|
|
75
|
+
// true to show the marker
|
|
76
|
+
this.showMarker = true;
|
|
77
|
+
// prop: lineWidthAdjust
|
|
78
|
+
// Pixels to add to the lineWidth of the highlight.
|
|
79
|
+
this.lineWidthAdjust = 2.5;
|
|
80
|
+
// prop: sizeAdjust
|
|
81
|
+
// Pixels to add to the overall size of the highlight.
|
|
82
|
+
this.sizeAdjust = 5;
|
|
83
|
+
// prop: showTooltip
|
|
84
|
+
// Show a tooltip with data point values.
|
|
85
|
+
this.showTooltip = true;
|
|
86
|
+
// prop: tooltipLocation
|
|
87
|
+
// Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
|
|
88
|
+
this.tooltipLocation = 'nw';
|
|
89
|
+
// prop: fadeTooltip
|
|
90
|
+
// true = fade in/out tooltip, flase = show/hide tooltip
|
|
91
|
+
this.fadeTooltip = true;
|
|
92
|
+
// prop: tooltipFadeSpeed
|
|
93
|
+
// 'slow', 'def', 'fast', or number of milliseconds.
|
|
94
|
+
this.tooltipFadeSpeed = "fast";
|
|
95
|
+
// prop: tooltipOffset
|
|
96
|
+
// Pixel offset of tooltip from the highlight.
|
|
97
|
+
this.tooltipOffset = 2;
|
|
98
|
+
// prop: tooltipAxes
|
|
99
|
+
// Which axes to display in tooltip, 'x', 'y' or 'both', 'xy' or 'yx'
|
|
100
|
+
// 'both' and 'xy' are equivalent, 'yx' reverses order of labels.
|
|
101
|
+
this.tooltipAxes = 'both';
|
|
102
|
+
// prop; tooltipSeparator
|
|
103
|
+
// String to use to separate x and y axes in tooltip.
|
|
104
|
+
this.tooltipSeparator = ', ';
|
|
105
|
+
// prop: useAxesFormatters
|
|
106
|
+
// Use the x and y axes formatters to format the text in the tooltip.
|
|
107
|
+
this.useAxesFormatters = true;
|
|
108
|
+
// prop: tooltipFormatString
|
|
109
|
+
// sprintf format string for the tooltip.
|
|
110
|
+
// Uses Ash Searle's javascript sprintf implementation
|
|
111
|
+
// found here: http://hexmen.com/blog/2007/03/printf-sprintf/
|
|
112
|
+
// See http://perldoc.perl.org/functions/sprintf.html for reference.
|
|
113
|
+
// Additional "p" and "P" format specifiers added by Chris Leonello.
|
|
114
|
+
this.tooltipFormatString = '%.5P';
|
|
115
|
+
// prop: formatString
|
|
116
|
+
// alternative to tooltipFormatString
|
|
117
|
+
// will format the whole tooltip text, populating with x, y values as
|
|
118
|
+
// indicated by tooltipAxes option. So, you could have a tooltip like:
|
|
119
|
+
// 'Date: %s, number of cats: %d' to format the whole tooltip at one go.
|
|
120
|
+
// If useAxesFormatters is true, values will be formatted according to
|
|
121
|
+
// Axes formatters and you can populate your tooltip string with
|
|
122
|
+
// %s placeholders.
|
|
123
|
+
this.formatString = null;
|
|
124
|
+
// prop: yvalues
|
|
125
|
+
// Number of y values to expect in the data point array.
|
|
126
|
+
// Typically this is 1. Certain plots, like OHLC, will
|
|
127
|
+
// have more y values in each data point array.
|
|
128
|
+
this.yvalues = 1;
|
|
129
|
+
// prop: bringSeriesToFront
|
|
130
|
+
// This option requires jQuery 1.4+
|
|
131
|
+
// True to bring the series of the highlighted point to the front
|
|
132
|
+
// of other series.
|
|
133
|
+
this.bringSeriesToFront = false;
|
|
134
|
+
this._tooltipElem;
|
|
135
|
+
this.isHighlighting = false;
|
|
136
|
+
|
|
137
|
+
$.extend(true, this, options);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// axis.renderer.tickrenderer.formatter
|
|
141
|
+
|
|
142
|
+
// called with scope of plot
|
|
143
|
+
$.jqplot.Highlighter.init = function (target, data, opts){
|
|
144
|
+
var options = opts || {};
|
|
145
|
+
// add a highlighter attribute to the plot
|
|
146
|
+
this.plugins.highlighter = new $.jqplot.Highlighter(options.highlighter);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// called within scope of series
|
|
150
|
+
$.jqplot.Highlighter.parseOptions = function (defaults, options) {
|
|
151
|
+
// Add a showHighlight option to the series
|
|
152
|
+
// and set it to true by default.
|
|
153
|
+
this.showHighlight = true;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// called within context of plot
|
|
157
|
+
// create a canvas which we can draw on.
|
|
158
|
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
|
159
|
+
$.jqplot.Highlighter.postPlotDraw = function() {
|
|
160
|
+
this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas();
|
|
161
|
+
|
|
162
|
+
this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions));
|
|
163
|
+
var hctx = this.plugins.highlighter.highlightCanvas.setContext();
|
|
164
|
+
|
|
165
|
+
var p = this.plugins.highlighter;
|
|
166
|
+
p._tooltipElem = $('<div class="jqplot-highlighter-tooltip" style="position:absolute;display:none"></div>');
|
|
167
|
+
this.eventCanvas._elem.before(p._tooltipElem);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
$.jqplot.preInitHooks.push($.jqplot.Highlighter.init);
|
|
171
|
+
$.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Highlighter.parseOptions);
|
|
172
|
+
$.jqplot.postDrawHooks.push($.jqplot.Highlighter.postPlotDraw);
|
|
173
|
+
|
|
174
|
+
function draw(plot, neighbor) {
|
|
175
|
+
var hl = plot.plugins.highlighter;
|
|
176
|
+
var s = plot.series[neighbor.seriesIndex];
|
|
177
|
+
var smr = s.markerRenderer;
|
|
178
|
+
var mr = hl.markerRenderer;
|
|
179
|
+
mr.style = smr.style;
|
|
180
|
+
mr.lineWidth = smr.lineWidth + hl.lineWidthAdjust;
|
|
181
|
+
mr.size = smr.size + hl.sizeAdjust;
|
|
182
|
+
var rgba = $.jqplot.getColorComponents(smr.color);
|
|
183
|
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
|
184
|
+
var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]);
|
|
185
|
+
mr.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')';
|
|
186
|
+
mr.init();
|
|
187
|
+
mr.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], hl.highlightCanvas._ctx);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function showTooltip(plot, series, neighbor) {
|
|
191
|
+
// neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}
|
|
192
|
+
// gridData should be x,y pixel coords on the grid.
|
|
193
|
+
// add the plot._gridPadding to that to get x,y in the target.
|
|
194
|
+
var hl = plot.plugins.highlighter;
|
|
195
|
+
var elem = hl._tooltipElem;
|
|
196
|
+
if (hl.useAxesFormatters) {
|
|
197
|
+
var xf = series._xaxis._ticks[0].formatter;
|
|
198
|
+
var yf = series._yaxis._ticks[0].formatter;
|
|
199
|
+
var xfstr = series._xaxis._ticks[0].formatString;
|
|
200
|
+
var yfstr = series._yaxis._ticks[0].formatString;
|
|
201
|
+
var str;
|
|
202
|
+
var xstr = xf(xfstr, neighbor.data[0]);
|
|
203
|
+
var ystrs = [];
|
|
204
|
+
for (var i=1; i<hl.yvalues+1; i++) {
|
|
205
|
+
ystrs.push(yf(yfstr, neighbor.data[i]));
|
|
206
|
+
}
|
|
207
|
+
if (hl.formatString) {
|
|
208
|
+
switch (hl.tooltipAxes) {
|
|
209
|
+
case 'both':
|
|
210
|
+
case 'xy':
|
|
211
|
+
ystrs.unshift(xstr);
|
|
212
|
+
ystrs.unshift(hl.formatString);
|
|
213
|
+
str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
|
|
214
|
+
break;
|
|
215
|
+
case 'yx':
|
|
216
|
+
ystrs.push(xstr);
|
|
217
|
+
ystrs.unshift(hl.formatString);
|
|
218
|
+
str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
|
|
219
|
+
break;
|
|
220
|
+
case 'x':
|
|
221
|
+
str = $.jqplot.sprintf.apply($.jqplot.sprintf, [hl.formatString, xstr]);
|
|
222
|
+
break;
|
|
223
|
+
case 'y':
|
|
224
|
+
ystrs.unshift(hl.formatString);
|
|
225
|
+
str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
|
|
226
|
+
break;
|
|
227
|
+
default: // same as xy
|
|
228
|
+
ystrs.unshift(xstr);
|
|
229
|
+
ystrs.unshift(hl.formatString);
|
|
230
|
+
str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
switch (hl.tooltipAxes) {
|
|
236
|
+
case 'both':
|
|
237
|
+
case 'xy':
|
|
238
|
+
str = xstr;
|
|
239
|
+
for (var i=0; i<ystrs.length; i++) {
|
|
240
|
+
str += hl.tooltipSeparator + ystrs[i];
|
|
241
|
+
}
|
|
242
|
+
break;
|
|
243
|
+
case 'yx':
|
|
244
|
+
str = '';
|
|
245
|
+
for (var i=0; i<ystrs.length; i++) {
|
|
246
|
+
str += ystrs[i] + hl.tooltipSeparator;
|
|
247
|
+
}
|
|
248
|
+
str += xstr;
|
|
249
|
+
break;
|
|
250
|
+
case 'x':
|
|
251
|
+
str = xstr;
|
|
252
|
+
break;
|
|
253
|
+
case 'y':
|
|
254
|
+
str = '';
|
|
255
|
+
for (var i=0; i<ystrs.length; i++) {
|
|
256
|
+
str += ystrs[i] + hl.tooltipSeparator;
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
default: // same as 'xy'
|
|
260
|
+
str = xstr;
|
|
261
|
+
for (var i=0; i<ystrs.length; i++) {
|
|
262
|
+
str += hl.tooltipSeparator + ystrs[i];
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
var str;
|
|
271
|
+
if (hl.tooltipAxes == 'both' || hl.tooltipAxes == 'xy') {
|
|
272
|
+
str = $.jqplot.sprintf(hl.tooltipFormatString, neighbor.data[0]) + hl.tooltipSeparator + $.jqplot.sprintf(hl.tooltipFormatString, neighbor.data[1]);
|
|
273
|
+
}
|
|
274
|
+
else if (hl.tooltipAxes == 'yx') {
|
|
275
|
+
str = $.jqplot.sprintf(hl.tooltipFormatString, neighbor.data[1]) + hl.tooltipSeparator + $.jqplot.sprintf(hl.tooltipFormatString, neighbor.data[0]);
|
|
276
|
+
}
|
|
277
|
+
else if (hl.tooltipAxes == 'x') {
|
|
278
|
+
str = $.jqplot.sprintf(hl.tooltipFormatString, neighbor.data[0]);
|
|
279
|
+
}
|
|
280
|
+
else if (hl.tooltipAxes == 'y') {
|
|
281
|
+
str = $.jqplot.sprintf(hl.tooltipFormatString, neighbor.data[1]);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
elem.html(str);
|
|
285
|
+
var gridpos = {x:neighbor.gridData[0], y:neighbor.gridData[1]};
|
|
286
|
+
var ms = 0;
|
|
287
|
+
var fact = 0.707;
|
|
288
|
+
if (series.markerRenderer.show == true) {
|
|
289
|
+
ms = (series.markerRenderer.size + hl.sizeAdjust)/2;
|
|
290
|
+
}
|
|
291
|
+
switch (hl.tooltipLocation) {
|
|
292
|
+
case 'nw':
|
|
293
|
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - hl.tooltipOffset - fact * ms;
|
|
294
|
+
var y = gridpos.y + plot._gridPadding.top - hl.tooltipOffset - elem.outerHeight(true) - fact * ms;
|
|
295
|
+
break;
|
|
296
|
+
case 'n':
|
|
297
|
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
|
|
298
|
+
var y = gridpos.y + plot._gridPadding.top - hl.tooltipOffset - elem.outerHeight(true) - ms;
|
|
299
|
+
break;
|
|
300
|
+
case 'ne':
|
|
301
|
+
var x = gridpos.x + plot._gridPadding.left + hl.tooltipOffset + fact * ms;
|
|
302
|
+
var y = gridpos.y + plot._gridPadding.top - hl.tooltipOffset - elem.outerHeight(true) - fact * ms;
|
|
303
|
+
break;
|
|
304
|
+
case 'e':
|
|
305
|
+
var x = gridpos.x + plot._gridPadding.left + hl.tooltipOffset + ms;
|
|
306
|
+
var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
|
|
307
|
+
break;
|
|
308
|
+
case 'se':
|
|
309
|
+
var x = gridpos.x + plot._gridPadding.left + hl.tooltipOffset + fact * ms;
|
|
310
|
+
var y = gridpos.y + plot._gridPadding.top + hl.tooltipOffset + fact * ms;
|
|
311
|
+
break;
|
|
312
|
+
case 's':
|
|
313
|
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
|
|
314
|
+
var y = gridpos.y + plot._gridPadding.top + hl.tooltipOffset + ms;
|
|
315
|
+
break;
|
|
316
|
+
case 'sw':
|
|
317
|
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - hl.tooltipOffset - fact * ms;
|
|
318
|
+
var y = gridpos.y + plot._gridPadding.top + hl.tooltipOffset + fact * ms;
|
|
319
|
+
break;
|
|
320
|
+
case 'w':
|
|
321
|
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - hl.tooltipOffset - ms;
|
|
322
|
+
var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
|
|
323
|
+
break;
|
|
324
|
+
default: // same as 'nw'
|
|
325
|
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - hl.tooltipOffset - fact * ms;
|
|
326
|
+
var y = gridpos.y + plot._gridPadding.top - hl.tooltipOffset - elem.outerHeight(true) - fact * ms;
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
elem.css('left', x);
|
|
330
|
+
elem.css('top', y);
|
|
331
|
+
if (hl.fadeTooltip) {
|
|
332
|
+
// Fix for stacked up animations. Thnanks Trevor!
|
|
333
|
+
elem.stop(true,true).fadeIn(hl.tooltipFadeSpeed);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
elem.show();
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
|
342
|
+
var hl = plot.plugins.highlighter;
|
|
343
|
+
var c = plot.plugins.cursor;
|
|
344
|
+
if (hl.show) {
|
|
345
|
+
if (neighbor == null && hl.isHighlighting) {
|
|
346
|
+
var ctx = hl.highlightCanvas._ctx;
|
|
347
|
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
348
|
+
if (hl.fadeTooltip) {
|
|
349
|
+
hl._tooltipElem.fadeOut(hl.tooltipFadeSpeed);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
hl._tooltipElem.hide();
|
|
353
|
+
}
|
|
354
|
+
if (hl.bringSeriesToFront) {
|
|
355
|
+
plot.restorePreviousSeriesOrder();
|
|
356
|
+
}
|
|
357
|
+
hl.isHighlighting = false;
|
|
358
|
+
|
|
359
|
+
}
|
|
360
|
+
if (neighbor != null && plot.series[neighbor.seriesIndex].showHighlight && !hl.isHighlighting) {
|
|
361
|
+
hl.isHighlighting = true;
|
|
362
|
+
if (hl.showMarker) {
|
|
363
|
+
draw(plot, neighbor);
|
|
364
|
+
}
|
|
365
|
+
if (hl.showTooltip && (!c || !c._zoom.started)) {
|
|
366
|
+
showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
|
|
367
|
+
}
|
|
368
|
+
if (hl.bringSeriesToFront) {
|
|
369
|
+
plot.moveSeriesToFront(neighbor.seriesIndex);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})(jQuery);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2009 - 2010 Chris Leonello
|
|
3
|
+
* jqPlot is currently available for use in all personal or commercial projects
|
|
4
|
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
|
5
|
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
|
6
|
+
* choose the license that best suits your project and use it accordingly.
|
|
7
|
+
*
|
|
8
|
+
* Although not required, the author would appreciate an email letting him
|
|
9
|
+
* know of any substantial use of jqPlot. You can reach the author at:
|
|
10
|
+
* chris at jqplot or see http://www.jqplot.com/info.php .
|
|
11
|
+
*
|
|
12
|
+
* If you are feeling kind and generous, consider supporting the project by
|
|
13
|
+
* making a donation at: http://www.jqplot.com/donate.php .
|
|
14
|
+
*
|
|
15
|
+
* jqPlot includes date instance methods and printf/sprintf functions by other authors:
|
|
16
|
+
*
|
|
17
|
+
* Date instance methods contained in jqplot.dateMethods.js:
|
|
18
|
+
*
|
|
19
|
+
* author Ken Snyder (ken d snyder at gmail dot com)
|
|
20
|
+
* date 2008-09-10
|
|
21
|
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
|
22
|
+
* license Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
|
23
|
+
*
|
|
24
|
+
* JavaScript printf/sprintf functions contained in jqplot.sprintf.js:
|
|
25
|
+
*
|
|
26
|
+
* version 2007.04.27
|
|
27
|
+
* author Ash Searle
|
|
28
|
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
|
29
|
+
* http://hexmen.com/js/sprintf.js
|
|
30
|
+
* The author (Ash Searle) has placed this code in the public domain:
|
|
31
|
+
* "This code is unrestricted: you are free to use it however you like."
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
(function(b){b.jqplot.eventListenerHooks.push(["jqplotMouseMove",c]);b.jqplot.Highlighter=function(e){this.show=b.jqplot.config.enablePlugins;this.markerRenderer=new b.jqplot.MarkerRenderer({shadow:false});this.showMarker=true;this.lineWidthAdjust=2.5;this.sizeAdjust=5;this.showTooltip=true;this.tooltipLocation="nw";this.fadeTooltip=true;this.tooltipFadeSpeed="fast";this.tooltipOffset=2;this.tooltipAxes="both";this.tooltipSeparator=", ";this.useAxesFormatters=true;this.tooltipFormatString="%.5P";this.formatString=null;this.yvalues=1;this.bringSeriesToFront=false;this._tooltipElem;this.isHighlighting=false;b.extend(true,this,e)};b.jqplot.Highlighter.init=function(h,g,f){var e=f||{};this.plugins.highlighter=new b.jqplot.Highlighter(e.highlighter)};b.jqplot.Highlighter.parseOptions=function(f,e){this.showHighlight=true};b.jqplot.Highlighter.postPlotDraw=function(){this.plugins.highlighter.highlightCanvas=new b.jqplot.GenericCanvas();this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding,"jqplot-highlight-canvas",this._plotDimensions));var f=this.plugins.highlighter.highlightCanvas.setContext();var e=this.plugins.highlighter;e._tooltipElem=b('<div class="jqplot-highlighter-tooltip" style="position:absolute;display:none"></div>');this.eventCanvas._elem.before(e._tooltipElem)};b.jqplot.preInitHooks.push(b.jqplot.Highlighter.init);b.jqplot.preParseSeriesOptionsHooks.push(b.jqplot.Highlighter.parseOptions);b.jqplot.postDrawHooks.push(b.jqplot.Highlighter.postPlotDraw);function a(j,l){var g=j.plugins.highlighter;var m=j.series[l.seriesIndex];var e=m.markerRenderer;var f=g.markerRenderer;f.style=e.style;f.lineWidth=e.lineWidth+g.lineWidthAdjust;f.size=e.size+g.sizeAdjust;var i=b.jqplot.getColorComponents(e.color);var k=[i[0],i[1],i[2]];var h=(i[3]>=0.6)?i[3]*0.6:i[3]*(2-i[3]);f.color="rgba("+k[0]+","+k[1]+","+k[2]+","+h+")";f.init();f.draw(m.gridData[l.pointIndex][0],m.gridData[l.pointIndex][1],g.highlightCanvas._ctx)}function d(s,m,j){var g=s.plugins.highlighter;var v=g._tooltipElem;if(g.useAxesFormatters){var q=m._xaxis._ticks[0].formatter;var e=m._yaxis._ticks[0].formatter;var w=m._xaxis._ticks[0].formatString;var n=m._yaxis._ticks[0].formatString;var r;var o=q(w,j.data[0]);var h=[];for(var t=1;t<g.yvalues+1;t++){h.push(e(n,j.data[t]))}if(g.formatString){switch(g.tooltipAxes){case"both":case"xy":h.unshift(o);h.unshift(g.formatString);r=b.jqplot.sprintf.apply(b.jqplot.sprintf,h);break;case"yx":h.push(o);h.unshift(g.formatString);r=b.jqplot.sprintf.apply(b.jqplot.sprintf,h);break;case"x":r=b.jqplot.sprintf.apply(b.jqplot.sprintf,[g.formatString,o]);break;case"y":h.unshift(g.formatString);r=b.jqplot.sprintf.apply(b.jqplot.sprintf,h);break;default:h.unshift(o);h.unshift(g.formatString);r=b.jqplot.sprintf.apply(b.jqplot.sprintf,h);break}}else{switch(g.tooltipAxes){case"both":case"xy":r=o;for(var t=0;t<h.length;t++){r+=g.tooltipSeparator+h[t]}break;case"yx":r="";for(var t=0;t<h.length;t++){r+=h[t]+g.tooltipSeparator}r+=o;break;case"x":r=o;break;case"y":r="";for(var t=0;t<h.length;t++){r+=h[t]+g.tooltipSeparator}break;default:r=o;for(var t=0;t<h.length;t++){r+=g.tooltipSeparator+h[t]}break}}}else{var r;if(g.tooltipAxes=="both"||g.tooltipAxes=="xy"){r=b.jqplot.sprintf(g.tooltipFormatString,j.data[0])+g.tooltipSeparator+b.jqplot.sprintf(g.tooltipFormatString,j.data[1])}else{if(g.tooltipAxes=="yx"){r=b.jqplot.sprintf(g.tooltipFormatString,j.data[1])+g.tooltipSeparator+b.jqplot.sprintf(g.tooltipFormatString,j.data[0])}else{if(g.tooltipAxes=="x"){r=b.jqplot.sprintf(g.tooltipFormatString,j.data[0])}else{if(g.tooltipAxes=="y"){r=b.jqplot.sprintf(g.tooltipFormatString,j.data[1])}}}}}v.html(r);var u={x:j.gridData[0],y:j.gridData[1]};var p=0;var f=0.707;if(m.markerRenderer.show==true){p=(m.markerRenderer.size+g.sizeAdjust)/2}switch(g.tooltipLocation){case"nw":var l=u.x+s._gridPadding.left-v.outerWidth(true)-g.tooltipOffset-f*p;var k=u.y+s._gridPadding.top-g.tooltipOffset-v.outerHeight(true)-f*p;break;case"n":var l=u.x+s._gridPadding.left-v.outerWidth(true)/2;var k=u.y+s._gridPadding.top-g.tooltipOffset-v.outerHeight(true)-p;break;case"ne":var l=u.x+s._gridPadding.left+g.tooltipOffset+f*p;var k=u.y+s._gridPadding.top-g.tooltipOffset-v.outerHeight(true)-f*p;break;case"e":var l=u.x+s._gridPadding.left+g.tooltipOffset+p;var k=u.y+s._gridPadding.top-v.outerHeight(true)/2;break;case"se":var l=u.x+s._gridPadding.left+g.tooltipOffset+f*p;var k=u.y+s._gridPadding.top+g.tooltipOffset+f*p;break;case"s":var l=u.x+s._gridPadding.left-v.outerWidth(true)/2;var k=u.y+s._gridPadding.top+g.tooltipOffset+p;break;case"sw":var l=u.x+s._gridPadding.left-v.outerWidth(true)-g.tooltipOffset-f*p;var k=u.y+s._gridPadding.top+g.tooltipOffset+f*p;break;case"w":var l=u.x+s._gridPadding.left-v.outerWidth(true)-g.tooltipOffset-p;var k=u.y+s._gridPadding.top-v.outerHeight(true)/2;break;default:var l=u.x+s._gridPadding.left-v.outerWidth(true)-g.tooltipOffset-f*p;var k=u.y+s._gridPadding.top-g.tooltipOffset-v.outerHeight(true)-f*p;break}v.css("left",l);v.css("top",k);if(g.fadeTooltip){v.stop(true,true).fadeIn(g.tooltipFadeSpeed)}else{v.show()}}function c(h,g,k,j,i){var e=i.plugins.highlighter;var l=i.plugins.cursor;if(e.show){if(j==null&&e.isHighlighting){var f=e.highlightCanvas._ctx;f.clearRect(0,0,f.canvas.width,f.canvas.height);if(e.fadeTooltip){e._tooltipElem.fadeOut(e.tooltipFadeSpeed)}else{e._tooltipElem.hide()}if(e.bringSeriesToFront){i.restorePreviousSeriesOrder()}e.isHighlighting=false}if(j!=null&&i.series[j.seriesIndex].showHighlight&&!e.isHighlighting){e.isHighlighting=true;if(e.showMarker){a(i,j)}if(e.showTooltip&&(!l||!l._zoom.started)){d(i,i.series[j.seriesIndex],j)}if(e.bringSeriesToFront){i.moveSeriesToFront(j.seriesIndex)}}}}})(jQuery);
|
|
@@ -0,0 +1,434 @@
|
|
|
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.LogAxisRenderer
|
|
21
|
+
* A plugin for a jqPlot to render a logarithmic axis.
|
|
22
|
+
*
|
|
23
|
+
* To use this renderer, include the plugin in your source
|
|
24
|
+
* > <script type="text/javascript" language="javascript" src="plugins/jqplot.logAxisRenderer.js"></script>
|
|
25
|
+
*
|
|
26
|
+
* and supply the appropriate options to your plot
|
|
27
|
+
*
|
|
28
|
+
* > {axes:{xaxis:{renderer:$.jqplot.LogAxisRenderer}}}
|
|
29
|
+
**/
|
|
30
|
+
$.jqplot.LogAxisRenderer = function() {
|
|
31
|
+
$.jqplot.LinearAxisRenderer.call(this);
|
|
32
|
+
// prop: axisDefaults
|
|
33
|
+
// Default properties which will be applied directly to the series.
|
|
34
|
+
//
|
|
35
|
+
// Group: Properties
|
|
36
|
+
//
|
|
37
|
+
// Properties
|
|
38
|
+
//
|
|
39
|
+
/// base - the logarithmic base, commonly 2, 10 or Math.E
|
|
40
|
+
// tickDistribution - 'even' or 'power'. 'even' gives equal pixel
|
|
41
|
+
// spacing of the ticks on the plot. 'power' gives ticks in powers
|
|
42
|
+
// of 10.
|
|
43
|
+
this.axisDefaults = {
|
|
44
|
+
base : 10,
|
|
45
|
+
tickDistribution :'even'
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
$.jqplot.LogAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
|
50
|
+
$.jqplot.LogAxisRenderer.prototype.constructor = $.jqplot.LogAxisRenderer;
|
|
51
|
+
|
|
52
|
+
$.jqplot.LogAxisRenderer.prototype.init = function(options) {
|
|
53
|
+
// prop: tickRenderer
|
|
54
|
+
// A class of a rendering engine for creating the ticks labels displayed on the plot,
|
|
55
|
+
// See <$.jqplot.AxisTickRenderer>.
|
|
56
|
+
// this.tickRenderer = $.jqplot.AxisTickRenderer;
|
|
57
|
+
// this.labelRenderer = $.jqplot.AxisLabelRenderer;
|
|
58
|
+
$.extend(true, this.renderer, options);
|
|
59
|
+
for (var d in this.renderer.axisDefaults) {
|
|
60
|
+
if (this[d] == null) {
|
|
61
|
+
this[d] = this.renderer.axisDefaults[d];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var db = this._dataBounds;
|
|
65
|
+
// Go through all the series attached to this axis and find
|
|
66
|
+
// the min/max bounds for this axis.
|
|
67
|
+
for (var i=0; i<this._series.length; i++) {
|
|
68
|
+
var s = this._series[i];
|
|
69
|
+
var d = s.data;
|
|
70
|
+
|
|
71
|
+
for (var j=0; j<d.length; j++) {
|
|
72
|
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
|
73
|
+
if (d[j][0] > db.max || db.max == null) {
|
|
74
|
+
db.max = d[j][0];
|
|
75
|
+
}
|
|
76
|
+
if (d[j][0] > db.max || db.max == null) {
|
|
77
|
+
db.max = d[j][0];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
if (d[j][1] < db.min || db.min == null) {
|
|
82
|
+
db.min = d[j][1];
|
|
83
|
+
}
|
|
84
|
+
if (d[j][1] > db.max || db.max == null) {
|
|
85
|
+
db.max = d[j][1];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
$.jqplot.LogAxisRenderer.prototype.createTicks = function() {
|
|
93
|
+
// we're are operating on an axis here
|
|
94
|
+
var ticks = this._ticks;
|
|
95
|
+
var userTicks = this.ticks;
|
|
96
|
+
var name = this.name;
|
|
97
|
+
var db = this._dataBounds;
|
|
98
|
+
var dim, interval;
|
|
99
|
+
var min, max;
|
|
100
|
+
var pos1, pos2;
|
|
101
|
+
var tt, i;
|
|
102
|
+
|
|
103
|
+
// if we already have ticks, use them.
|
|
104
|
+
// ticks must be in order of increasing value.
|
|
105
|
+
if (userTicks.length) {
|
|
106
|
+
// ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
|
|
107
|
+
for (i=0; i<userTicks.length; i++){
|
|
108
|
+
var ut = userTicks[i];
|
|
109
|
+
var t = new this.tickRenderer(this.tickOptions);
|
|
110
|
+
if (ut.constructor == Array) {
|
|
111
|
+
t.value = ut[0];
|
|
112
|
+
t.label = ut[1];
|
|
113
|
+
if (!this.showTicks) {
|
|
114
|
+
t.showLabel = false;
|
|
115
|
+
t.showMark = false;
|
|
116
|
+
}
|
|
117
|
+
else if (!this.showTickMarks) {
|
|
118
|
+
t.showMark = false;
|
|
119
|
+
}
|
|
120
|
+
t.setTick(ut[0], this.name);
|
|
121
|
+
this._ticks.push(t);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
else {
|
|
125
|
+
t.value = ut;
|
|
126
|
+
if (!this.showTicks) {
|
|
127
|
+
t.showLabel = false;
|
|
128
|
+
t.showMark = false;
|
|
129
|
+
}
|
|
130
|
+
else if (!this.showTickMarks) {
|
|
131
|
+
t.showMark = false;
|
|
132
|
+
}
|
|
133
|
+
t.setTick(ut, this.name);
|
|
134
|
+
this._ticks.push(t);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
this.numberTicks = userTicks.length;
|
|
138
|
+
this.min = this._ticks[0].value;
|
|
139
|
+
this.max = this._ticks[this.numberTicks-1].value;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// we don't have any ticks yet, let's make some!
|
|
143
|
+
else {
|
|
144
|
+
if (name == 'xaxis' || name == 'x2axis') {
|
|
145
|
+
dim = this._plotDimensions.width;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
dim = this._plotDimensions.height;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
min = ((this.min != null) ? this.min : db.min);
|
|
152
|
+
max = ((this.max != null) ? this.max : db.max);
|
|
153
|
+
|
|
154
|
+
// if min and max are same, space them out a bit
|
|
155
|
+
if (min == max) {
|
|
156
|
+
var adj = 0.05;
|
|
157
|
+
min = min*(1-adj);
|
|
158
|
+
max = max*(1+adj);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// perform some checks
|
|
162
|
+
if (this.min != null && this.min <= 0) {
|
|
163
|
+
throw('log axis minimum must be greater than 0');
|
|
164
|
+
}
|
|
165
|
+
if (this.max != null && this.max <= 0) {
|
|
166
|
+
throw('log axis maximum must be greater than 0');
|
|
167
|
+
}
|
|
168
|
+
// if (this.pad >1.99) this.pad = 1.99;
|
|
169
|
+
var range = max - min;
|
|
170
|
+
var rmin, rmax;
|
|
171
|
+
|
|
172
|
+
if (this.tickDistribution == 'even') {
|
|
173
|
+
rmin = (this.min != null) ? this.min : min - min*((this.padMin-1)/2);
|
|
174
|
+
rmax = (this.max != null) ? this.max : max + max*((this.padMax-1)/2);
|
|
175
|
+
this.min = rmin;
|
|
176
|
+
this.max = rmax;
|
|
177
|
+
range = this.max - this.min;
|
|
178
|
+
|
|
179
|
+
if (this.numberTicks == null){
|
|
180
|
+
if (dim > 100) {
|
|
181
|
+
this.numberTicks = parseInt(3+(dim-100)/75, 10);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
this.numberTicks = 2;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
var u = Math.pow(this.base, (1/(this.numberTicks-1)*Math.log(this.max/this.min)/Math.log(this.base)));
|
|
189
|
+
for (var i=0; i<this.numberTicks; i++){
|
|
190
|
+
tt = this.min * Math.pow(u, i);
|
|
191
|
+
var t = new this.tickRenderer(this.tickOptions);
|
|
192
|
+
if (!this.showTicks) {
|
|
193
|
+
t.showLabel = false;
|
|
194
|
+
t.showMark = false;
|
|
195
|
+
}
|
|
196
|
+
else if (!this.showTickMarks) {
|
|
197
|
+
t.showMark = false;
|
|
198
|
+
}
|
|
199
|
+
t.setTick(tt, this.name);
|
|
200
|
+
this._ticks.push(t);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
else if (this.tickDistribution == 'power'){
|
|
206
|
+
// for power distribution, open up range to get a nice power of axis.renderer.base.
|
|
207
|
+
// power distribution won't respect the user's min/max settings.
|
|
208
|
+
rmin = Math.pow(this.base, Math.ceil(Math.log(min*(2-this.padMin))/Math.log(this.base))-1);
|
|
209
|
+
rmax = Math.pow(this.base, Math.floor(Math.log(max*this.padMax)/Math.log(this.base))+1);
|
|
210
|
+
this.min = rmin;
|
|
211
|
+
this.max = rmax;
|
|
212
|
+
range = this.max - this.min;
|
|
213
|
+
|
|
214
|
+
var fittedTicks = 0;
|
|
215
|
+
var minorTicks = 0;
|
|
216
|
+
if (this.numberTicks == null){
|
|
217
|
+
if (dim > 100) {
|
|
218
|
+
this.numberTicks = Math.round(Math.log(this.max/this.min)/Math.log(this.base) + 1);
|
|
219
|
+
if (this.numberTicks < 2) {
|
|
220
|
+
this.numberTicks = 2;
|
|
221
|
+
}
|
|
222
|
+
fittedTicks = parseInt(3+(dim-100)/75, 10);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
this.numberTicks = 2;
|
|
226
|
+
fittedTicks = 2;
|
|
227
|
+
}
|
|
228
|
+
// if we don't have enough ticks, add some intermediate ticks
|
|
229
|
+
// how many to have between major ticks.
|
|
230
|
+
if (this.numberTicks < fittedTicks-1) {
|
|
231
|
+
minorTicks = Math.floor(fittedTicks/this.numberTicks);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
for (var i=0; i<this.numberTicks; i++){
|
|
236
|
+
tt = Math.pow(this.base, i - this.numberTicks + 1) * this.max;
|
|
237
|
+
var t = new this.tickRenderer(this.tickOptions);
|
|
238
|
+
if (!this.showTicks) {
|
|
239
|
+
t.showLabel = false;
|
|
240
|
+
t.showMark = false;
|
|
241
|
+
}
|
|
242
|
+
else if (!this.showTickMarks) {
|
|
243
|
+
t.showMark = false;
|
|
244
|
+
}
|
|
245
|
+
t.setTick(tt, this.name);
|
|
246
|
+
this._ticks.push(t);
|
|
247
|
+
|
|
248
|
+
if (minorTicks && i<this.numberTicks-1) {
|
|
249
|
+
var tt1 = Math.pow(this.base, i - this.numberTicks + 2) * this.max;
|
|
250
|
+
var spread = tt1 - tt;
|
|
251
|
+
var interval = tt1 / (minorTicks+1);
|
|
252
|
+
for (var j=minorTicks-1; j>=0; j--) {
|
|
253
|
+
var val = tt1-interval*(j+1);
|
|
254
|
+
var t = new this.tickRenderer(this.tickOptions);
|
|
255
|
+
if (!this.showTicks) {
|
|
256
|
+
t.showLabel = false;
|
|
257
|
+
t.showMark = false;
|
|
258
|
+
}
|
|
259
|
+
else if (!this.showTickMarks) {
|
|
260
|
+
t.showMark = false;
|
|
261
|
+
}
|
|
262
|
+
t.setTick(val, this.name);
|
|
263
|
+
this._ticks.push(t);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
$.jqplot.LogAxisRenderer.prototype.pack = function(pos, offsets) {
|
|
272
|
+
var lb = parseInt(this.base, 10);
|
|
273
|
+
var ticks = this._ticks;
|
|
274
|
+
var trans = function (v) { return Math.log(v)/Math.log(lb); };
|
|
275
|
+
var invtrans = function (v) { return Math.pow(Math.E, (Math.log(lb)*v)); };
|
|
276
|
+
max = trans(this.max);
|
|
277
|
+
min = trans(this.min);
|
|
278
|
+
var offmax = offsets.max;
|
|
279
|
+
var offmin = offsets.min;
|
|
280
|
+
var lshow = (this._label == null) ? false : this._label.show;
|
|
281
|
+
|
|
282
|
+
for (var p in pos) {
|
|
283
|
+
this._elem.css(p, pos[p]);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
this._offsets = offsets;
|
|
287
|
+
// pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
|
|
288
|
+
var pixellength = offmax - offmin;
|
|
289
|
+
var unitlength = max - min;
|
|
290
|
+
|
|
291
|
+
// point to unit and unit to point conversions references to Plot DOM element top left corner.
|
|
292
|
+
this.p2u = function(p){
|
|
293
|
+
return invtrans((p - offmin) * unitlength / pixellength + min);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
this.u2p = function(u){
|
|
297
|
+
return (trans(u) - min) * pixellength / unitlength + offmin;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
if (this.name == 'xaxis' || this.name == 'x2axis'){
|
|
301
|
+
this.series_u2p = function(u){
|
|
302
|
+
return (trans(u) - min) * pixellength / unitlength;
|
|
303
|
+
};
|
|
304
|
+
this.series_p2u = function(p){
|
|
305
|
+
return invtrans(p * unitlength / pixellength + min);
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
// yaxis is max at top of canvas.
|
|
309
|
+
else {
|
|
310
|
+
this.series_u2p = function(u){
|
|
311
|
+
return (trans(u) - max) * pixellength / unitlength;
|
|
312
|
+
};
|
|
313
|
+
this.series_p2u = function(p){
|
|
314
|
+
return invtrans(p * unitlength / pixellength + max);
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (this.show) {
|
|
319
|
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
|
320
|
+
for (i=0; i<ticks.length; i++) {
|
|
321
|
+
var t = ticks[i];
|
|
322
|
+
if (t.show && t.showLabel) {
|
|
323
|
+
var shim;
|
|
324
|
+
|
|
325
|
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
|
326
|
+
switch (t.labelPosition) {
|
|
327
|
+
case 'auto':
|
|
328
|
+
// position at end
|
|
329
|
+
if (t.angle < 0) {
|
|
330
|
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
|
331
|
+
}
|
|
332
|
+
// position at start
|
|
333
|
+
else {
|
|
334
|
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
|
335
|
+
}
|
|
336
|
+
break;
|
|
337
|
+
case 'end':
|
|
338
|
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
|
339
|
+
break;
|
|
340
|
+
case 'start':
|
|
341
|
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
|
342
|
+
break;
|
|
343
|
+
case 'middle':
|
|
344
|
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
|
345
|
+
break;
|
|
346
|
+
default:
|
|
347
|
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
|
348
|
+
break;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
shim = -t.getWidth()/2;
|
|
353
|
+
}
|
|
354
|
+
// var shim = t.getWidth()/2;
|
|
355
|
+
var val = this.u2p(t.value) + shim + 'px';
|
|
356
|
+
t._elem.css('left', val);
|
|
357
|
+
t.pack();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (lshow) {
|
|
361
|
+
var w = this._label._elem.outerWidth(true);
|
|
362
|
+
this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
|
|
363
|
+
if (this.name == 'xaxis') {
|
|
364
|
+
this._label._elem.css('bottom', '0px');
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
this._label._elem.css('top', '0px');
|
|
368
|
+
}
|
|
369
|
+
this._label.pack();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
for (i=0; i<ticks.length; i++) {
|
|
374
|
+
var t = ticks[i];
|
|
375
|
+
if (t.show && t.showLabel) {
|
|
376
|
+
var shim;
|
|
377
|
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
|
378
|
+
switch (t.labelPosition) {
|
|
379
|
+
case 'auto':
|
|
380
|
+
// position at end
|
|
381
|
+
case 'end':
|
|
382
|
+
if (t.angle < 0) {
|
|
383
|
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
case 'start':
|
|
390
|
+
if (t.angle > 0) {
|
|
391
|
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
|
395
|
+
}
|
|
396
|
+
break;
|
|
397
|
+
case 'middle':
|
|
398
|
+
// if (t.angle > 0) {
|
|
399
|
+
// shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
|
400
|
+
// }
|
|
401
|
+
// else {
|
|
402
|
+
// shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
|
403
|
+
// }
|
|
404
|
+
shim = -t.getHeight()/2;
|
|
405
|
+
break;
|
|
406
|
+
default:
|
|
407
|
+
shim = -t.getHeight()/2;
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
shim = -t.getHeight()/2;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
var val = this.u2p(t.value) + shim + 'px';
|
|
416
|
+
t._elem.css('top', val);
|
|
417
|
+
t.pack();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (lshow) {
|
|
421
|
+
var h = this._label._elem.outerHeight(true);
|
|
422
|
+
this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
|
|
423
|
+
if (this.name == 'yaxis') {
|
|
424
|
+
this._label._elem.css('left', '0px');
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
this._label._elem.css('right', '0px');
|
|
428
|
+
}
|
|
429
|
+
this._label.pack();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
})(jQuery);
|