﻿/**
* Copyright (c) 2009 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects 
* under both the MIT and GPL version 2.0 licenses. This means that you can 
* choose the license that best suits your project and use it accordingly. 
*
* Although not required, the author would appreciate an email letting him 
* know of any substantial use of jqPlot.  You can reach the author at: 
* chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*/
(function(h) { var c; h.jqplot = function(A, y, w) { var x, v; if (y == null) { throw "No data specified" } if (y.constructor == Array && y.length == 0 || y[0].constructor != Array) { throw "Improper Data Array" } if (w == null) { if (y instanceof Array) { x = y; v = null } else { if (y.constructor == Object) { x = null; v = y } } } else { x = y; v = w } var z = new n(); z.init(A, x, v); z.draw(); return z }; h.jqplot.debug = 1; h.jqplot.config = { debug: 1, enablePlugins: true, defaultHeight: 300, defaultWidth: 400 }; h.jqplot.enablePlugins = h.jqplot.config.enablePlugins; h.jqplot.preInitHooks = []; h.jqplot.postInitHooks = []; h.jqplot.preParseOptionsHooks = []; h.jqplot.postParseOptionsHooks = []; h.jqplot.preDrawHooks = []; h.jqplot.postDrawHooks = []; h.jqplot.preDrawSeriesHooks = []; h.jqplot.postDrawSeriesHooks = []; h.jqplot.preDrawLegendHooks = []; h.jqplot.addLegendRowHooks = []; h.jqplot.preSeriesInitHooks = []; h.jqplot.postSeriesInitHooks = []; h.jqplot.preParseSeriesOptionsHooks = []; h.jqplot.postParseSeriesOptionsHooks = []; h.jqplot.eventListenerHooks = []; h.jqplot.preDrawSeriesShadowHooks = []; h.jqplot.postDrawSeriesShadowHooks = []; h.jqplot.ElemContainer = function() { this._elem; this._plotWidth; this._plotHeight; this._plotDimensions = { height: null, width: null} }; h.jqplot.ElemContainer.prototype.getWidth = function() { if (this._elem) { return this._elem.outerWidth(true) } else { return null } }; h.jqplot.ElemContainer.prototype.getHeight = function() { if (this._elem) { return this._elem.outerHeight(true) } else { return null } }; h.jqplot.ElemContainer.prototype.getPosition = function() { if (this._elem) { return this._elem.position() } else { return { top: null, left: null, bottom: null, right: null} } }; h.jqplot.ElemContainer.prototype.getTop = function() { return this.getPosition().top }; h.jqplot.ElemContainer.prototype.getLeft = function() { return this.getPosition().left }; h.jqplot.ElemContainer.prototype.getBottom = function() { return this._elem.css("bottom") }; h.jqplot.ElemContainer.prototype.getRight = function() { return this._elem.css("right") }; function l(v) { h.jqplot.ElemContainer.call(this); this.name = v; this._series = []; this.show = false; this.tickRenderer = h.jqplot.AxisTickRenderer; this.tickOptions = {}; this.labelRenderer = h.jqplot.AxisLabelRenderer; this.labelOptions = {}; this.label = null; this.showLabel = true; this.min = null; this.max = null; this.autoscale = false; this.pad = 1.2; this.padMax = null; this.padMin = null; this.ticks = []; this.numberTicks; this.tickInterval; this.renderer = h.jqplot.LinearAxisRenderer; this.rendererOptions = {}; this.showTicks = true; this.showTickMarks = true; this.showMinorTicks = true; this.useSeriesColor = false; this.borderWidth = null; this.borderColor = null; this._dataBounds = { min: null, max: null }; this._offsets = { min: null, max: null }; this._ticks = []; this._label = null; this.syncTicks = null; this.tickSpacing = 75; this._min = null; this._max = null; this._tickInterval = null; this._numberTicks = null; this.__ticks = null } l.prototype = new h.jqplot.ElemContainer(); l.prototype.constructor = l; l.prototype.init = function() { this.renderer = new this.renderer(); this.tickOptions.axis = this.name; if (this.label == null || this.label == "") { this.showLabel = false } else { this.labelOptions.label = this.label } if (this.showLabel == false) { this.labelOptions.show = false } if (this.pad == 0) { this.pad = 1 } if (this.padMax == 0) { this.padMax = 1 } if (this.padMin == 0) { this.padMin = 1 } if (this.padMax == null) { this.padMax = (this.pad - 1) / 2 + 1 } if (this.padMin == null) { this.padMin = (this.pad - 1) / 2 + 1 } this.pad = this.padMax + this.padMin - 1; if (this.min != null || this.max != null) { this.autoscale = false } if (this.syncTicks == null && this.name.indexOf("y") > -1) { this.syncTicks = true } else { if (this.syncTicks == null) { this.syncTicks = false } } this.renderer.init.call(this, this.rendererOptions) }; l.prototype.draw = function(v) { return this.renderer.draw.call(this, v) }; l.prototype.set = function() { this.renderer.set.call(this) }; l.prototype.pack = function(w, v) { if (this.show) { this.renderer.pack.call(this, w, v) } if (this._min == null) { this._min = this.min; this._max = this.max; this._tickInterval = this.tickInterval; this._numberTicks = this.numberTicks; this.__ticks = this._ticks } }; l.prototype.reset = function() { this.renderer.reset.call(this) }; l.prototype.resetScale = function() { this.min = null; this.max = null; this.numberTicks = null; this.tickInterval = null }; function b(v) { h.jqplot.ElemContainer.call(this); this.show = false; this.location = "ne"; this.xoffset = 12; this.yoffset = 12; this.border; this.background; this.textColor; this.fontFamily; this.fontSize; this.rowSpacing = "0.5em"; this.renderer = h.jqplot.TableLegendRenderer; this.rendererOptions = {}; this.preDraw = false; this.escapeHtml = false; this._series = []; h.extend(true, this, v) } b.prototype = new h.jqplot.ElemContainer(); b.prototype.constructor = b; b.prototype.init = function() { this.renderer = new this.renderer(); this.renderer.init.call(this, this.rendererOptions) }; b.prototype.draw = function(w) { for (var v = 0; v < h.jqplot.preDrawLegendHooks.length; v++) { h.jqplot.preDrawLegendHooks[v].call(this, w) } return this.renderer.draw.call(this, w) }; b.prototype.pack = function(v) { this.renderer.pack.call(this, v) }; function k(v) { h.jqplot.ElemContainer.call(this); this.text = v; this.show = true; this.fontFamily; this.fontSize; this.textAlign; this.textColor; this.renderer = h.jqplot.DivTitleRenderer; this.rendererOptions = {} } k.prototype = new h.jqplot.ElemContainer(); k.prototype.constructor = k; k.prototype.init = function() { this.renderer = new this.renderer(); this.renderer.init.call(this, this.rendererOptions) }; k.prototype.draw = function(v) { return this.renderer.draw.call(this, v) }; k.prototype.pack = function() { this.renderer.pack.call(this) }; function o() { h.jqplot.ElemContainer.call(this); this.show = true; this.xaxis = "xaxis"; this._xaxis; this.yaxis = "yaxis"; this._yaxis; this.gridBorderWidth = 2; this.renderer = h.jqplot.LineRenderer; this.rendererOptions = {}; this.data = []; this.gridData = []; this.label = ""; this.showLabel = true; this.color; this.lineWidth = 2.5; this.shadow = true; this.shadowAngle = 45; this.shadowOffset = 1.25; this.shadowDepth = 3; this.shadowAlpha = "0.1"; this.breakOnNull = false; this.markerRenderer = h.jqplot.MarkerRenderer; this.markerOptions = {}; this.showLine = true; this.showMarker = true; this.index; this.fill = false; this.fillColor; this.fillAlpha; this.fillAndStroke = false; this.disableStack = false; this._stack = false; this.neighborThreshold = 4; this.fillToZero = false; this.fillAxis = "y"; this.useNegativeColors = true; this._stackData = []; this._plotData = []; this._plotValues = { x: [], y: [] }; this._intervals = { x: {}, y: {} }; this._prevPlotData = []; this._prevGridData = []; this._stackAxis = "y"; this._primaryAxis = "_xaxis"; this.canvas = new h.jqplot.GenericCanvas(); this.shadowCanvas = new h.jqplot.GenericCanvas(); this.plugins = {}; this._sumy = 0; this._sumx = 0 } o.prototype = new h.jqplot.ElemContainer(); o.prototype.constructor = o; o.prototype.init = function(w, B, y) { this.index = w; this.gridBorderWidth = B; var A = this.data; for (var x = 0; x < A.length; x++) { if (!this.breakOnNull) { if (A[x] == null || A[x][0] == null || A[x][1] == null) { A.splice(x, 1); continue } } else { if (A[x] == null || A[x][0] == null || A[x][1] == null) { var z } } } if (!this.fillColor) { this.fillColor = this.color } if (this.fillAlpha) { var v = h.jqplot.normalize2rgb(this.fillColor); var v = h.jqplot.getColorComponents(v); this.fillColor = "rgba(" + v[0] + "," + v[1] + "," + v[2] + "," + this.fillAlpha + ")" } this.renderer = new this.renderer(); this.renderer.init.call(this, this.rendererOptions, y); this.markerRenderer = new this.markerRenderer(); if (!this.markerOptions.color) { this.markerOptions.color = this.color } if (this.markerOptions.show == null) { this.markerOptions.show = this.showMarker } this.markerRenderer.init(this.markerOptions) }; o.prototype.draw = function(B, y, A) { var w = (y == c) ? {} : y; B = (B == c) ? this.canvas._ctx : B; for (var v = 0; v < h.jqplot.preDrawSeriesHooks.length; v++) { h.jqplot.preDrawSeriesHooks[v].call(this, B, w) } if (this.show) { this.renderer.setGridData.call(this, A); if (!w.preventJqPlotSeriesDrawTrigger) { h(B.canvas).trigger("jqplotSeriesDraw", [this.data, this.gridData]) } var z = []; if (w.data) { z = w.data } else { if (!this._stack) { z = this.data } else { z = this._plotData } } var x = w.gridData || this.renderer.makeGridData.call(this, z, A); this.renderer.draw.call(this, B, x, w) } for (var v = 0; v < h.jqplot.postDrawSeriesHooks.length; v++) { h.jqplot.postDrawSeriesHooks[v].call(this, B, w) } }; o.prototype.drawShadow = function(B, y, A) { var w = (y == c) ? {} : y; B = (B == c) ? this.shadowCanvas._ctx : B; for (var v = 0; v < h.jqplot.preDrawSeriesShadowHooks.length; v++) { h.jqplot.preDrawSeriesShadowHooks[v].call(this, B, w) } if (this.shadow) { this.renderer.setGridData.call(this, A); var z = []; if (w.data) { z = w.data } else { if (!this._stack) { z = this.data } else { z = this._plotData } } var x = w.gridData || this.renderer.makeGridData.call(this, z, A); this.renderer.drawShadow.call(this, B, x, w) } for (var v = 0; v < h.jqplot.postDrawSeriesShadowHooks.length; v++) { h.jqplot.postDrawSeriesShadowHooks[v].call(this, B, w) } }; function g() { h.jqplot.ElemContainer.call(this); this.drawGridlines = true; this.gridLineColor = "#cccccc"; this.gridLineWidth = 1; this.background = "#fffdf6"; this.borderColor = "#999999"; this.borderWidth = 2; this.shadow = true; this.shadowAngle = 45; this.shadowOffset = 1.5; this.shadowWidth = 3; this.shadowDepth = 3; this.shadowAlpha = "0.07"; this._left; this._top; this._right; this._bottom; this._width; this._height; this._axes = []; this.renderer = h.jqplot.CanvasGridRenderer; this.rendererOptions = {}; this._offsets = { top: null, bottom: null, left: null, right: null} } g.prototype = new h.jqplot.ElemContainer(); g.prototype.constructor = g; g.prototype.init = function() { this.renderer = new this.renderer(); this.renderer.init.call(this, this.rendererOptions) }; g.prototype.createElement = function(v) { this._offsets = v; return this.renderer.createElement.call(this) }; g.prototype.draw = function() { this.renderer.draw.call(this) }; h.jqplot.GenericCanvas = function() { h.jqplot.ElemContainer.call(this); this._ctx }; h.jqplot.GenericCanvas.prototype = new h.jqplot.ElemContainer(); h.jqplot.GenericCanvas.prototype.constructor = h.jqplot.GenericCanvas; h.jqplot.GenericCanvas.prototype.createElement = function(z, x, w) { this._offsets = z; var v = "jqplot"; if (x != c) { v = x } var y = document.createElement("canvas"); if (w != c) { this._plotDimensions = w } y.width = this._plotDimensions.width - this._offsets.left - this._offsets.right; y.height = this._plotDimensions.height - this._offsets.top - this._offsets.bottom; this._elem = h(y); this._elem.addClass(v); this._elem.css({ position: "absolute", left: this._offsets.left, top: this._offsets.top }); if (h.browser.msie) { window.G_vmlCanvasManager.init_(document) } if (h.browser.msie) { y = window.G_vmlCanvasManager.initElement(y) } return this._elem }; h.jqplot.GenericCanvas.prototype.setContext = function() { this._ctx = this._elem.get(0).getContext("2d"); return this._ctx }; function n() { this.data = []; this.targetId = null; this.target = null; this.defaults = { axesDefaults: {}, axes: { xaxis: {}, yaxis: {}, x2axis: {}, y2axis: {}, y3axis: {}, y4axis: {}, y5axis: {}, y6axis: {}, y7axis: {}, y8axis: {}, y9axis: {} }, seriesDefaults: {}, gridPadding: { top: 10, right: 10, bottom: 23, left: 10 }, series: [] }; this.series = []; this.axes = { xaxis: new l("xaxis"), yaxis: new l("yaxis"), x2axis: new l("x2axis"), y2axis: new l("y2axis"), y3axis: new l("y3axis"), y4axis: new l("y4axis"), y5axis: new l("y5axis"), y6axis: new l("y6axis"), y7axis: new l("y7axis"), y8axis: new l("y8axis"), y9axis: new l("y9axis") }; this.grid = new g(); this.legend = new b(); this.baseCanvas = new h.jqplot.GenericCanvas(); this.eventCanvas = new h.jqplot.GenericCanvas(); this._width = null; this._height = null; this._plotDimensions = { height: null, width: null }; this._gridPadding = { top: 10, right: 10, bottom: 10, left: 10 }; this.syncXTicks = true; this.syncYTicks = true; this.seriesColors = ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"]; this.negativeSeriesColors = ["#498991", "#C08840", "#9F9274", "#546D61", "#646C4A", "#6F6621", "#6E3F5F", "#4F64B0", "#A89050", "#C45923", "#187399", "#945381", "#959E5C", "#C7AF7B", "#478396", "#907294"]; this.sortData = true; var y = 0; this.textColor; this.fontFamily; this.fontSize; this.title = new k(); this.options = {}; this.stackSeries = false; this._stackData = []; this._plotData = []; this.plugins = {}; this._drawCount = 0; this.drawIfHidden = false; this._sumy = 0; this._sumx = 0; this.colorGenerator = h.jqplot.ColorGenerator; this.init = function(G, F, C) { for (var D = 0; D < h.jqplot.preInitHooks.length; D++) { h.jqplot.preInitHooks[D].call(this, G, F, C) } this.targetId = "#" + G; this.target = h("#" + G); if (!this.target.get(0)) { throw "No plot target specified" } if (this.target.css("position") == "static") { this.target.css("position", "relative") } if (!this.target.hasClass("jqplot-target")) { this.target.addClass("jqplot-target") } if (!this.target.height()) { var E; if (C && C.height) { E = parseInt(C.height, 10) } else { if (this.target.attr("data-height")) { E = parseInt(this.target.attr("data-height"), 10) } else { E = parseInt(h.jqplot.config.defaultHeight, 10) } } this._height = E; this.target.css("height", E + "px") } else { this._height = this.target.height() } if (!this.target.width()) { var z; if (C && C.width) { z = parseInt(C.width, 10) } else { if (this.target.attr("data-width")) { z = parseInt(this.target.attr("data-width"), 10) } else { z = parseInt(h.jqplot.config.defaultWidth, 10) } } this._width = z; this.target.css("width", z + "px") } else { this._width = this.target.width() } this._plotDimensions.height = this._height; this._plotDimensions.width = this._width; this.grid._plotDimensions = this._plotDimensions; this.title._plotDimensions = this._plotDimensions; this.baseCanvas._plotDimensions = this._plotDimensions; this.eventCanvas._plotDimensions = this._plotDimensions; this.legend._plotDimensions = this._plotDimensions; if (this._height <= 0 || this._width <= 0 || !this._height || !this._width) { throw "Canvas dimension not set" } this.data = F; this.parseOptions(C); if (this.textColor) { this.target.css("color", this.textColor) } if (this.fontFamily) { this.target.css("font-family", this.fontFamily) } if (this.fontSize) { this.target.css("font-size", this.fontSize) } this.title.init(); this.legend.init(); this._sumy = 0; this._sumx = 0; for (var D = 0; D < this.series.length; D++) { this.series[D].shadowCanvas._plotDimensions = this._plotDimensions; this.series[D].canvas._plotDimensions = this._plotDimensions; for (var B = 0; B < h.jqplot.preSeriesInitHooks.length; B++) { h.jqplot.preSeriesInitHooks[B].call(this.series[D], G, F, this.options.seriesDefaults, this.options.series[D]) } this.populatePlotData(this.series[D], D); this.series[D]._plotDimensions = this._plotDimensions; this.series[D].init(D, this.grid.borderWidth, this); for (var B = 0; B < h.jqplot.postSeriesInitHooks.length; B++) { h.jqplot.postSeriesInitHooks[B].call(this.series[D], G, F, this.options.seriesDefaults, this.options.series[D]) } this._sumy += this.series[D]._sumy; this._sumx += this.series[D]._sumx } for (var A in this.axes) { this.axes[A]._plotDimensions = this._plotDimensions; this.axes[A].init() } if (this.sortData) { v(this.series) } this.grid.init(); this.grid._axes = this.axes; this.legend._series = this.series; for (var D = 0; D < h.jqplot.postInitHooks.length; D++) { h.jqplot.postInitHooks[D].call(this, G, F, C) } }; this.resetAxesScale = function(C) { var B = (C != c) ? C : this.axes; if (B === true) { B = this.axes } if (B.constructor === Array) { for (var A = 0; A < B.length; A++) { this.axes[B[A]].resetScale() } } else { if (B.constructor === Object) { for (var z in B) { this.axes[z].resetScale() } } } }; this.reInitialize = function() { if (!this.target.height()) { var D; if (options && options.height) { D = parseInt(options.height, 10) } else { if (this.target.attr("data-height")) { D = parseInt(this.target.attr("data-height"), 10) } else { D = parseInt(h.jqplot.config.defaultHeight, 10) } } this._height = D; this.target.css("height", D + "px") } else { this._height = this.target.height() } if (!this.target.width()) { var z; if (options && options.width) { z = parseInt(options.width, 10) } else { if (this.target.attr("data-width")) { z = parseInt(this.target.attr("data-width"), 10) } else { z = parseInt(h.jqplot.config.defaultWidth, 10) } } this._width = z; this.target.css("width", z + "px") } else { this._width = this.target.width() } if (this._height <= 0 || this._width <= 0 || !this._height || !this._width) { throw "Target dimension not set" } this._plotDimensions.height = this._height; this._plotDimensions.width = this._width; this.grid._plotDimensions = this._plotDimensions; this.title._plotDimensions = this._plotDimensions; this.baseCanvas._plotDimensions = this._plotDimensions; this.eventCanvas._plotDimensions = this._plotDimensions; this.legend._plotDimensions = this._plotDimensions; for (var E in this.axes) { var C = this.axes[E]; C._plotWidth = this._width; C._plotHeight = this._height } this.title._plotWidth = this._width; if (this.textColor) { this.target.css("color", this.textColor) } if (this.fontFamily) { this.target.css("font-family", this.fontFamily) } if (this.fontSize) { this.target.css("font-size", this.fontSize) } this._sumy = 0; this._sumx = 0; for (var B = 0; B < this.series.length; B++) { this.populatePlotData(this.series[B], B); this.series[B]._plotDimensions = this._plotDimensions; this.series[B].canvas._plotDimensions = this._plotDimensions; this._sumy += this.series[B]._sumy; this._sumx += this.series[B]._sumx } for (var A in this.axes) { this.axes[A]._plotDimensions = this._plotDimensions; this.axes[A]._ticks = []; this.axes[A].renderer.init.call(this.axes[A], {}) } if (this.sortData) { v(this.series) } this.grid._axes = this.axes; this.legend._series = this.series }; function v(D) { var E, B; for (var C = 0; C < D.length; C++) { E = D[C].data; var z = true; if (D[C]._stackAxis == "x") { for (var A = 0; A < E.length; A++) { if (typeof (E[A][1]) != "number") { z = false; break } } if (z) { E.sort(function(G, F) { return G[1] - F[1] }) } } else { for (var A = 0; A < E.length; A++) { if (typeof (E[A][0]) != "number") { z = false; break } } if (z) { E.sort(function(G, F) { return G[0] - F[0] }) } } } } this.populatePlotData = function(D, E) { this._plotData = []; this._stackData = []; D._stackData = []; D._plotData = []; var H = { x: [], y: [] }; if (this.stackSeries && !D.disableStack) { D._stack = true; var F = D._stackAxis == "x" ? 0 : 1; var G = F ? 0 : 1; var I = h.extend(true, [], D.data); var J = h.extend(true, [], D.data); for (var B = 0; B < E; B++) { var z = this.series[B].data; for (var A = 0; A < z.length; A++) { I[A][0] += z[A][0]; I[A][1] += z[A][1]; J[A][F] += z[A][F] } } for (var C = 0; C < J.length; C++) { H.x.push(J[C][0]); H.y.push(J[C][1]) } this._plotData.push(J); this._stackData.push(I); D._stackData = I; D._plotData = J; D._plotValues = H } else { for (var C = 0; C < D.data.length; C++) { H.x.push(D.data[C][0]); H.y.push(D.data[C][1]) } this._stackData.push(D.data); this.series[E]._stackData = D.data; this._plotData.push(D.data); D._plotData = D.data; D._plotValues = H } if (E > 0) { D._prevPlotData = this.series[E - 1]._plotData } D._sumy = 0; D._sumx = 0; for (C = D.data.length - 1; C > -1; C--) { D._sumy += D.data[C][1]; D._sumx += D.data[C][0] } }; this.getNextSeriesColor = (function(A) { var z = 0; var B = A.seriesColors; return function() { if (z < B.length) { return B[z++] } else { z = 0; return B[z++] } } })(this); this.parseOptions = function(H) { for (var E = 0; E < h.jqplot.preParseOptionsHooks.length; E++) { h.jqplot.preParseOptionsHooks[E].call(this, H) } this.options = h.extend(true, {}, this.defaults, H); this.stackSeries = this.options.stackSeries; if (this.options.seriesColors) { this.seriesColors = this.options.seriesColors } var z = new this.colorGenerator(this.seriesColors); h.extend(true, this._gridPadding, this.options.gridPadding); this.sortData = (this.options.sortData != null) ? this.options.sortData : this.sortData; for (var A in this.axes) { var C = this.axes[A]; h.extend(true, C, this.options.axesDefaults, this.options.axes[A]); C._plotWidth = this._width; C._plotHeight = this._height } if (this.data.length == 0) { this.data = []; for (var E = 0; E < this.options.series.length; E++) { this.data.push(this.options.series.data) } } var F = function(L, J) { var I = []; var K; J = J || "vertical"; if (!(L[0] instanceof Array)) { for (var K = 0; K < L.length; K++) { if (J == "vertical") { I.push([K + 1, L[K]]) } else { I.push([L[K], K + 1]) } } } else { h.extend(true, I, L) } return I }; for (var E = 0; E < this.data.length; E++) { var G = new o(); for (var D = 0; D < h.jqplot.preParseSeriesOptionsHooks.length; D++) { h.jqplot.preParseSeriesOptionsHooks[D].call(G, this.options.seriesDefaults, this.options.series[E]) } h.extend(true, G, { seriesColors: this.seriesColors, negativeSeriesColors: this.negativeSeriesColors }, this.options.seriesDefaults, this.options.series[E]); var B = "vertical"; if (G.renderer.constructor == h.jqplot.barRenderer && G.rendererOptions && G.rendererOptions.barDirection == "horizontal") { B = "horizontal" } G.data = F(this.data[E], B); switch (G.xaxis) { case "xaxis": G._xaxis = this.axes.xaxis; break; case "x2axis": G._xaxis = this.axes.x2axis; break; default: break } G._yaxis = this.axes[G.yaxis]; G._xaxis._series.push(G); G._yaxis._series.push(G); if (G.show) { G._xaxis.show = true; G._yaxis.show = true } if (!G.color && G.show != false) { G.color = z.next() } if (!G.label) { G.label = "Series " + (E + 1).toString() } this.series.push(G); for (var D = 0; D < h.jqplot.postParseSeriesOptionsHooks.length; D++) { h.jqplot.postParseSeriesOptionsHooks[D].call(this.series[E], this.options.seriesDefaults, this.options.series[E]) } } h.extend(true, this.grid, this.options.grid); for (var A in this.axes) { var C = this.axes[A]; if (C.borderWidth == null) { C.borderWidth = this.grid.borderWidth } if (C.borderColor == null) { if (A != "xaxis" && A != "x2axis" && C.useSeriesColor === true && C.show) { C.borderColor = C._series[0].color } else { C.borderColor = this.grid.borderColor } } } if (typeof this.options.title == "string") { this.title.text = this.options.title } else { if (typeof this.options.title == "object") { h.extend(true, this.title, this.options.title) } } this.title._plotWidth = this._width; h.extend(true, this.legend, this.options.legend); for (var E = 0; E < h.jqplot.postParseOptionsHooks.length; E++) { h.jqplot.postParseOptionsHooks[E].call(this, H) } }; this.replot = function(A) { var B = (A != c) ? A : {}; var z = (B.clear != c) ? B.clear : true; var C = (B.resetAxes != c) ? B.resetAxes : false; this.target.trigger("jqplotPreReplot"); if (z) { this.target.empty() } if (C) { this.resetAxesScale(C) } this.reInitialize(); this.draw(); this.target.trigger("jqplotPostReplot") }; this.redraw = function(z) { z = (z != null) ? z : true; this.target.trigger("jqplotPreRedraw"); if (z) { this.target.empty() } for (var B in this.axes) { this.axes[B]._ticks = [] } for (var A = 0; A < this.series.length; A++) { this.populatePlotData(this.series[A], A) } this._sumy = 0; this._sumx = 0; for (A = 0; A < this.series.length; A++) { this._sumy += this.series[A]._sumy; this._sumx += this.series[A]._sumx } this.draw(); this.target.trigger("jqplotPostRedraw") }; this.draw = function() { if (this.drawIfHidden || this.target.is(":visible")) { this.target.trigger("jqplotPreDraw"); var F; for (F = 0; F < h.jqplot.preDrawHooks.length; F++) { h.jqplot.preDrawHooks[F].call(this) } this.target.append(this.baseCanvas.createElement({ left: 0, right: 0, top: 0, bottom: 0 }, "jqplot-base-canvas")); var E = this.baseCanvas.setContext(); this.target.append(this.title.draw()); this.title.pack({ top: 0, left: 0 }); for (var B in this.axes) { this.target.append(this.axes[B].draw(E)); this.axes[B].set() } if (this.axes.yaxis.show) { this._gridPadding.left = this.axes.yaxis.getWidth() } var C = ["y2axis", "y3axis", "y4axis", "y5axis", "y6axis", "y7axis", "y8axis", "y9axis"]; var A = [0, 0, 0, 0]; var H = 0; var D, z; for (D = 8; D > 0; D--) { z = this.axes[C[D - 1]]; if (z.show) { A[D - 1] = H; H += z.getWidth() } } if (H > this._gridPadding.right) { this._gridPadding.right = H } if (this.title.show && this.axes.x2axis.show) { this._gridPadding.top = this.title.getHeight() + this.axes.x2axis.getHeight() } else { if (this.title.show) { this._gridPadding.top = this.title.getHeight() } else { if (this.axes.x2axis.show) { this._gridPadding.top = this.axes.x2axis.getHeight() } } } if (this.axes.xaxis.show) { this._gridPadding.bottom = this.axes.xaxis.getHeight() } this.axes.xaxis.pack({ position: "absolute", bottom: 0, left: 0, width: this._width }, { min: this._gridPadding.left, max: this._width - this._gridPadding.right }); this.axes.yaxis.pack({ position: "absolute", top: 0, left: 0, height: this._height }, { min: this._height - this._gridPadding.bottom, max: this._gridPadding.top }); this.axes.x2axis.pack({ position: "absolute", top: this.title.getHeight(), left: 0, width: this._width }, { min: this._gridPadding.left, max: this._width - this._gridPadding.right }); for (F = 8; F > 0; F--) { this.axes[C[F - 1]].pack({ position: "absolute", top: 0, right: A[F - 1] }, { min: this._height - this._gridPadding.bottom, max: this._gridPadding.top }) } this.target.append(this.grid.createElement(this._gridPadding)); this.grid.draw(); for (F = 0; F < this.series.length; F++) { this.target.append(this.series[F].shadowCanvas.createElement(this._gridPadding, "jqplot-series-canvas jqplot-shadow")); this.series[F].shadowCanvas.setContext() } for (F = 0; F < this.series.length; F++) { this.target.append(this.series[F].canvas.createElement(this._gridPadding, "jqplot-series-canvas")); this.series[F].canvas.setContext() } this.target.append(this.eventCanvas.createElement(this._gridPadding, "jqplot-event-canvas")); var I = this.eventCanvas.setContext(); I.fillStyle = "rgba(0,0,0,0)"; I.fillRect(0, 0, I.canvas.width, I.canvas.height); this.bindCustomEvents(); if (this.legend.preDraw) { this.target.append(this.legend.draw()); this.legend.pack(this._gridPadding); if (this.legend._elem) { this.drawSeries({ legendInfo: { location: this.legend.location, width: this.legend.getWidth(), height: this.legend.getHeight(), xoffset: this.legend.xoffset, yoffset: this.legend.yoffset} }) } else { this.drawSeries() } } else { this.drawSeries(); h(this.series[this.series.length - 1].canvas._elem).after(this.legend.draw()); this.legend.pack(this._gridPadding) } for (var F = 0; F < h.jqplot.eventListenerHooks.length; F++) { var G = h.jqplot.eventListenerHooks[F]; this.eventCanvas._elem.bind(G[0], { plot: this }, G[1]) } for (var F = 0; F < h.jqplot.postDrawHooks.length; F++) { h.jqplot.postDrawHooks[F].call(this) } if (this.target.is(":visible")) { this._drawCount += 1 } this.target.trigger("jqplotPostDraw", [this]) } }; this.bindCustomEvents = function() { this.eventCanvas._elem.bind("click", { plot: this }, this.onClick); this.eventCanvas._elem.bind("dblclick", { plot: this }, this.onDblClick); this.eventCanvas._elem.bind("mousedown", { plot: this }, this.onMouseDown); this.eventCanvas._elem.bind("mouseup", { plot: this }, this.onMouseUp); this.eventCanvas._elem.bind("mousemove", { plot: this }, this.onMouseMove); this.eventCanvas._elem.bind("mouseenter", { plot: this }, this.onMouseEnter); this.eventCanvas._elem.bind("mouseleave", { plot: this }, this.onMouseLeave) }; function w(H) { var G = H.data.plot; var C = G.eventCanvas._elem.offset(); var F = { x: H.pageX - C.left, y: H.pageY - C.top }; var D = { xaxis: null, yaxis: null, x2axis: null, y2axis: null, y3axis: null, y4axis: null, y5axis: null, y6axis: null, y7axis: null, y8axis: null, y9axis: null }; var E = ["xaxis", "yaxis", "x2axis", "y2axis", "y3axis", "y4axis", "y5axis", "y6axis", "y7axis", "y8axis", "y9axis"]; var z = G.axes; for (var A = 11; A > 0; A--) { var B = E[A - 1]; if (z[B].show) { D[B] = z[B].series_p2u(F[B.charAt(0)]) } } return ({ offsets: C, gridPos: F, dataPos: D }) } function x(F, J, I) { var G = null; var K, D, B, H, C, A; var E; for (var D = 0; D < F.series.length; D++) { K = F.series[D]; A = K.renderer; if (K.show) { E = Math.abs(K.markerRenderer.size / 2 + K.neighborThreshold); for (var C = 0; C < K.gridData.length; C++) { p = K.gridData[C]; if (A.constructor == h.jqplot.OHLCRenderer) { if (A.candleStick) { var z = K._yaxis.series_u2p; if (J >= p[0] - A._bodyWidth / 2 && J <= p[0] + A._bodyWidth / 2 && I >= z(K.data[C][2]) && I <= z(K.data[C][3])) { G = { seriesIndex: D, pointIndex: C, gridData: p, data: K.data[C]} } } else { if (!A.hlc) { var z = K._yaxis.series_u2p; if (J >= p[0] - A._tickLength && J <= p[0] + A._tickLength && I >= z(K.data[C][2]) && I <= z(K.data[C][3])) { G = { seriesIndex: D, pointIndex: C, gridData: p, data: K.data[C]} } } else { var z = K._yaxis.series_u2p; if (J >= p[0] - A._tickLength && J <= p[0] + A._tickLength && I >= z(K.data[C][1]) && I <= z(K.data[C][2])) { G = { seriesIndex: D, pointIndex: C, gridData: p, data: K.data[C]} } } } } else { H = Math.sqrt((J - p[0]) * (J - p[0]) + (I - p[1]) * (I - p[1])); if (H <= E && (H <= B || B == null)) { B = H; G = { seriesIndex: D, pointIndex: C, gridData: p, data: K.data[C]} } } } } } return G } this.onClick = function(A) { var z = w(A); var C = A.data.plot; var B = x(C, z.gridPos.x, z.gridPos.y); A.data.plot.eventCanvas._elem.trigger("jqplotClick", [z.gridPos, z.dataPos, B, C]) }; this.onDblClick = function(A) { var z = w(A); var C = A.data.plot; var B = x(C, z.gridPos.x, z.gridPos.y); A.data.plot.eventCanvas._elem.trigger("jqplotDblClick", [z.gridPos, z.dataPos, B, C]) }; this.onMouseDown = function(A) { var z = w(A); var C = A.data.plot; var B = x(C, z.gridPos.x, z.gridPos.y); A.data.plot.eventCanvas._elem.trigger("jqplotMouseDown", [z.gridPos, z.dataPos, B, C]) }; this.onMouseUp = function(A) { var z = w(A); A.data.plot.eventCanvas._elem.trigger("jqplotMouseUp", [z.gridPos, z.dataPos, null, A.data.plot]) }; this.onMouseMove = function(A) { var z = w(A); var C = A.data.plot; var B = x(C, z.gridPos.x, z.gridPos.y); A.data.plot.eventCanvas._elem.trigger("jqplotMouseMove", [z.gridPos, z.dataPos, B, C]) }; this.onMouseEnter = function(A) { var z = w(A); var B = A.data.plot; A.data.plot.eventCanvas._elem.trigger("jqplotMouseEnter", [z.gridPos, z.dataPos, null, B]) }; this.onMouseLeave = function(A) { var z = w(A); var B = A.data.plot; A.data.plot.eventCanvas._elem.trigger("jqplotMouseLeave", [z.gridPos, z.dataPos, null, B]) }; this.drawSeries = function(B, z) { var D, C, A; if (z != c) { C = this.series[z]; A = C.shadowCanvas._ctx; A.clearRect(0, 0, A.canvas.width, A.canvas.height); C.drawShadow(A, B, this); A = C.canvas._ctx; A.clearRect(0, 0, A.canvas.width, A.canvas.height); C.draw(A, B, this) } else { for (D = 0; D < this.series.length; D++) { C = this.series[D]; A = C.shadowCanvas._ctx; A.clearRect(0, 0, A.canvas.width, A.canvas.height); C.drawShadow(A, B, this); A = C.canvas._ctx; A.clearRect(0, 0, A.canvas.width, A.canvas.height); C.draw(A, B, this) } } } } h.jqplot.ColorGenerator = function(w) { var v = 0; this.next = function() { if (v < w.length) { return w[v++] } else { v = 0; return w[v++] } }; this.previous = function() { if (v > 0) { return w[v--] } else { v = w.length - 1; return w[v] } }; this.get = function(x) { return w[x] }; this.setColors = function(x) { w = x }; this.reset = function() { v = 0 } }; h.jqplot.hex2rgb = function(x, v) { x = x.replace("#", ""); if (x.length == 3) { x = x[0] + x[0] + x[1] + x[1] + x[2] + x[2] } var w; w = "rgba(" + parseInt(x.slice(0, 2), 16) + ", " + parseInt(x.slice(2, 4), 16) + ", " + parseInt(x.slice(4, 6), 16); if (v) { w += ", " + v } w += ")"; return w }; h.jqplot.rgb2hex = function(z) { var x = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/; var v = z.match(x); var y = "#"; for (i = 1; i < 4; i++) { var w; if (v[i].search(/%/) != -1) { w = parseInt(255 * v[i] / 100, 10).toString(16); if (w.length == 1) { w = "0" + w } } else { w = parseInt(v[i], 10).toString(16); if (w.length == 1) { w = "0" + w } } y += w } return y }; h.jqplot.normalize2rgb = function(w, v) { if (w.search(/^ *rgba?\(/) != -1) { return w } else { if (w.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/) != -1) { return h.jqplot.hex2rgb(w, v) } else { throw "invalid color spec" } } }; h.jqplot.getColorComponents = function(z) { var y = h.jqplot.normalize2rgb(z); var x = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/; var v = y.match(x); var w = []; for (i = 1; i < 4; i++) { if (v[i].search(/%/) != -1) { w[i - 1] = parseInt(255 * v[i] / 100, 10) } else { w[i - 1] = parseInt(v[i], 10) } } w[3] = parseFloat(v[4]) ? parseFloat(v[4]) : 1; return w }; h.jqplot.log = function() { if (window.console && h.jqplot.debug) { if (arguments.length == 1) { console.log(arguments[0]) } else { console.log(arguments) } } }; var f = h.jqplot.log; h.jqplot.AxisLabelRenderer = function(v) { h.jqplot.ElemContainer.call(this); this.axis; this.show = true; this.label = ""; this._elem; this.escapeHTML = false; h.extend(true, this, v) }; h.jqplot.AxisLabelRenderer.prototype = new h.jqplot.ElemContainer(); h.jqplot.AxisLabelRenderer.prototype.constructor = h.jqplot.AxisLabelRenderer; h.jqplot.AxisLabelRenderer.prototype.init = function(v) { h.extend(true, this, v) }; h.jqplot.AxisLabelRenderer.prototype.draw = function() { this._elem = h('<div style="position:absolute;" class="jqplot-' + this.axis + '-label"></div>'); if (Number(this.label)) { this._elem.css("white-space", "nowrap") } if (!this.escapeHTML) { this._elem.html(this.label) } else { this._elem.text(this.label) } return this._elem }; h.jqplot.AxisLabelRenderer.prototype.pack = function() { }; h.jqplot.AxisTickRenderer = function(v) { h.jqplot.ElemContainer.call(this); this.mark = "outside"; this.axis; this.showMark = true; this.showGridline = true; this.isMinorTick = false; this.size = 4; this.markSize = 6; this.show = true; this.showLabel = true; this.label = ""; this.value = null; this._styles = {}; this.formatter = h.jqplot.DefaultTickFormatter; this.formatString = ""; this.fontFamily; this.fontSize; this.textColor; this._elem; h.extend(true, this, v) }; h.jqplot.AxisTickRenderer.prototype.init = function(v) { h.extend(true, this, v) }; h.jqplot.AxisTickRenderer.prototype = new h.jqplot.ElemContainer(); h.jqplot.AxisTickRenderer.prototype.constructor = h.jqplot.AxisTickRenderer; h.jqplot.AxisTickRenderer.prototype.setTick = function(v, x, w) { this.value = v; this.axis = x; if (w) { this.isMinorTick = true } return this }; h.jqplot.AxisTickRenderer.prototype.draw = function() { if (!this.label) { this.label = this.formatter(this.formatString, this.value) } style = 'style="position:absolute;'; if (Number(this.label)) { style += "white-space:nowrap;" } style += '"'; this._elem = h("<div " + style + ' class="jqplot-' + this.axis + '-tick">' + this.label + "</div>"); for (var v in this._styles) { this._elem.css(v, this._styles[v]) } if (this.fontFamily) { this._elem.css("font-family", this.fontFamily) } if (this.fontSize) { this._elem.css("font-size", this.fontSize) } if (this.textColor) { this._elem.css("color", this.textColor) } return this._elem }; h.jqplot.DefaultTickFormatter = function(v, w) { if (typeof w == "number") { if (!v) { v = "%.1f" } return h.jqplot.sprintf(v, w) } else { return String(w) } }; h.jqplot.AxisTickRenderer.prototype.pack = function() { }; h.jqplot.CanvasGridRenderer = function() { this.shadowRenderer = new h.jqplot.ShadowRenderer() }; h.jqplot.CanvasGridRenderer.prototype.init = function(w) { this._ctx; h.extend(true, this, w); var v = { lineJoin: "miter", lineCap: "round", fill: false, isarc: false, angle: this.shadowAngle, offset: this.shadowOffset, alpha: this.shadowAlpha, depth: this.shadowDepth, lineWidth: this.shadowWidth, closePath: false }; this.renderer.shadowRenderer.init(v) }; h.jqplot.CanvasGridRenderer.prototype.createElement = function() { var y = document.createElement("canvas"); var v = this._plotDimensions.width; var x = this._plotDimensions.height; y.width = v; y.height = x; this._elem = h(y); this._elem.addClass("jqplot-grid-canvas"); this._elem.css({ position: "absolute", left: 0, top: 0 }); if (h.browser.msie) { window.G_vmlCanvasManager.init_(document) } if (h.browser.msie) { y = window.G_vmlCanvasManager.initElement(y) } this._top = this._offsets.top; this._bottom = x - this._offsets.bottom; this._left = this._offsets.left; this._right = v - this._offsets.right; this._width = this._right - this._left; this._height = this._bottom - this._top; return this._elem }; h.jqplot.CanvasGridRenderer.prototype.draw = function() { this._ctx = this._elem.get(0).getContext("2d"); var L = this._ctx; var E = this._axes; L.save(); L.fillStyle = this.background; L.fillRect(this._left, this._top, this._width, this._height); if (this.drawGridlines) { L.save(); L.lineJoin = "miter"; L.lineCap = "butt"; L.lineWidth = this.gridLineWidth; L.strokeStyle = this.gridLineColor; var G, D; var v = ["xaxis", "yaxis", "x2axis", "y2axis"]; for (var A = 4; A > 0; A--) { var w = v[A - 1]; var y = E[w]; var H = y._ticks; if (y.show) { for (var z = H.length; z > 0; z--) { var K = H[z - 1]; if (K.show) { var F = Math.round(y.u2p(K.value)) + 0.5; switch (w) { case "xaxis": if (K.showGridline) { C(F, this._top, F, this._bottom) } if (K.showMark && K.mark) { s = K.markSize; m = K.mark; var F = Math.round(y.u2p(K.value)) + 0.5; switch (m) { case "outside": G = this._bottom; D = this._bottom + s; break; case "inside": G = this._bottom - s; D = this._bottom; break; case "cross": G = this._bottom - s; D = this._bottom + s; break; default: G = this._bottom; D = this._bottom + s; break } if (this.shadow) { this.renderer.shadowRenderer.draw(L, [[F, G], [F, D]], { lineCap: "butt", lineWidth: this.gridLineWidth, offset: this.gridLineWidth * 0.75, depth: 2, fill: false, closePath: false }) } C(F, G, F, D) } break; case "yaxis": if (K.showGridline) { C(this._right, F, this._left, F) } if (K.showMark && K.mark) { s = K.markSize; m = K.mark; var F = Math.round(y.u2p(K.value)) + 0.5; switch (m) { case "outside": G = this._left - s; D = this._left; break; case "inside": G = this._left; D = this._left + s; break; case "cross": G = this._left - s; D = this._left + s; break; default: G = this._left - s; D = this._left; break } if (this.shadow) { this.renderer.shadowRenderer.draw(L, [[G, F], [D, F]], { lineCap: "butt", lineWidth: this.gridLineWidth * 1.5, offset: this.gridLineWidth * 0.75, fill: false, closePath: false }) } C(G, F, D, F, { strokeStyle: y.borderColor }) } break; case "x2axis": if (K.showGridline) { C(F, this._bottom, F, this._top) } if (K.showMark && K.mark) { s = K.markSize; m = K.mark; var F = Math.round(y.u2p(K.value)) + 0.5; switch (m) { case "outside": G = this._top - s; D = this._top; break; case "inside": G = this._top; D = this._top + s; break; case "cross": G = this._top - s; D = this._top + s; break; default: G = this._top - s; D = this._top; break } if (this.shadow) { this.renderer.shadowRenderer.draw(L, [[F, G], [F, D]], { lineCap: "butt", lineWidth: this.gridLineWidth, offset: this.gridLineWidth * 0.75, depth: 2, fill: false, closePath: false }) } C(F, G, F, D) } break; case "y2axis": if (K.showGridline) { C(this._left, F, this._right, F) } if (K.showMark && K.mark) { s = K.markSize; m = K.mark; var F = Math.round(y.u2p(K.value)) + 0.5; switch (m) { case "outside": G = this._right; D = this._right + s; break; case "inside": G = this._right - s; D = this._right; break; case "cross": G = this._right - s; D = this._right + s; break; default: G = this._right; D = this._right + s; break } if (this.shadow) { this.renderer.shadowRenderer.draw(L, [[G, F], [D, F]], { lineCap: "butt", lineWidth: this.gridLineWidth * 1.5, offset: this.gridLineWidth * 0.75, fill: false, closePath: false }) } C(G, F, D, F, { strokeStyle: y.borderColor }) } break; default: break } } } } } v = ["y3axis", "y4axis", "y5axis", "y6axis", "y7axis", "y8axis", "y9axis"]; for (var A = 7; A > 0; A--) { var y = E[v[A - 1]]; var H = y._ticks; if (y.show) { var J = H[y.numberTicks - 1]; var B = H[0]; var x = y.getLeft(); var I = [[x, J.getTop() + J.getHeight() / 2], [x, B.getTop() + B.getHeight() / 2 + 1]]; if (this.shadow) { this.renderer.shadowRenderer.draw(L, I, { lineCap: "butt", fill: false, closePath: false }) } C(I[0][0], I[0][1], I[1][0], I[1][1], { lineCap: "butt", strokeStyle: y.borderColor, lineWidth: y.borderWidth }); for (var z = H.length; z > 0; z--) { var K = H[z - 1]; s = K.markSize; m = K.mark; var F = Math.round(y.u2p(K.value)) + 0.5; if (K.showMark && K.mark) { switch (m) { case "outside": G = x; D = x + s; break; case "inside": G = x - s; D = x; break; case "cross": G = x - s; D = x + s; break; default: G = x; D = x + s; break } I = [[G, F], [D, F]]; if (this.shadow) { this.renderer.shadowRenderer.draw(L, I, { lineCap: "butt", lineWidth: this.gridLineWidth * 1.5, offset: this.gridLineWidth * 0.75, fill: false, closePath: false }) } C(G, F, D, F, { strokeStyle: y.borderColor }) } } } } L.restore() } function C(Q, P, N, M, O) { L.save(); O = O || {}; h.extend(true, L, O); L.beginPath(); L.moveTo(Q, P); L.lineTo(N, M); L.stroke(); L.restore() } if (this.shadow) { var I = [[this._left, this._bottom], [this._right, this._bottom], [this._right, this._top]]; this.renderer.shadowRenderer.draw(L, I) } C(this._left, this._top, this._right, this._top, { lineCap: "round", strokeStyle: E.x2axis.borderColor, lineWidth: E.x2axis.borderWidth }); C(this._right, this._top, this._right, this._bottom, { lineCap: "round", strokeStyle: E.y2axis.borderColor, lineWidth: E.y2axis.borderWidth }); C(this._right, this._bottom, this._left, this._bottom, { lineCap: "round", strokeStyle: E.xaxis.borderColor, lineWidth: E.xaxis.borderWidth }); C(this._left, this._bottom, this._left, this._top, { lineCap: "round", strokeStyle: E.yaxis.borderColor, lineWidth: E.yaxis.borderWidth }); L.restore() }; var r = 24 * 60 * 60 * 1000; var j = function(v, w) { v = String(v); while (v.length < w) { v = "0" + v } return v }; var e = { millisecond: 1, second: 1000, minute: 60 * 1000, hour: 60 * 60 * 1000, day: r, week: 7 * r, month: { add: function(x, v) { e.year.add(x, Math[v > 0 ? "floor" : "ceil"](v / 12)); var w = x.getMonth() + (v % 12); if (w == 12) { w = 0; x.setYear(x.getFullYear() + 1) } else { if (w == -1) { w = 11; x.setYear(x.getFullYear() - 1) } } x.setMonth(w) }, diff: function(z, x) { var v = z.getFullYear() - x.getFullYear(); var w = z.getMonth() - x.getMonth() + (v * 12); var y = z.getDate() - x.getDate(); return w + (y / 30) } }, year: { add: function(w, v) { w.setYear(w.getFullYear() + Math[v > 0 ? "floor" : "ceil"](v)) }, diff: function(w, v) { return e.month.diff(w, v) / 12 } } }; for (var u in e) { if (u.substring(u.length - 1) != "s") { e[u + "s"] = e[u] } } var t = function(y, x) { if (Date.prototype.strftime.formatShortcuts[x]) { return y.strftime(Date.prototype.strftime.formatShortcuts[x]) } else { var v = (Date.prototype.strftime.formatCodes[x] || "").split("."); var w = y["get" + v[0]] ? y["get" + v[0]]() : ""; if (v[1]) { w = j(w, v[1]) } return w } }; var q = { succ: function(v) { return this.clone().add(1, v) }, add: function(x, w) { var v = e[w] || e.day; if (typeof v == "number") { this.setTime(this.getTime() + (v * x)) } else { v.add(this, x) } return this }, diff: function(w, z, v) { w = Date.create(w); if (w === null) { return null } var x = e[z] || e.day; if (typeof x == "number") { var y = (this.getTime() - w.getTime()) / x } else { var y = x.diff(this, w) } return (v ? y : Math[y > 0 ? "floor" : "ceil"](y)) }, strftime: function(w) { var y = w || "%Y-%m-%d", v = "", x; while (y.length > 0) { if (x = y.match(Date.prototype.strftime.formatCodes.matcher)) { v += y.slice(0, x.index); v += (x[1] || "") + t(this, x[2]); y = y.slice(x.index + x[0].length) } else { v += y; y = "" } } return v }, getShortYear: function() { return this.getYear() % 100 }, getMonthNumber: function() { return this.getMonth() + 1 }, getMonthName: function() { return Date.MONTHNAMES[this.getMonth()] }, getAbbrMonthName: function() { return Date.ABBR_MONTHNAMES[this.getMonth()] }, getDayName: function() { return Date.DAYNAMES[this.getDay()] }, getAbbrDayName: function() { return Date.ABBR_DAYNAMES[this.getDay()] }, getDayOrdinal: function() { return Date.ORDINALNAMES[this.getDate() % 10] }, getHours12: function() { var v = this.getHours(); return v > 12 ? v - 12 : (v == 0 ? 12 : v) }, getAmPm: function() { return this.getHours() >= 12 ? "PM" : "AM" }, getUnix: function() { return Math.round(this.getTime() / 1000, 0) }, getGmtOffset: function() { var v = this.getTimezoneOffset() / 60; var w = v < 0 ? "+" : "-"; v = Math.abs(v); return w + j(Math.floor(v), 2) + ":" + j((v % 1) * 60, 2) }, getTimezoneName: function() { var v = /(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString()); return v[1] || v[2] || "GMT" + this.getGmtOffset() }, toYmdInt: function() { return (this.getFullYear() * 10000) + (this.getMonthNumber() * 100) + this.getDate() }, clone: function() { return new Date(this.getTime()) } }; for (var a in q) { Date.prototype[a] = q[a] } var d = { create: function(v) { if (v instanceof Date) { return v } if (typeof v == "number") { return new Date(v) } var A = String(v).replace(/^\s*(.+)\s*$/, "$1"), w = 0, x = Date.create.patterns.length, y; var z = A; while (w < x) { ms = Date.parse(z); if (!isNaN(ms)) { return new Date(ms) } y = Date.create.patterns[w]; if (typeof y == "function") { obj = y(z); if (obj instanceof Date) { return obj } } else { z = A.replace(y[0], y[1]) } w++ } return NaN }, MONTHNAMES: "January February March April May June July August September October November December".split(" "), ABBR_MONTHNAMES: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), DAYNAMES: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), ABBR_DAYNAMES: "Sun Mon Tue Wed Thu Fri Sat".split(" "), ORDINALNAMES: "th st nd rd th th th th th th".split(" "), ISO: "%Y-%m-%dT%H:%M:%S.%N%G", SQL: "%Y-%m-%d %H:%M:%S", daysInMonth: function(v, w) { if (w == 2) { return new Date(v, 1, 29).getDate() == 29 ? 29 : 28 } return [c, 31, c, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][w] } }; for (var a in d) { Date[a] = d[a] } Date.prototype.strftime.formatCodes = { matcher: /()%(#?(%|[a-z]))/i, Y: "FullYear", y: "ShortYear.2", m: "MonthNumber.2", "#m": "MonthNumber", B: "MonthName", b: "AbbrMonthName", d: "Date.2", "#d": "Date", e: "Date", A: "DayName", a: "AbbrDayName", w: "Day", o: "DayOrdinal", H: "Hours.2", "#H": "Hours", I: "Hours12.2", "#I": "Hours12", p: "AmPm", M: "Minutes.2", "#M": "Minutes", S: "Seconds.2", "#S": "Seconds", s: "Unix", N: "Milliseconds.3", "#N": "Milliseconds", O: "TimezoneOffset", Z: "TimezoneName", G: "GmtOffset" }; Date.prototype.strftime.formatShortcuts = { F: "%Y-%m-%d", T: "%H:%M:%S", X: "%H:%M:%S", x: "%m/%d/%y", D: "%m/%d/%y", "#c": "%a %b %e %H:%M:%S %Y", v: "%e-%b-%Y", R: "%H:%M", r: "%I:%M:%S %p", t: "\t", n: "\n", "%": "%" }; Date.create.patterns = [[/-/g, "/"], [/st|nd|rd|th/g, ""], [/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/, "$2/$1/$3"], [/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/, "$2/$3/$1"], function(y) { var w = y.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i); if (w) { if (w[1]) { var x = Date.create(w[1]); if (isNaN(x)) { return } } else { var x = new Date(); x.setMilliseconds(0) } var v = parseFloat(w[2]); if (w[6]) { v = w[6].toLowerCase() == "am" ? (v == 12 ? 0 : v) : (v == 12 ? 12 : v + 12) } x.setHours(v, parseInt(w[3] || 0, 10), parseInt(w[4] || 0, 10), ((parseFloat(w[5] || 0)) || 0) * 1000); return x } else { return y } }, function(y) { var w = y.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i); if (w) { if (w[1]) { var x = Date.create(w[1]); if (isNaN(x)) { return } } else { var x = new Date(); x.setMilliseconds(0) } var v = parseFloat(w[2]); x.setHours(v, parseInt(w[3], 10), parseInt(w[4], 10), parseFloat(w[5]) * 1000); return x } else { return y } }, function(A) { var x = A.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/); if (x) { var z = new Date(); var B = parseFloat(String(z.getFullYear()).slice(2, 4)); var C = parseInt(String(z.getFullYear()) / 100, 10) * 100; var E = 1; var F = parseFloat(x[1]); var D = parseFloat(x[3]); var w, v, G; if (F > 31) { v = x[3]; if (F < B + E) { w = C + F } else { w = C - 100 + F } } else { v = x[1]; if (D < B + E) { w = C + D } else { w = C - 100 + D } } var G = h.inArray(x[2], Date.ABBR_MONTHNAMES); if (G == -1) { G = h.inArray(x[2], Date.MONTHNAMES) } z.setFullYear(w, G, v); z.setHours(0, 0, 0, 0); return z } else { return A } } ]; if (h.jqplot.config.debug) { h.date = Date.create } h.jqplot.DivTitleRenderer = function() { }; h.jqplot.DivTitleRenderer.prototype.init = function(v) { h.extend(true, this, v) }; h.jqplot.DivTitleRenderer.prototype.draw = function() { var w = this.renderer; if (!this.text) { this.show = false; this._elem = h('<div style="height:0px;width:0px;"></div>') } else { if (this.text) { var v = "position:absolute;top:0px;left:0px;"; v += (this._plotWidth) ? "width:" + this._plotWidth + "px;" : ""; v += (this.fontFamily) ? "font-family:" + this.fontFamily + ";" : ""; v += (this.fontSize) ? "font-size:" + this.fontSize + ";" : ""; v += (this.textAlign) ? "text-align:" + this.textAlign + ";" : "text-align:center;"; v += (this.textColor) ? "color:" + this.textColor + ";" : ""; this._elem = h('<div class="jqplot-title" style="' + v + '">' + this.text + "</div>") } } return this._elem }; h.jqplot.DivTitleRenderer.prototype.pack = function() { }; h.jqplot.LineRenderer = function() { this.shapeRenderer = new h.jqplot.ShapeRenderer(); this.shadowRenderer = new h.jqplot.ShadowRenderer() }; h.jqplot.LineRenderer.prototype.init = function(w) { h.extend(true, this.renderer, w); var y = { lineJoin: "round", lineCap: "round", fill: this.fill, isarc: false, strokeStyle: this.color, fillStyle: this.fillColor, lineWidth: this.lineWidth, closePath: this.fill }; this.renderer.shapeRenderer.init(y); if (this.lineWidth > 2.5) { var x = this.shadowOffset * (1 + (Math.atan((this.lineWidth / 2.5)) / 0.785398163 - 1) * 0.6) } else { var x = this.shadowOffset * Math.atan((this.lineWidth / 2.5)) / 0.785398163 } var v = { lineJoin: "round", lineCap: "round", fill: this.fill, isarc: false, angle: this.shadowAngle, offset: x, alpha: this.shadowAlpha, depth: this.shadowDepth, lineWidth: this.lineWidth, closePath: this.fill }; this.renderer.shadowRenderer.init(v) }; h.jqplot.LineRenderer.prototype.setGridData = function(A) { var w = this._xaxis.series_u2p; var z = this._yaxis.series_u2p; var x = this._plotData; var y = this._prevPlotData; this.gridData = []; this._prevGridData = []; for (var v = 0; v < this.data.length; v++) { if (x[v] != null) { this.gridData.push([w.call(this._xaxis, x[v][0]), z.call(this._yaxis, x[v][1])]) } if (y[v] != null) { this._prevGridData.push([w.call(this._xaxis, y[v][0]), z.call(this._yaxis, y[v][1])]) } } }; h.jqplot.LineRenderer.prototype.makeGridData = function(y, A) { var x = this._xaxis.series_u2p; var z = this._yaxis.series_u2p; var w = []; var B = []; for (var v = 0; v < y.length; v++) { if (y[v] != null) { w.push([x.call(this._xaxis, y[v][0]), z.call(this._yaxis, y[v][1])]) } } return w }; h.jqplot.LineRenderer.prototype.draw = function(G, N, w) { var K; var E = (w != c) ? w : {}; var y = (E.shadow != c) ? E.shadow : this.shadow; var P = (E.showLine != c) ? E.showLine : this.showLine; var J = (E.fill != c) ? E.fill : this.fill; var v = (E.fillAndStroke != c) ? E.fillAndStroke : this.fillAndStroke; G.save(); if (N.length) { if (P) { if (J) { if (this.fillToZero) { var z = new h.jqplot.ColorGenerator(this.negativeSeriesColors); var L = z.get(this.index); if (!this.useNegativeColors) { L = E.fillStyle } var C = false; var D = E.fillStyle; if (v) { var O = N.slice(0) } if (this.index == 0 || !this._stack) { var H = []; var M = this._yaxis.series_u2p(0); var x = this._xaxis.series_u2p(0); if (this.fillAxis == "y") { H.push([N[0][0], M]); for (var K = 0; K < N.length - 1; K++) { H.push(N[K]); if (this._plotData[K][1] * this._plotData[K + 1][1] < 0) { if (this._plotData[K][1] < 0) { C = true; E.fillStyle = L } else { C = false; E.fillStyle = D } var B = N[K][0] + (N[K + 1][0] - N[K][0]) * (M - N[K][1]) / (N[K + 1][1] - N[K][1]); H.push([B, M]); if (y) { this.renderer.shadowRenderer.draw(G, H, E) } this.renderer.shapeRenderer.draw(G, H, E); H = [[B, M]] } } if (this._plotData[N.length - 1][1] < 0) { C = true; E.fillStyle = L } else { C = false; E.fillStyle = D } H.push(N[N.length - 1]); H.push([N[N.length - 1][0], M]) } if (y) { this.renderer.shadowRenderer.draw(G, H, E) } this.renderer.shapeRenderer.draw(G, H, E) } else { var F = this._prevGridData; for (var K = F.length; K > 0; K--) { N.push(F[K - 1]) } if (y) { this.renderer.shadowRenderer.draw(G, N, E) } this.renderer.shapeRenderer.draw(G, N, E) } } else { if (v) { var O = N.slice(0) } if (this.index == 0 || !this._stack) { var A = G.canvas.height; N.unshift([N[0][0], A]); len = N.length; N.push([N[len - 1][0], A]) } else { var F = this._prevGridData; for (var K = F.length; K > 0; K--) { N.push(F[K - 1]) } } if (y) { this.renderer.shadowRenderer.draw(G, N, E) } this.renderer.shapeRenderer.draw(G, N, E) } if (v) { var I = h.extend(true, {}, E, { fill: false, closePath: false }); this.renderer.shapeRenderer.draw(G, O, I); if (this.markerRenderer.show) { for (K = 0; K < O.length; K++) { this.markerRenderer.draw(O[K][0], O[K][1], G, E.markerOptions) } } } } else { if (y) { this.renderer.shadowRenderer.draw(G, N, E) } this.renderer.shapeRenderer.draw(G, N, E) } } if (this.markerRenderer.show && !J) { for (K = 0; K < N.length; K++) { this.markerRenderer.draw(N[K][0], N[K][1], G, E.markerOptions) } } } G.restore() }; h.jqplot.LineRenderer.prototype.drawShadow = function(v, x, w) { }; h.jqplot.LinearAxisRenderer = function() { }; h.jqplot.LinearAxisRenderer.prototype.init = function(x) { h.extend(true, this, x); var v = this._dataBounds; for (var y = 0; y < this._series.length; y++) { var z = this._series[y]; var A = z._plotData; for (var w = 0; w < A.length; w++) { if (this.name == "xaxis" || this.name == "x2axis") { if (A[w][0] < v.min || v.min == null) { v.min = A[w][0] } if (A[w][0] > v.max || v.max == null) { v.max = A[w][0] } } else { if (A[w][1] < v.min || v.min == null) { v.min = A[w][1] } if (A[w][1] > v.max || v.max == null) { v.max = A[w][1] } } } } }; h.jqplot.LinearAxisRenderer.prototype.draw = function(v) { if (this.show) { this.renderer.createTicks.call(this); var B = 0; var w; this._elem = h('<div class="jqplot-axis jqplot-' + this.name + '" style="position:absolute;"></div>'); if (this.name == "xaxis" || this.name == "x2axis") { this._elem.width(this._plotDimensions.width) } else { this._elem.height(this._plotDimensions.height) } this.labelOptions.axis = this.name; this._label = new this.labelRenderer(this.labelOptions); if (this._label.show) { var A = this._label.draw(v); A.appendTo(this._elem) } if (this.showTicks) { var z = this._ticks; for (var y = 0; y < z.length; y++) { var x = z[y]; if (x.showLabel && (!x.isMinorTick || this.showMinorTicks)) { var A = x.draw(v); A.appendTo(this._elem) } } } } return this._elem }; h.jqplot.LinearAxisRenderer.prototype.reset = function() { this.min = this._min; this.max = this._max; this.tickInterval = this._tickInterval; this.numberTicks = this._numberTicks }; h.jqplot.LinearAxisRenderer.prototype.set = function() { var D = 0; var y; var x = 0; var C = 0; var v = (this._label == null) ? false : this._label.show; if (this.show && this.showTicks) { var B = this._ticks; for (var A = 0; A < B.length; A++) { var z = B[A]; if (z.showLabel && (!z.isMinorTick || this.showMinorTicks)) { if (this.name == "xaxis" || this.name == "x2axis") { y = z._elem.outerHeight(true) } else { y = z._elem.outerWidth(true) } if (y > D) { D = y } } } if (v) { x = this._label._elem.outerWidth(true); C = this._label._elem.outerHeight(true) } if (this.name == "xaxis") { D = D + C; this._elem.css({ height: D + "px", left: "0px", bottom: "0px" }) } else { if (this.name == "x2axis") { D = D + C; this._elem.css({ height: D + "px", left: "0px", top: "0px" }) } else { if (this.name == "yaxis") { D = D + x; this._elem.css({ width: D + "px", left: "0px", top: "0px" }); if (v && this._label.constructor == h.jqplot.AxisLabelRenderer) { this._label._elem.css("width", x + "px") } } else { D = D + x; this._elem.css({ width: D + "px", right: "0px", top: "0px" }); if (v && this._label.constructor == h.jqplot.AxisLabelRenderer) { this._label._elem.css("width", x + "px") } } } } } }; h.jqplot.LinearAxisRenderer.prototype.createTicks = function() { var ab = this._ticks; var X = this.ticks; var ac = this.name; var aa = this._dataBounds; var S, Y; var P, T; var y, x; var v, U; if (X.length) { for (U = 0; U < X.length; U++) { var D = X[U]; var G = new this.tickRenderer(this.tickOptions); if (D.constructor == Array) { G.value = D[0]; G.label = D[1]; if (!this.showTicks) { G.showLabel = false; G.showMark = false } else { if (!this.showTickMarks) { G.showMark = false } } G.setTick(D[0], this.name); this._ticks.push(G) } else { G.value = D; if (!this.showTicks) { G.showLabel = false; G.showMark = false } else { if (!this.showTickMarks) { G.showMark = false } } G.setTick(D, this.name); this._ticks.push(G) } } this.numberTicks = X.length; this.min = this._ticks[0].value; this.max = this._ticks[this.numberTicks - 1].value; this.tickInterval = (this.max - this.min) / (this.numberTicks - 1) } else { if (ac == "xaxis" || ac == "x2axis") { S = this._plotDimensions.width } else { S = this._plotDimensions.height } if (!this.autoscale && this.min != null && this.max != null && this.numberTicks != null) { this.tickInterval = null } P = ((this.min != null) ? this.min : aa.min); T = ((this.max != null) ? this.max : aa.max); if (P == T) { var E = 0.05; if (P > 0) { E = Math.max(Math.log(P) / Math.LN10, 0.05) } P -= E; T += E } var K = T - P; var O, R; var W; if (this.autoscale && this.min == null && this.max == null) { var J, z, L; var F = false; var N = false; var w = { min: null, max: null, average: null, stddev: null }; for (var U = 0; U < this._series.length; U++) { var I = this._series[U]; var B = (I.fillAxis == "x") ? I._xaxis.name : I._yaxis.name; if (this.name == B) { var H = I._plotValues[I.fillAxis]; var A = H[0]; var C = H[0]; for (var Q = 1; Q < H.length; Q++) { if (H[Q] < A) { A = H[Q] } else { if (H[Q] > C) { C = H[Q] } } } var M = (C - A) / C; if (I.renderer.constructor == h.jqplot.BarRenderer) { if (A >= 0 && (I.fillToZero || M > 0.1)) { F = true } else { F = false; if (I.fill && I.fillToZero && A < 0 && C > 0) { N = true } else { N = false } } } else { if (I.fill) { if (A >= 0 && (I.fillToZero || M > 0.1)) { F = true } else { if (A < 0 && C > 0 && I.fillToZero) { F = false; N = true } else { F = false; N = false } } } else { if (A < 0) { F = false } } } } } if (F) { this.numberTicks = 2 + Math.ceil((S - (this.tickSpacing - 1)) / this.tickSpacing); this.min = 0; z = T / (this.numberTicks - 1); W = Math.pow(10, Math.abs(Math.floor(Math.log(z) / Math.LN10))); if (z / W == parseInt(z / W, 10)) { z += W } this.tickInterval = Math.ceil(z / W) * W; this.max = this.tickInterval * (this.numberTicks - 1) } else { if (N) { this.numberTicks = 2 + Math.ceil((S - (this.tickSpacing - 1)) / this.tickSpacing); var V = Math.ceil(Math.abs(P) / K * (this.numberTicks - 1)); var Z = this.numberTicks - 1 - V; z = Math.max(Math.abs(P / V), Math.abs(T / Z)); W = Math.pow(10, Math.abs(Math.floor(Math.log(z) / Math.LN10))); this.tickInterval = Math.ceil(z / W) * W; this.max = this.tickInterval * Z; this.min = -this.tickInterval * V } else { if (this.numberTicks == null) { if (this.tickInterval) { this.numberTicks = 3 + Math.ceil(K / this.tickInterval) } else { this.numberTicks = 2 + Math.ceil((S - (this.tickSpacing - 1)) / this.tickSpacing) } } if (this.tickInterval == null) { z = K / (this.numberTicks - 1); if (z < 1) { W = Math.pow(10, Math.abs(Math.floor(Math.log(z) / Math.LN10))) } else { W = 1 } this.tickInterval = Math.ceil(z * W * this.pad) / W } else { W = 1 / this.tickInterval } J = this.tickInterval * (this.numberTicks - 1); L = (J - K) / 2; if (this.min == null) { this.min = Math.floor(W * (P - L)) / W } if (this.max == null) { this.max = this.min + J } } } } else { O = (this.min != null) ? this.min : P - K * (this.padMin - 1); R = (this.max != null) ? this.max : T + K * (this.padMax - 1); this.min = O; this.max = R; K = this.max - this.min; if (this.numberTicks == null) { if (this.tickInterval != null) { this.numberTicks = Math.ceil((this.max - this.min) / this.tickInterval) + 1; this.max = this.min + this.tickInterval * (this.numberTicks - 1) } else { if (S > 100) { this.numberTicks = parseInt(3 + (S - 100) / 75, 10) } else { this.numberTicks = 2 } } } if (this.tickInterval == null) { this.tickInterval = K / (this.numberTicks - 1) } } for (var U = 0; U < this.numberTicks; U++) { v = this.min + U * this.tickInterval; var G = new this.tickRenderer(this.tickOptions); if (!this.showTicks) { G.showLabel = false; G.showMark = false } else { if (!this.showTickMarks) { G.showMark = false } } G.setTick(v, this.name); this._ticks.push(G) } } }; h.jqplot.LinearAxisRenderer.prototype.pack = function(F, A) { var I = this._ticks; var G = this.max; var C = this.min; var z = A.max; var M = A.min; var D = (this._label == null) ? false : this._label.show; for (var v in F) { this._elem.css(v, F[v]) } this._offsets = A; var y = z - M; var L = G - C; this.p2u = function(w) { return (w - M) * L / y + C }; this.u2p = function(w) { return (w - C) * y / L + M }; if (this.name == "xaxis" || this.name == "x2axis") { this.series_u2p = function(w) { return (w - C) * y / L }; this.series_p2u = function(w) { return w * L / y + C } } else { this.series_u2p = function(w) { return (w - G) * y / L }; this.series_p2u = function(w) { return w * L / y + G } } if (this.show) { if (this.name == "xaxis" || this.name == "x2axis") { for (i = 0; i < I.length; i++) { var K = I[i]; if (K.show && K.showLabel) { var B; if (K.constructor == h.jqplot.CanvasAxisTickRenderer && K.angle) { var J = (this.name == "xaxis") ? 1 : -1; switch (K.labelPosition) { case "auto": if (J * K.angle < 0) { B = -K.getWidth() + K._textRenderer.height * Math.sin(-K._textRenderer.angle) / 2 } else { B = -K._textRenderer.height * Math.sin(K._textRenderer.angle) / 2 } break; case "end": B = -K.getWidth() + K._textRenderer.height * Math.sin(-K._textRenderer.angle) / 2; break; case "start": B = -K._textRenderer.height * Math.sin(K._textRenderer.angle) / 2; break; case "middle": B = -K.getWidth() / 2 + K._textRenderer.height * Math.sin(-K._textRenderer.angle) / 2; break; default: B = -K.getWidth() / 2 + K._textRenderer.height * Math.sin(-K._textRenderer.angle) / 2; break } } else { B = -K.getWidth() / 2 } var x = this.u2p(K.value) + B + "px"; K._elem.css("left", x); K.pack() } } if (D) { var H = this._label._elem.outerWidth(true); this._label._elem.css("left", M + y / 2 - H / 2 + "px"); if (this.name == "xaxis") { this._label._elem.css("bottom", "0px") } else { this._label._elem.css("top", "0px") } this._label.pack() } } else { for (i = 0; i < I.length; i++) { var K = I[i]; if (K.show && K.showLabel) { var B; if (K.constructor == h.jqplot.CanvasAxisTickRenderer && K.angle) { var J = (this.name == "yaxis") ? 1 : -1; switch (K.labelPosition) { case "auto": case "end": if (J * K.angle < 0) { B = -K._textRenderer.height * Math.cos(-K._textRenderer.angle) / 2 } else { B = -K.getHeight() + K._textRenderer.height * Math.cos(K._textRenderer.angle) / 2 } break; case "start": if (K.angle > 0) { B = -K._textRenderer.height * Math.cos(-K._textRenderer.angle) / 2 } else { B = -K.getHeight() + K._textRenderer.height * Math.cos(K._textRenderer.angle) / 2 } break; case "middle": B = -K.getHeight() / 2; break; default: B = -K.getHeight() / 2; break } } else { B = -K.getHeight() / 2 } var x = this.u2p(K.value) + B + "px"; K._elem.css("top", x); K.pack() } } if (D) { var E = this._label._elem.outerHeight(true); this._label._elem.css("top", z - y / 2 - E / 2 + "px"); if (this.name == "yaxis") { this._label._elem.css("left", "0px") } else { this._label._elem.css("right", "0px") } this._label.pack() } } } }; h.jqplot.MarkerRenderer = function(v) { this.show = true; this.style = "filledCircle"; this.lineWidth = 2; this.size = 9; this.color = "#666666"; this.shadow = true; this.shadowAngle = 45; this.shadowOffset = 1; this.shadowDepth = 3; this.shadowAlpha = "0.07"; this.shadowRenderer = new h.jqplot.ShadowRenderer(); this.shapeRenderer = new h.jqplot.ShapeRenderer(); h.extend(true, this, v) }; h.jqplot.MarkerRenderer.prototype.init = function(v) { h.extend(true, this, v); var x = { angle: this.shadowAngle, offset: this.shadowOffset, alpha: this.shadowAlpha, lineWidth: this.lineWidth, depth: this.shadowDepth, closePath: true }; if (this.style.indexOf("filled") != -1) { x.fill = true } if (this.style.indexOf("ircle") != -1) { x.isarc = true; x.closePath = false } this.shadowRenderer.init(x); var w = { fill: false, isarc: false, strokeStyle: this.color, fillStyle: this.color, lineWidth: this.lineWidth, closePath: true }; if (this.style.indexOf("filled") != -1) { w.fill = true } if (this.style.indexOf("ircle") != -1) { w.isarc = true; w.closePath = false } this.shapeRenderer.init(w) }; h.jqplot.MarkerRenderer.prototype.drawDiamond = function(z, w, C, B, E) { var v = 1.2; var F = this.size / 2 / v; var D = this.size / 2 * v; var A = [[z - F, w], [z, w + D], [z + F, w], [z, w - D]]; if (this.shadow) { this.shadowRenderer.draw(C, A) } this.shapeRenderer.draw(C, A, E); C.restore() }; h.jqplot.MarkerRenderer.prototype.drawPlus = function(A, z, D, C, G) { var w = 1; var H = this.size / 2 * w; var E = this.size / 2 * w; var F = [[A, z - E], [A, z + E]]; var B = [[A + H, z], [A - H, z]]; var v = h.extend(true, {}, this.options, { closePath: false }); if (this.shadow) { this.shadowRenderer.draw(D, F, { closePath: false }); this.shadowRenderer.draw(D, B, { closePath: false }) } this.shapeRenderer.draw(D, F, v); this.shapeRenderer.draw(D, B, v); D.restore() }; h.jqplot.MarkerRenderer.prototype.drawX = function(A, z, D, C, G) { var w = 1; var H = this.size / 2 * w; var E = this.size / 2 * w; var v = h.extend(true, {}, this.options, { closePath: false }); var F = [[A - H, z - E], [A + H, z + E]]; var B = [[A - H, z + E], [A + H, z - E]]; if (this.shadow) { this.shadowRenderer.draw(D, F, { closePath: false }); this.shadowRenderer.draw(D, B, { closePath: false }) } this.shapeRenderer.draw(D, F, v); this.shapeRenderer.draw(D, B, v); D.restore() }; h.jqplot.MarkerRenderer.prototype.drawDash = function(z, w, C, B, E) { var v = 1; var F = this.size / 2 * v; var D = this.size / 2 * v; var A = [[z - F, w], [z + F, w]]; if (this.shadow) { this.shadowRenderer.draw(C, A) } this.shapeRenderer.draw(C, A, E); C.restore() }; h.jqplot.MarkerRenderer.prototype.drawSquare = function(z, w, C, B, E) { var v = 1; var F = this.size / 2 / v; var D = this.size / 2 * v; var A = [[z - F, w - D], [z - F, w + D], [z + F, w + D], [z + F, w - D]]; if (this.shadow) { this.shadowRenderer.draw(C, A) } this.shapeRenderer.draw(C, A, E); C.restore() }; h.jqplot.MarkerRenderer.prototype.drawCircle = function(w, E, A, D, B) { var v = this.size / 2; var z = 2 * Math.PI; var C = [w, E, v, 0, z, true]; if (this.shadow) { this.shadowRenderer.draw(A, C) } this.shapeRenderer.draw(A, C, B); A.restore() }; h.jqplot.MarkerRenderer.prototype.draw = function(v, A, w, z) { z = z || {}; switch (this.style) { case "diamond": this.drawDiamond(v, A, w, false, z); break; case "filledDiamond": this.drawDiamond(v, A, w, true, z); break; case "circle": this.drawCircle(v, A, w, false, z); break; case "filledCircle": this.drawCircle(v, A, w, true, z); break; case "square": this.drawSquare(v, A, w, false, z); break; case "filledSquare": this.drawSquare(v, A, w, true, z); break; case "x": this.drawX(v, A, w, true, z); break; case "plus": this.drawPlus(v, A, w, true, z); break; case "dash": this.drawDash(v, A, w, true, z); break; default: this.drawDiamond(v, A, w, false, z); break } }; h.jqplot.ShadowRenderer = function(v) { this.angle = 45; this.offset = 1; this.alpha = 0.07; this.lineWidth = 1.5; this.lineJoin = "miter"; this.lineCap = "round"; this.closePath = false; this.fill = false; this.depth = 3; this.isarc = false; h.extend(true, this, v) }; h.jqplot.ShadowRenderer.prototype.init = function(v) { h.extend(true, this, v) }; h.jqplot.ShadowRenderer.prototype.draw = function(E, C, F) { E.save(); var v = (F != null) ? F : {}; var D = (v.fill != null) ? v.fill : this.fill; var B = (v.closePath != null) ? v.closePath : this.closePath; var y = (v.offset != null) ? v.offset : this.offset; var w = (v.alpha != null) ? v.alpha : this.alpha; var A = (v.depth != null) ? v.depth : this.depth; E.lineWidth = (v.lineWidth != null) ? v.lineWidth : this.lineWidth; E.lineJoin = (v.lineJoin != null) ? v.lineJoin : this.lineJoin; E.lineCap = (v.lineCap != null) ? v.lineCap : this.lineCap; E.strokeStyle = "rgba(0,0,0," + w + ")"; E.fillStyle = "rgba(0,0,0," + w + ")"; for (var x = 0; x < A; x++) { E.translate(Math.cos(this.angle * Math.PI / 180) * y, Math.sin(this.angle * Math.PI / 180) * y); E.beginPath(); if (this.isarc) { E.arc(C[0], C[1], C[2], C[3], C[4], true) } else { E.moveTo(C[0][0], C[0][1]); for (var z = 1; z < C.length; z++) { E.lineTo(C[z][0], C[z][1]) } } if (B) { E.closePath() } if (D) { E.fill() } else { E.stroke() } } E.restore() }; h.jqplot.ShapeRenderer = function(v) { this.lineWidth = 1.5; this.lineJoin = "miter"; this.lineCap = "round"; this.closePath = false; this.fill = false; this.isarc = false; this.fillRect = false; this.strokeRect = false; this.clearRect = false; this.strokeStyle = "#999999"; this.fillStyle = "#999999"; h.extend(true, this, v) }; h.jqplot.ShapeRenderer.prototype.init = function(v) { h.extend(true, this, v) }; h.jqplot.ShapeRenderer.prototype.draw = function(D, B, F) { D.save(); var v = (F != null) ? F : {}; var C = (v.fill != null) ? v.fill : this.fill; var z = (v.closePath != null) ? v.closePath : this.closePath; var A = (v.fillRect != null) ? v.fillRect : this.fillRect; var x = (v.strokeRect != null) ? v.strokeRect : this.strokeRect; var w = (v.clearRect != null) ? v.clearRect : this.clearRect; var E = (v.isarc != null) ? v.isarc : this.isarc; D.lineWidth = v.lineWidth || this.lineWidth; D.lineJoin = v.lineJoing || this.lineJoin; D.lineCap = v.lineCap || this.lineCap; D.strokeStyle = (v.strokeStyle || v.color) || this.strokeStyle; D.fillStyle = v.fillStyle || this.fillStyle; D.beginPath(); if (E) { D.arc(B[0], B[1], B[2], B[3], B[4], true); if (z) { D.closePath() } if (C) { D.fill() } else { D.stroke() } D.restore(); return } else { if (w) { D.clearRect(B[0], B[1], B[2], B[3]); D.restore(); return } else { if (A || x) { if (A) { D.fillRect(B[0], B[1], B[2], B[3]) } if (x) { D.strokeRect(B[0], B[1], B[2], B[3]); D.restore(); return } } else { D.moveTo(B[0][0], B[0][1]); for (var y = 1; y < B.length; y++) { D.lineTo(B[y][0], B[y][1]) } if (z) { D.closePath() } if (C) { D.fill() } else { D.stroke() } } } } D.restore() }; h.jqplot.TableLegendRenderer = function() { }; h.jqplot.TableLegendRenderer.prototype.init = function(v) { h.extend(true, this, v) }; h.jqplot.TableLegendRenderer.prototype.addrow = function(x, w, A) { var v = (A) ? this.rowSpacing : "0"; var z = h('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem); h('<td class="jqplot-table-legend" style="text-align:center;padding-top:' + v + ';"><div><div class="jqplot-table-legend-swatch" style="border-color:' + w + ';"></div></div></td>').appendTo(z); var y = h('<td class="jqplot-table-legend" style="padding-top:' + v + ';"></td>'); y.appendTo(z); if (this.escapeHtml) { y.text(x) } else { y.html(x) } }; h.jqplot.TableLegendRenderer.prototype.draw = function() { var B = this; if (this.show) { var z = this._series; var D = "position:absolute;"; D += (this.background) ? "background:" + this.background + ";" : ""; D += (this.border) ? "border:" + this.border + ";" : ""; D += (this.fontSize) ? "font-size:" + this.fontSize + ";" : ""; D += (this.fontFamily) ? "font-family:" + this.fontFamily + ";" : ""; D += (this.textColor) ? "color:" + this.textColor + ";" : ""; this._elem = h('<table class="jqplot-table-legend" style="' + D + '"></table>'); var v = false; for (var A = 0; A < z.length; A++) { s = z[A]; if (s.show && s.showLabel) { var y = s.label.toString(); if (y) { var w = s.color; if (s._stack && !s.fill) { w = "" } this.renderer.addrow.call(this, y, w, v); v = true } for (var x = 0; x < h.jqplot.addLegendRowHooks.length; x++) { var C = h.jqplot.addLegendRowHooks[x].call(this, s); if (C) { this.renderer.addrow.call(this, C.label, C.color, v); v = true } } } } } return this._elem }; h.jqplot.TableLegendRenderer.prototype.pack = function(y) { if (this.show) { var x = { _top: y.top, _left: y.left, _right: y.right, _bottom: this._plotDimensions.height - y.bottom }; switch (this.location) { case "nw": var w = x._left + this.xoffset; var v = x._top + this.yoffset; this._elem.css("left", w); this._elem.css("top", v); break; case "n": var w = (y.left + (this._plotDimensions.width - y.right)) / 2 - this.getWidth() / 2; var v = x._top + this.yoffset; this._elem.css("left", w); this._elem.css("top", v); break; case "ne": var w = y.right + this.xoffset; var v = x._top + this.yoffset; this._elem.css({ right: w, top: v }); break; case "e": var w = y.right + this.xoffset; var v = (y.top + (this._plotDimensions.height - y.bottom)) / 2 - this.getHeight() / 2; this._elem.css({ right: w, top: v }); break; case "se": var w = y.right + this.xoffset; var v = y.bottom + this.yoffset; this._elem.css({ right: w, bottom: v }); break; case "s": var w = (y.left + (this._plotDimensions.width - y.right)) / 2 - this.getWidth() / 2; var v = y.bottom + this.yoffset; this._elem.css({ left: w, bottom: v }); break; case "sw": var w = x._left + this.xoffset; var v = y.bottom + this.yoffset; this._elem.css({ left: w, bottom: v }); break; case "w": var w = x._left + this.xoffset; var v = (y.top + (this._plotDimensions.height - y.bottom)) / 2 - this.getHeight() / 2; this._elem.css({ left: w, top: v }); break; default: var w = x._right - this.xoffset; var v = x._bottom + this.yoffset; this._elem.css({ right: w, bottom: v }); break } } }; h.jqplot.sprintf = function() { function A(G, C, D, F) { var E = (G.length >= C) ? "" : Array(1 + C - G.length >>> 0).join(D); return F ? G + E : E + G } function x(H, G, J, E, F, D) { var I = E - H.length; if (I > 0) { var C = " "; if (D) { C = "&nbsp;" } if (J || !F) { H = A(H, E, C, J) } else { H = H.slice(0, G.length) + A("", I, "0", true) + H.slice(G.length) } } return H } function B(K, D, I, E, C, H, J, G) { var F = K >>> 0; I = I && F && { "2": "0b", "8": "0", "16": "0x"}[D] || ""; K = I + A(F.toString(D), H || 0, "0", false); return x(K, I, E, C, J, G) } function v(G, H, E, C, F, D) { if (C != null) { G = G.slice(0, C) } return x(G, "", H, E, F, D) } var w = arguments, y = 0, z = w[y++]; return z.replace(h.jqplot.sprintf.regex, function(V, I, J, M, X, T, G) { if (V == "%%") { return "%" } var N = false, K = "", L = false, U = false, H = false; for (var S = 0; J && S < J.length; S++) { switch (J.charAt(S)) { case " ": K = " "; break; case "+": K = "+"; break; case "-": N = true; break; case "0": L = true; break; case "#": U = true; break; case "&": H = true; break } } if (!M) { M = 0 } else { if (M == "*") { M = +w[y++] } else { if (M.charAt(0) == "*") { M = +w[M.slice(1, -1)] } else { M = +M } } } if (M < 0) { M = -M; N = true } if (!isFinite(M)) { throw new Error("$.jqplot.sprintf: (minimum-)width must be finite") } if (!T) { T = "fFeE".indexOf(G) > -1 ? 6 : (G == "d") ? 0 : void (0) } else { if (T == "*") { T = +w[y++] } else { if (T.charAt(0) == "*") { T = +w[T.slice(1, -1)] } else { T = +T } } } var P = I ? w[I.slice(0, -1)] : w[y++]; switch (G) { case "s": if (P == null) { return "" } return v(String(P), N, M, T, L, H); case "c": return v(String.fromCharCode(+P), N, M, T, L, H); case "b": return B(P, 2, U, N, M, T, L, H); case "o": return B(P, 8, U, N, M, T, L, H); case "x": return B(P, 16, U, N, M, T, L, H); case "X": return B(P, 16, U, N, M, T, L, H).toUpperCase(); case "u": return B(P, 10, U, N, M, T, L, H); case "i": case "d": var E = parseInt(+P, 10); if (isNaN(E)) { return "" } var R = E < 0 ? "-" : K; P = R + A(String(Math.abs(E)), T, "0", false); return x(P, R, N, M, L, H); case "e": case "E": case "f": case "F": case "g": case "G": var E = +P; if (isNaN(E)) { return "" } var R = E < 0 ? "-" : K; var F = ["toExponential", "toFixed", "toPrecision"]["efg".indexOf(G.toLowerCase())]; var W = ["toString", "toUpperCase"]["eEfFgG".indexOf(G) % 2]; P = R + Math.abs(E)[F](T); return x(P, R, N, M, L, H)[W](); case "p": case "P": var E = +P; if (isNaN(E)) { return "" } var R = E < 0 ? "-" : K; var O = String(Number(Math.abs(E)).toExponential()).split(/e|E/); var D = (O[0].indexOf(".") != -1) ? O[0].length - 1 : O[0].length; var Q = (O[1] < 0) ? -O[1] - 1 : 0; if (Math.abs(E) < 1) { if (D + Q <= T) { P = R + Math.abs(E).toPrecision(D) } else { if (D <= T - 1) { P = R + Math.abs(E).toExponential(D - 1) } else { P = R + Math.abs(E).toExponential(T - 1) } } } else { var C = (D <= T) ? D : T; P = R + Math.abs(E).toPrecision(C) } var W = ["toString", "toUpperCase"]["pP".indexOf(G) % 2]; return x(P, R, N, M, L, H)[W](); case "n": return ""; default: return V } }) }; h.jqplot.sprintf.regex = /%%|%(\d+\$)?([-+#0& ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g })(jQuery);
