Вход Регистрация
Файл: CloudBox-main/CloudBox/admin_assets/js/chart/morris.min.js
Строк: 1732
<?php
(function () {
    var 
etnr= [].slice= {}.hasOwnProperty= function (et) {
        function 
r() {
            
this.constructor e
        
}

        for (var 
n in t)s.call(tn) && (e[n] = t[n]);
        return 
r.prototype t.prototypee.prototype = new re.__super__ t.prototypee
    
}, = function (et) {
        return function () {
            return 
e.apply(targuments)
        }
    }, 
= [].indexOf || function (e) {
        for (var 
0this.lengthnt++)if (t in this && this[t] === e)return t;
        return-
1
    
};
    
window.Morris = {}, jQueryt.EventEmitter = function () {
        function 
e() {
        }

        return 
e.prototype.on = function (et) {
            return 
this.handlers == null && (this.handlers = {}), this.handlers[e] == null && (this.handlers[e] = []), this.handlers[e].push(t), this
        
}, e.prototype.fire = function () {
            var 
etnrsou;
            
arguments[0], <= arguments.length i.call(arguments1) : [];
            if (
this.handlers != null && this.handlers[n] != null) {
                
this.handlers[n], = [];
                for (
0o.lengthsr++)o[r], u.push(t.apply(nulle));
                return 
u
            
}
        }, 
e
    
}(), t.commas = function (e) {
        var 
tnri;
        return 
!= null ? ("-" ""Math.abs(e), Math.floor(t).toFixed(0), += n.replace(/(?=(?:d{3})+$)(?!^)/g","), t.toString(), i.length n.length && (+= i.slice(n.length)), r) : "-"
    
}, t.pad2 = function (e) {
        return(
10 "0" "") + e
    
}, t.Grid = function (n) {
        function 
r(t) {
            var 
this;
            
typeof t.element == "string" this.el e(document.getElementById(t.element)) : this.el e(t.element);
            if (
this.el == null || this.el.length === 0)throw new Error("Graph container element not found");
            
this.el.css("position") === "static" && this.el.css("position""relative"), this.options e.extend({}, this.gridDefaultsthis.defaults || {}, t), typeof this.options.units == "string" && (this.options.postUnits t.units), this.raphael = new Raphael(this.el[0]), this.elementWidth nullthis.elementHeight nullthis.dirty = !1this.init && this.init(), this.setData(this.options.data), this.el.bind("mousemove", function (e) {
                var 
t;
                return 
n.el.offset(), n.fire("hovermove"e.pageX t.lefte.pageY t.top)
            }), 
this.el.bind("mouseout", function (e) {
                return 
n.fire("hoverout")
            }), 
this.el.bind("touchstart touchmove touchend", function (e) {
                var 
tr;
                return 
e.originalEvent.touches[0] || e.originalEvent.changedTouches[0], n.el.offset(), n.fire("hover"r.pageX t.leftr.pageY t.top), r
            
}), this.el.bind("click", function (e) {
                var 
t;
                return 
n.el.offset(), n.fire("gridclick"e.pageX t.lefte.pageY t.top)
            }), 
this.postInit && this.postInit()
        }

        return 
o(rn), r.prototype.gridDefaults = {dateFormatnullaxes: !0grid: !0gridLineColor"#aaa"gridStrokeWidth.5gridTextColor"#888"gridTextSize12gridTextFamily"sans-serif"gridTextWeight"normal"hideHover: !1yLabelFormatnullxLabelAngle0numLines5padding25parseTime: !0postUnits""preUnits""ymax"auto"ymin"auto 0"goals: [], goalStrokeWidth1goalLineColors: ["#666633""#999966""#cc6666""#663333"], events: [], eventStrokeWidth1eventLineColors: ["#005a04""#ccffbb""#3a5f0b""#005502"]}, r.prototype.setData = function (en) {
            var 
risouaflchpdvm;
            
== null && (= !0), this.options.data e;
            if (
== null || e.length === 0) {
                
this.data = [], this.raphael.clear(), this.hover != null && this.hover.hide();
                return
            }
            
this.cumulative nullthis.cumulative nullthis.options.goals.length && (Math.min.apply(nullthis.options.goals), Math.max.apply(nullthis.options.goals), != null Math.min(vu) : u!= null Math.max(do) : o), this.data = function () {
                var 
nro;
                
= [];
                for (
0e.lengthr= ++n)e[s], = {}, a.label f[this.options.xkey], this.options.parseTime ? (a.t.parseDate(a.label), this.options.dateFormat a.label this.options.dateFormat(a.x) : typeof a.label == "number" && (a.label = (new Date(a.label)).toString())) : (a.sthis.options.xLabelFormat && (a.label this.options.xLabelFormat(a))), 0a.= function () {
                    var 
etnr;
                    
this.options.ykeys= [];
                    for (
0n.lengtht= ++e)n[i], f[p], typeof m == "string" && (parseFloat(m)), != null && typeof m != "number" && (null), != null && (this.cumulative += != null ? (Math.max(md), Math.min(mv)) : m), this.cumulative && != null && (Math.max(cd), Math.min(cv)), r.push(m);
                    return 
r
                
}.call(this), o.push(a);
                return 
o
            
}.call(this), this.options.parseTime && (this.data this.data.sort(function (et) {
                return(
e.t.x) - (t.e.x)
            })), 
this.xmin this.data[0].xthis.xmax this.data[this.data.length 1].xthis.events = [], this.options.parseTime && this.options.events.length && (this.events = function () {
                var 
enis;
                
this.options.events= [];
                for (
0i.lengthne++)i[e], s.push(t.parseDate(r));
                return 
s
            
}.call(this), this.xmax Math.max(this.xmaxMath.max.apply(nullthis.events)), this.xmin Math.min(this.xminMath.min.apply(nullthis.events))), this.xmin === this.xmax && (this.xmin -= 1this.xmax += 1), this.ymin this.yboundary("min"v), this.ymax this.yboundary("max"d), this.ymin === this.ymax && (&& (this.ymin -= 1), this.ymax += 1);
            if (
this.options.axes === !|| this.options.grid === !0)this.options.ymax === this.gridDefaults.ymax && this.options.ymin === this.gridDefaults.ymin ? (this.grid this.autoGridLines(this.yminthis.ymaxthis.options.numLines), this.ymin Math.min(this.yminthis.grid[0]), this.ymax Math.max(this.ymaxthis.grid[this.grid.length 1])) : (= (this.ymax this.ymin) / (this.options.numLines 1), this.grid = function () {
                var 
etnr;
                
= [];
                for (
this.yminthis.ymax<= <= >= n+= l)r.push(h);
                return 
r
            
}.call(this));
            
this.dirty = !0;
            if (
n)return this.redraw()
        }, 
r.prototype.yboundary = function (et) {
            var 
nr;
            return 
this.options["y" e], typeof n == "string" n.slice(04) === "auto" n.length ? (parseInt(n.slice(5), 10), == null Math[e](tr)) : != null parseInt(n10) : n
        
}, r.prototype.autoGridLines = function (etn) {
            var 
risouaflc;
            return 
eMath.floor(Math.log(u) / Math.log(10)), Math.pow(10c), Math.floor(f) * fMath.ceil(f) * f= (i) / (1), === && && Math.ceil(a) !== && (Math.ceil(a), * (1)), && && (Math.floor(a) * aMath.ceil(a) * a), ? (Math.floor(Math.log(a) / Math.log(10)), = function () {
                var 
et;
                
= [];
                for (
i<= <= >= r+= a)t.push(parseFloat(l.toFixed(o)));
                return 
t
            
}()) : = function () {
                var 
et;
                
= [];
                for (
i<= <= >= r+= a)t.push(l);
                return 
t
            
}(), s
        
}, r.prototype._calc = function () {
            var 
etnris;
            
this.el.width(), this.el.height();
            if (
this.elementWidth !== || this.elementHeight !== || this.dirty) {
                
this.elementWidth ithis.elementHeight nthis.dirty = !1this.left this.options.paddingthis.right this.elementWidth this.options.paddingthis.top this.options.paddingthis.bottom this.elementHeight this.options.paddingthis.options.axes && (= function () {
                    var 
enri;
                    
this.grid= [];
                    for (
0r.lengthne++)r[e], i.push(this.measureText(this.yAxisFormat(t)).width);
                    return 
i
                
}.call(this), this.left += Math.max.apply(Maths), = function () {
                    var 
etn;
                    
= [];
                    for (
0this.data.length<= t<= ? ++: --e)n.push(this.measureText(this.data[r].text, -this.options.xLabelAngle).height);
                    return 
n
                
}.call(this), this.bottom -= Math.max.apply(Mathe)), this.width Math.max(1this.right this.left), this.height Math.max(1this.bottom this.top), this.dx this.width / (this.xmax this.xmin), this.dy this.height / (this.ymax this.ymin);
                if (
this.calc)return this.calc()
            }
        }, 
r.prototype.transY = function (e) {
            return 
this.bottom - (this.ymin) * this.dy
        
}, r.prototype.transX = function (e) {
            return 
this.data.length === ? (this.left this.right) / this.left + (this.xmin) * this.dx
        
}, r.prototype.redraw = function () {
            
this.raphael.clear(), this._calc(), this.drawGrid(), this.drawGoals(), this.drawEvents();
            if (
this.draw)return this.draw()
        }, 
r.prototype.measureText = function (et) {
            var 
nr;
            return 
== null && (0), this.raphael.text(100100e).attr("font-size"this.options.gridTextSize).attr("font-family"this.options.gridTextFamily).attr("font-weight"this.options.gridTextWeight).rotate(t), r.getBBox(), r.remove(), n
        
}, r.prototype.yAxisFormat = function (e) {
            return 
this.yLabelFormat(e)
        }, 
r.prototype.yLabelFormat = function (e) {
            return 
typeof this.options.yLabelFormat == "function" this.options.yLabelFormat(e) : "" this.options.preUnits t.commas(e) + this.options.postUnits
        
}, r.prototype.updateHover = function (et) {
            var 
nr;
            
this.hitTest(et);
            if (
!= null)return(this.hover).update.apply(rn)
        }, 
r.prototype.drawGrid = function () {
            var 
etnris;
            if (
this.options.grid === !&& this.options.axes === !1)return;
            
this.grid= [];
            for (
0i.lengthrn++)i[n], this.transY(e), this.options.axes && this.drawYAxisLabel(this.left this.options.padding 2tthis.yAxisFormat(e)), this.options.grid s.push(this.drawGridLine("M" this.left "," "H" + (this.left this.width))) : s.push(void 0);
            return 
s
        
}, r.prototype.drawGoals = function () {
            var 
etnriso;
            
this.options.goals= [];
            for (
0s.lengthi= ++r)s[n], this.options.goalLineColors[this.options.goalLineColors.length], o.push(this.drawGoal(te));
            return 
o
        
}, r.prototype.drawEvents = function () {
            var 
etnriso;
            
this.events= [];
            for (
0s.lengthi= ++r)s[n], this.options.eventLineColors[this.options.eventLineColors.length], o.push(this.drawEvent(te));
            return 
o
        
}, r.prototype.drawGoal = function (et) {
            return 
this.raphael.path("M" this.left "," this.transY(e) + "H" this.right).attr("stroke"t).attr("stroke-width"this.options.goalStrokeWidth)
        }, 
r.prototype.drawEvent = function (et) {
            return 
this.raphael.path("M" this.transX(e) + "," this.bottom "V" this.top).attr("stroke"t).attr("stroke-width"this.options.eventStrokeWidth)
        }, 
r.prototype.drawYAxisLabel = function (etn) {
            return 
this.raphael.text(etn).attr("font-size"this.options.gridTextSize).attr("font-family"this.options.gridTextFamily).attr("font-weight"this.options.gridTextWeight).attr("fill"this.options.gridTextColor).attr("text-anchor""end")
        }, 
r.prototype.drawGridLine = function (e) {
            return 
this.raphael.path(e).attr("stroke"this.options.gridLineColor).attr("stroke-width"this.options.gridStrokeWidth)
        }, 
r
    
}(t.EventEmitter), t.parseDate = function (e) {
        var 
tnrisouaflc;
        return 
typeof e == "number" : (e.match(/^(d+) Q(d)$/), e.match(/^(d+)-(d+)$/), e.match(/^(d+)-(d+)-(d+)$/), e.match(/^(d+) W(d+)$/), e.match(/^(d+)-(d+)-(d+)[ T](d+):(d+)(Z|([+-])(dd):?(dd))?$/), e.match(/^(d+)-(d+)-(d+)[ T](d+):(d+):(d+(.d+)?)(Z|([+-])(dd):?(dd))?$/), ? (new Date(parseInt(n[1], 10), parseInt(n[2], 10) * 11)).getTime() : ? (new Date(parseInt(i[1], 10), parseInt(i[2], 10) - 11)).getTime() : ? (new Date(parseInt(s[1], 10), parseInt(s[2], 10) - 1parseInt(s[3], 10))).getTime() : ? (= new Date(parseInt(u[1], 10), 01), l.getDay() !== && l.setMonth(0+ (l.getDay() + 7) % 7), l.getTime() + parseInt(u[2], 10) * 6048e5) : a[6] ? (0a[6] !== "Z" && (parseInt(a[8], 10) * 60 parseInt(a[9], 10), a[7] === "+" && (o)), Date.UTC(parseInt(a[1], 10), parseInt(a[2], 10) - 1parseInt(a[3], 10), parseInt(a[4], 10), parseInt(a[5], 10) + o)) : (new Date(parseInt(a[1], 10), parseInt(a[2], 10) - 1parseInt(a[3], 10), parseInt(a[4], 10), parseInt(a[5], 10))).getTime() : ? (parseFloat(f[6]), Math.floor(c), Math.round((t) * 1e3), f[8] ? (0f[8] !== "Z" && (parseInt(f[10], 10) * 60 parseInt(f[11], 10), f[9] === "+" && (o)), Date.UTC(parseInt(f[1], 10), parseInt(f[2], 10) - 1parseInt(f[3], 10), parseInt(f[4], 10), parseInt(f[5], 10) + otr)) : (new Date(parseInt(f[1], 10), parseInt(f[2], 10) - 1parseInt(f[3], 10), parseInt(f[4], 10), parseInt(f[5], 10), tr)).getTime()) : (new Date(parseInt(e10), 01)).getTime())
    }, 
t.Hover = function () {
        function 
n(n) {
            
== null && (= {}), this.options e.extend({}, t.Hover.defaultsn), this.el e("<div class='" this.options["class"] + "'></div>"), this.el.hide(), this.options.parent.append(this.el)
        }

        return 
n.defaults = {"class""morris-hover morris-default-style"}, n.prototype.update = function (etn) {
            return 
this.html(e), this.show(), this.moveTo(tn)
        }, 
n.prototype.html = function (e) {
            return 
this.el.html(e)
        }, 
n.prototype.moveTo = function (et) {
            var 
nrisou;
            return 
this.options.parent.innerWidth(), this.options.parent.innerHeight(), this.el.outerWidth(), this.el.outerHeight(), Math.min(Math.max(02), r), != null ? (10&& (10&& (2))) : 2this.el.css({left"px"topparseInt(u) + "px"})
        }, 
n.prototype.show = function () {
            return 
this.el.show()
        }, 
n.prototype.hide = function () {
            return 
this.el.hide()
        }, 
n
    
}(), t.Line = function (e) {
        function 
n(e) {
            
this.hilight u(this.hilightthis), this.onHoverOut u(this.onHoverOutthis), this.onHoverMove u(this.onHoverMovethis), this.onGridClick u(this.onGridClickthis);
            if (!(
this instanceof t.Line))return new t.Line(e);
            
n.__super__.constructor.call(thise)
        }

        return 
o(ne), n.prototype.init = function () {
            
this.pointGrow Raphael.animation({rthis.options.pointSize 3}, 25"linear"), this.pointShrink Raphael.animation({rthis.options.pointSize}, 25"linear");
            if (
this.options.hideHover !== "always")return this.hover = new t.Hover({parentthis.el}), this.on("hovermove"this.onHoverMove), this.on("hoverout"this.onHoverOut), this.on("gridclick"this.onGridClick)
        }, 
n.prototype.defaults = {lineWidth3pointSize4lineColors: ["#0b62a4""#7A92A3""#4da74d""#afd8f8""#edc240""#cb4b4b""#9440ed"], pointWidths: [1], pointStrokeColors: ["#ffffff"], pointFillColors: [], smooth: !0xLabels"auto"xLabelFormatnullxLabelMargin24continuousLine: !0hideHover: !1}, n.prototype.calc = function () {
            return 
this.calcPoints(), this.generatePaths()
        }, 
n.prototype.calcPoints = function () {
            var 
etnris;
            
this.data= [];
            for (
0i.lengthrn++)i[n], e._x this.transX(e.x), e._y = function () {
                var 
nris;
                
e.y= [];
                for (
0i.lengthrn++)i[n], != null s.push(this.transY(t)) : s.push(t);
                return 
s
            
}.call(this), s.push(e._ymax Math.min.apply(null, [this.bottom].concat(function () {
                var 
nris;
                
e._y= [];
                for (
0i.lengthrn++)i[n], != null && s.push(t);
                return 
s
            
}())));
            return 
s
        
}, n.prototype.hitTest = function (et) {
            var 
nriso;
            if (
this.data.length === 0)return null;
            
this.data.slice(1);
            for (
0o.lengths= ++i) {
                
o[n];
                if (
< (r._x this.data[n]._x) / 2)break
            }
            return 
n
        
}, n.prototype.onGridClick = function (et) {
            var 
n;
            return 
this.hitTest(et), this.fire("click"nthis.options.data[n], et)
        }, 
n.prototype.onHoverMove = function (et) {
            var 
n;
            return 
this.hitTest(et), this.displayHoverForRow(n)
        }, 
n.prototype.onHoverOut = function () {
            if (
this.options.hideHover !== !1)return this.displayHoverForRow(null)
        }, 
n.prototype.displayHoverForRow = function (e) {
            var 
t;
            return 
!= null ? ((this.hover).update.apply(tthis.hoverContentForRow(e)), this.hilight(e)) : (this.hover.hide(), this.hilight())
        }, 
n.prototype.hoverContentForRow = function (e) {
            var 
tnrisou;
            
this.data[e], "<div class='morris-hover-row-label'>" r.label "</div>"r.y;
            for (
0u.lengtho= ++s)u[n], += "<div class='morris-hover-point' style='color: " this.colorFor(rn"label") + "'>n  " this.options.labels[n] + ":n  " this.yLabelFormat(i) + "n</div>";
            return 
typeof this.options.hoverCallback == "function" && (this.options.hoverCallback(ethis.optionst)), [tr._xr._ymax]
        }, 
n.prototype.generatePaths = function () {
            var 
enris;
            return 
this.paths = function () {
                var 
oufl;
                
= [];
                for (
0this.options.ykeys.length<= u<= ? ++: --o)this.options.smooth === !|| (this.options.ykeys[r], a.call(this.options.smoothf) >= 0), = function () {
                    var 
etns;
                    
this.data= [];
                    for (
0n.lengthte++)n[e], i._y[r] !== void 0 && s.push({xi._xyi._y[r]});
                    return 
s
                
}.call(this), this.options.continuousLine && (= function () {
                    var 
tri;
                    
= [];
                    for (
0n.lengthrt++)n[t], e.!== null && i.push(e);
                    return 
i
                
}()), n.length l.push(t.Line.createPath(nsthis.bottom)) : l.push(null);
                return 
l
            
}.call(this)
        }, 
n.prototype.draw = function () {
            
this.options.axes && this.drawXAxis(), this.drawSeries();
            if (
this.options.hideHover === !1)return this.displayHoverForRow(this.data.length 1)
        }, 
n.prototype.drawXAxis = function () {
            var 
enrisouaflthis;
            
this.bottom this.options.padding 2nullnull= function (et) {
                var 
nroaf;
                return 
c.drawXAxisLabel(c.transX(t), ue), n.getBBox(), n.transform("r" + -c.options.xLabelAngle), n.getBBox(), n.transform("t0," r.height "..."), c.options.xLabelAngle !== && (= -0.5 f.width Math.cos(c.options.xLabelAngle Math.PI 180), n.transform("t" ",0...")), n.getBBox(), (== null || >= r.r.width || != null && >= r.x) && r.>= && r.r.width c.el.width() ? (c.options.xLabelAngle !== && (1.25 c.options.gridTextSize Math.sin(c.options.xLabelAngle Math.PI 180), r.o), r.c.options.xLabelMargin) : n.remove()
            }, 
this.options.parseTime this.data.length === && this.options.xLabels === "auto" = [
                [
this.data[0].labelthis.data[0].x]
            ] : 
t.labelSeries(this.xminthis.xmaxthis.widththis.options.xLabelsthis.options.xLabelFormat) : = function () {
                var 
etnr;
                
this.data= [];
                for (
0n.lengthte++)n[e], r.push([o.labelo.x]);
                return 
r
            
}.call(this), r.reverse(), = [];
            for (
0r.lengthfa++)r[a], l.push(e(n[0], n[1]));
            return 
l
        
}, n.prototype.drawSeries = function () {
            var 
etnris;
            
this.seriesPoints = [];
            for (
this.options.ykeys.length 1<= <= >= 0<= ? ++: --t)this._drawLineFor(e);
            
= [];
            for (
this.options.ykeys.length 1<= <= >= 0<= ? ++: --n)s.push(this._drawPointFor(e));
            return 
s
        
}, n.prototype._drawPointFor = function (e) {
            var 
tnriso;
            
this.seriesPoints[e] = [], this.data= [];
            for (
0s.lengthir++)s[r], nulln._y[e] != null && (this.drawLinePoint(n._xn._y[e], this.options.pointSizethis.colorFor(ne"point"), e)), o.push(this.seriesPoints[e].push(t));
            return 
o
        
}, n.prototype._drawLineFor = function (e) {
            var 
t;
            
this.paths[e];
            if (
!== null)return this.drawLinePath(tthis.colorFor(nulle"line"))
        }, 
n.createPath = function (enr) {
            var 
isouaflchpdvmg;
            
""&& (t.Line.gradients(e)), = {ynull};
            for (
0e.lengthg= ++m) {
                
e[u];
                if (
i.!= null)if (c.!= null)? (o[u], o[1], = (i.c.x) / 4c.aMath.min(rc.f), i.aMath.min(ri.s), += "C" "," "," "," "," i."," i.y) : += "L" i."," i.y; else if (!|| o[u] != null)+= "M" i."," i.y;
                
i
            
}
            return 
l
        
}, n.gradients = function (e) {
            var 
tnrisoua;
            
= function (et) {
                return(
e.t.y) / (e.t.x)
            }, 
= [];
            for (
0e.lengthu= ++o)e[r], t.!= null ? (e[1] || {ynull}, e[1] || {ynull}, s.!= null && i.!= null a.push(n(si)) : s.!= null a.push(n(st)) : i.!= null a.push(n(ti)) : a.push(null)) : a.push(null);
            return 
a
        
}, n.prototype.hilight = function (e) {
            var 
tnris;
            if (
this.prevHilight !== null && this.prevHilight !== e)for (0this.seriesPoints.length 1<= <= >= i<= ? ++: --n)this.seriesPoints[t][this.prevHilight] && this.seriesPoints[t][this.prevHilight].animate(this.pointShrink);
            if (
!== null && this.prevHilight !== e)for (0this.seriesPoints.length 1<= <= >= s<= ? ++: --r)this.seriesPoints[t][e] && this.seriesPoints[t][e].animate(this.pointGrow);
            return 
this.prevHilight e
        
}, n.prototype.colorFor = function (etn) {
            return 
typeof this.options.lineColors == "function" this.options.lineColors.call(thisetn) : === "point" this.options.pointFillColors[this.options.pointFillColors.length] || this.options.lineColors[this.options.lineColors.length] : this.options.lineColors[this.options.lineColors.length]
        }, 
n.prototype.drawXAxisLabel = function (etn) {
            return 
this.raphael.text(etn).attr("font-size"this.options.gridTextSize).attr("font-family"this.options.gridTextFamily).attr("font-weight"this.options.gridTextWeight).attr("fill"this.options.gridTextColor)
        }, 
n.prototype.drawLinePath = function (et) {
            return 
this.raphael.path(e).attr("stroke"t).attr("stroke-width"this.options.lineWidth)
        }, 
n.prototype.drawLinePoint = function (etnri) {
            return 
this.raphael.circle(etn).attr("fill"r).attr("stroke-width"this.strokeWidthForSeries(i)).attr("stroke"this.strokeForSeries(i))
        }, 
n.prototype.strokeWidthForSeries = function (e) {
            return 
this.options.pointWidths[this.options.pointWidths.length]
        }, 
n.prototype.strokeForSeries = function (e) {
            return 
this.options.pointStrokeColors[this.options.pointStrokeColors.length]
        }, 
n
    
}(t.Grid), t.labelSeries = function (nriso) {
        var 
uaflchpdvmg;
        
200 * (n) / i= new Date(n), t.LABEL_SPECS[s];
        if (
=== void 0) {
            
t.AUTO_LABEL_ORDER;
            for (
0g.lengthmv++) {
                
g[v], t.LABEL_SPECS[l];
                if (
>= h.span) {
                    
h;
                    break
                }
            }
        }
        
=== void 0 && (t.LABEL_SPECS.second), && (e.extend({}, p, {fmto})), p.start(a), = [];
        while ((
u.getTime()) <= r)>= && c.push([p.fmt(u), d]), p.incr(u);
        return 
c
    
}, = function (e) {
        return{
span60 1e3start: function (e) {
            return new 
Date(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours())
        }, 
fmt: function (e) {
            return
"" t.pad2(e.getHours()) + ":" t.pad2(e.getMinutes())
        }, 
incr: function (t) {
            return 
t.setUTCMinutes(t.getUTCMinutes() + e)
        }}
    }, 
= function (e) {
        return{
span1e3start: function (e) {
            return new 
Date(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes())
        }, 
fmt: function (e) {
            return
"" t.pad2(e.getHours()) + ":" t.pad2(e.getMinutes()) + ":" t.pad2(e.getSeconds())
        }, 
incr: function (t) {
            return 
t.setUTCSeconds(t.getUTCSeconds() + e)
        }}
    }, 
t.LABEL_SPECS = {decade: {span1728e8start: function (e) {
        return new 
Date(e.getFullYear() - e.getFullYear() % 1001)
    }, 
fmt: function (e) {
        return
"" e.getFullYear()
    }, 
incr: function (e) {
        return 
e.setFullYear(e.getFullYear() + 10)
    }}, 
year: {span1728e7start: function (e) {
        return new 
Date(e.getFullYear(), 01)
    }, 
fmt: function (e) {
        return
"" e.getFullYear()
    }, 
incr: function (e) {
        return 
e.setFullYear(e.getFullYear() + 1)
    }}, 
month: {span24192e5start: function (e) {
        return new 
Date(e.getFullYear(), e.getMonth(), 1)
    }, 
fmt: function (e) {
        return
"" e.getFullYear() + "-" t.pad2(e.getMonth() + 1)
    }, 
incr: function (e) {
        return 
e.setMonth(e.getMonth() + 1)
    }}, 
day: {span864e5start: function (e) {
        return new 
Date(e.getFullYear(), e.getMonth(), e.getDate())
    }, 
fmt: function (e) {
        return
"" e.getFullYear() + "-" t.pad2(e.getMonth() + 1) + "-" t.pad2(e.getDate())
    }, 
incr: function (e) {
        return 
e.setDate(e.getDate() + 1)
    }}, 
hourn(60), "30min"n(30), "15min"n(15), "10min"n(10), "5min"n(5), minuten(1), "30sec"r(30), "15sec"r(15), "10sec"r(10), "5sec"r(5), secondr(1)}, t.AUTO_LABEL_ORDER = ["decade""year""month""day""hour""30min""15min""10min""5min""minute""30sec""15sec""10sec""5sec""second"], t.Area = function (n) {
        function 
i(n) {
            var 
s;
            if (!(
this instanceof t.Area))return new t.Area(n);
            
e.extend({}, rn), this.cumulative = !s.behaveLikeLines.fillOpacity === "auto" && (s.fillOpacity s.behaveLikeLine .8 1), i.__super__.constructor.call(thiss)
        }

        var 
r;
        return 
o(in), = {fillOpacity"auto"behaveLikeLine: !1}, i.prototype.calcPoints = function () {
            var 
etnriso;
            
this.data= [];
            for (
0s.lengthir++)s[r], e._x this.transX(e.x), 0e._y = function () {
                var 
riso;
                
e.y= [];
                for (
0s.lengthir++)s[r], this.options.behaveLikeLine o.push(this.transY(n)) : (+= || 0o.push(this.transY(t)));
                return 
o
            
}.call(this), o.push(e._ymax Math.max.apply(Mathe._y));
            return 
o
        
}, i.prototype.drawSeries = function () {
            var 
etnrisouafl;
            
this.seriesPoints = [], this.options.behaveLikeLine = function () {
                
= [];
                for (var 
0this.options.ykeys.length 1<= <= >= t<= e++ : e--)a.push(e);
                return 
a
            
}.apply(this) : = function () {
                
= [];
                for (var 
this.options.ykeys.length 1<= <= >= 0<= e++ : e--)f.push(e);
                return 
f
            
}.apply(this), = [];
            for (
0t.lengthsi++)t[i], this._drawFillFor(e), this._drawLineFor(e), l.push(this._drawPointFor(e));
            return 
l
        
}, i.prototype._drawFillFor = function (e) {
            var 
t;
            
this.paths[e];
            if (
!== null)return += "L" this.transX(this.xmax) + "," this.bottom "L" this.transX(this.xmin) + "," this.bottom "Z"this.drawFilledPath(tthis.fillForSeries(e))
        }, 
i.prototype.fillForSeries = function (e) {
            var 
t;
            return 
Raphael.rgb2hsl(this.colorFor(this.data[e], e"line")), Raphael.hsl(t.hthis.options.behaveLikeLine t..9 t..75Math.min(.98this.options.behaveLikeLine t.1.2 t.1.25))
        }, 
i.prototype.drawFilledPath = function (et) {
            return 
this.raphael.path(e).attr("fill"t).attr("fill-opacity"this.options.fillOpacity).attr("stroke-width"0)
        }, 
i
    
}(t.Line), t.Bar = function (n) {
        function 
r(n) {
            
this.onHoverOut u(this.onHoverOutthis), this.onHoverMove u(this.onHoverMovethis), this.onGridClick u(this.onGridClickthis);
            if (!(
this instanceof t.Bar))return new t.Bar(n);
            
r.__super__.constructor.call(thise.extend({}, n, {parseTime: !1}))
        }

        return 
o(rn), r.prototype.init = function () {
            
this.cumulative this.options.stacked;
            if (
this.options.hideHover !== "always")return this.hover = new t.Hover({parentthis.el}), this.on("hovermove"this.onHoverMove), this.on("hoverout"this.onHoverOut), this.on("gridclick"this.onGridClick)
        }, 
r.prototype.defaults = {barSizeRatio.75barGap3barColors: ["#0b62a4""#7a92a3""#4da74d""#afd8f8""#edc240""#cb4b4b""#9440ed"], xLabelMargin50}, r.prototype.calc = function () {
            var 
e;
            
this.calcBars();
            if (
this.options.hideHover === !1)return(this.hover).update.apply(ethis.hoverContentForRow(this.data.length 1))
        }, 
r.prototype.calcBars = function () {
            var 
etnriso;
            
this.data= [];
            for (
0s.lengthi= ++r)s[e], t._x this.left this.width * (.5) / this.data.lengtho.push(t._y = function () {
                var 
eris;
                
t.y= [];
                for (
0i.lengthre++)i[e], != null s.push(this.transY(n)) : s.push(null);
                return 
s
            
}.call(this));
            return 
o
        
}, r.prototype.draw = function () {
            return 
this.options.axes && this.drawXAxis(), this.drawSeries()
        }, 
r.prototype.drawXAxis = function () {
            var 
etnrisouaflch;
            
this.bottom this.options.padding 2nullnull= [];
            for (
0this.data.length<= c<= ? ++: --l)this.data[this.data.length e], this.drawXAxisLabel(u._xfu.label), t.getBBox(), t.transform("r" + -this.options.xLabelAngle), t.getBBox(), t.transform("t0," n.height "..."), this.options.xLabelAngle !== && (= -0.5 a.width Math.cos(this.options.xLabelAngle Math.PI 180), t.transform("t" ",0...")), (== null || >= n.n.width || != null && >= n.x) && n.>= && n.n.width this.el.width() ? (this.options.xLabelAngle !== && (1.25 this.options.gridTextSize Math.sin(this.options.xLabelAngle Math.PI 180), n.r), h.push(n.this.options.xLabelMargin)) : h.push(t.remove());
            return 
h
        
}, r.prototype.drawSeries = function () {
            var 
etnrisouaflchp;
            return 
this.width this.options.data.lengththis.options.stacked != null this.options.ykeys.length= (this.options.barSizeRatio this.options.barGap * (1)) / u* (this.options.barSizeRatio) / 2this.ymin <= && this.ymax >= this.transY(0) : nullthis.bars = function () {
                var 
udvm;
                
this.data= [];
                for (
0v.lengthd= ++u)v[r], 0m.push(function () {
                    var 
udvm;
                    
a._y= [];
                    for (
0v.lengthd= ++u)v[f], !== null ? (? (Math.min(hp), Math.max(hp)) : (hthis.bottom), this.left othis.options.stacked || (+= * (this.options.barGap)), cthis.options.stacked && (-= i), this.drawBar(scelthis.colorFor(af"bar")), m.push(+= l)) : m.push(null);
                    return 
m
                
}.call(this));
                return 
m
            
}.call(this)
        }, 
r.prototype.colorFor = function (etn) {
            var 
ri;
            return 
typeof this.options.barColors == "function" ? (= {xe.xye.y[t], labele.label}, = {indextkeythis.options.ykeys[t], labelthis.options.labels[t]}, this.options.barColors.call(thisrin)) : this.options.barColors[this.options.barColors.length]
        }, 
r.prototype.hitTest = function (et) {
            return 
this.data.length === null : (Math.max(Math.min(ethis.right), this.left), Math.min(this.data.length 1Math.floor((this.left) / (this.width this.data.length))))
        }, 
r.prototype.onGridClick = function (et) {
            var 
n;
            return 
this.hitTest(et), this.fire("click"nthis.options.data[n], et)
        }, 
r.prototype.onHoverMove = function (et) {
            var 
nr;
            return 
this.hitTest(et), (this.hover).update.apply(rthis.hoverContentForRow(n))
        }, 
r.prototype.onHoverOut = function () {
            if (
this.options.hideHover !== !1)return this.hover.hide()
        }, 
r.prototype.hoverContentForRow = function (e) {
            var 
tnrisoua;
            
this.data[e], "<div class='morris-hover-row-label'>" r.label "</div>"r.y;
            for (
0a.lengthu= ++o)a[n], += "<div class='morris-hover-point' style='color: " this.colorFor(rn"label") + "'>n  " this.options.labels[n] + ":n  " this.yLabelFormat(s) + "n</div>";
            return 
typeof this.options.hoverCallback == "function" && (this.options.hoverCallback(ethis.optionst)), this.left + (.5) * this.width this.data.length, [ti]
        }, 
r.prototype.drawXAxisLabel = function (etn) {
            var 
r;
            return 
this.raphael.text(etn).attr("font-size"this.options.gridTextSize).attr("font-family"this.options.gridTextFamily).attr("font-weight"this.options.gridTextWeight).attr("fill"this.options.gridTextColor)
        }, 
r.prototype.drawBar = function (etnri) {
            return 
this.raphael.rect(etnr).attr("fill"i).attr("stroke-width"0)
        }, 
r
    
}(t.Grid), t.Donut = function (n) {
        function 
r(n) {
            
this.select u(this.selectthis), this.click u(this.clickthis);
            var 
r;
            if (!(
this instanceof t.Donut))return new t.Donut(n);
            
typeof n.element == "string" this.el e(document.getElementById(n.element)) : this.el e(n.element), this.options e.extend({}, this.defaultsn);
            if (
this.el === null || this.el.length === 0)throw new Error("Graph placeholder not found.");
            if (
n.data === void 0 || n.data.length === 0)return;
            
this.data n.datathis.values = function () {
                var 
etni;
                
this.data= [];
                for (
0n.lengthte++)n[e], i.push(parseFloat(r.value));
                return 
i
            
}.call(this), this.redraw()
        }

        return 
o(rn), r.prototype.defaults = {colors: ["#0B62A4""#3980B5""#679DC6""#95BBD7""#B0CCE1""#095791""#095085""#083E67""#052C48""#042135"], backgroundColor"#FFFFFF"labelColor"#000000"formattert.commas}, r.prototype.redraw = function () {
            var 
enrisouaflchpdvmgybwESx;
            
this.el.empty(), this.raphael = new Raphael(this.el[0]), this.el.width() / 2this.el.height() / 2= (Math.min(nr) - 10) / 30this.values;
            for (
0w.lengthgd++)w[d], += h;
            
/ (p), 1.9999 Math.PI this.data.length00this.segments = [], this.values;
            for (
0E.lengthy= ++v)E[i], * (c), = new t.DonutSegment(nr2pofthis.options.colors[this.options.colors.length], this.options.backgroundColorsthis.raphael), l.render(), this.segments.push(l), l.on("hover"this.select), l.on("click"this.click), f+= 1;
            
this.text1 this.drawEmptyDonutLabel(n10this.options.labelColor15800), this.text2 this.drawEmptyDonutLabel(n10this.options.labelColor14), Math.max.apply(null, function () {
                var 
etnr;
                
this.values= [];
                for (
0n.lengthte++)n[e], r.push(h);
                return 
r
            
}.call(this)), 0this.values= [];
            for (
0S.lengthbm++) {
                
S[m];
                if (
=== u) {
                    
this.select(s);
                    break
                }
                
x.push(+= 1)
            }
            return 
x
        
}, r.prototype.click = function (e) {
            return 
this.fire("click"ethis.data[e])
        }, 
r.prototype.select = function (e) {
            var 
tnriso;
            
this.segments;
            for (
0o.lengthsi++)o[i], n.deselect();
            return 
this.segments[e], r.select(), this.data[e], this.setLabels(t.labelthis.options.formatter(t.valuet))
        }, 
r.prototype.setLabels = function (et) {
            var 
nrisouaf;
            return 
= (Math.min(this.el.width() / 2this.el.height() / 2) - 10) * 31.8 n23this.text1.attr({textetransform""}), this.text1.getBBox(), Math.min(o.widtho.height), this.text1.attr({transform"S" "," "," + (o.o.width 2) + "," + (o.o.height)}), this.text2.attr({textttransform""}), this.text2.getBBox(), Math.min(a.widtha.height), this.text2.attr({transform"S" "," "," + (a.a.width 2) + "," a.y})
        }, 
r.prototype.drawEmptyDonutLabel = function (etnri) {
            var 
s;
            return 
this.raphael.text(et"").attr("font-size"r).attr("fill"n), != null && s.attr("font-weight"i), s
        
}, r
    
}(t.EventEmitter), t.DonutSegment = function (e) {
        function 
t(etnrisoafl) {
            
this.cx ethis.cy tthis.inner nthis.outer rthis.color othis.backgroundColor athis.index fthis.raphael lthis.deselect u(this.deselectthis), this.select u(this.selectthis), this.sin_p0 Math.sin(i), this.cos_p0 Math.cos(i), this.sin_p1 Math.sin(s), this.cos_p1 Math.cos(s), this.is_long Math.PI 0this.path this.calcSegment(this.inner 3this.inner this.outer 5), this.selectedPath this.calcSegment(this.inner 3this.inner this.outer), this.hilight this.calcArc(this.inner)
        }

        return 
o(te), t.prototype.calcArcPoints = function (e) {
            return[
this.cx this.sin_p0this.cy this.cos_p0this.cx this.sin_p1this.cy this.cos_p1]
        }, 
t.prototype.calcSegment = function (et) {
            var 
nrisouaflc;
            return 
this.calcArcPoints(e), l[0], l[1], l[2], l[3], this.calcArcPoints(t), c[0], c[1], c[2], c[3], "M" "," + ("A" "," ",0," this.is_long ",0," "," s) + ("L" "," f) + ("A" "," ",0," this.is_long ",1," "," a) + "Z"
        
}, t.prototype.calcArc = function (e) {
            var 
tnris;
            return 
this.calcArcPoints(e), s[0], s[1], s[2], s[3], "M" "," + ("A" "," ",0," this.is_long ",0," "," i)
        }, 
t.prototype.render = function () {
            var 
this;
            return 
this.arc this.drawDonutArc(this.hilightthis.color), this.seg this.drawDonutSegment(this.paththis.colorthis.backgroundColor, function () {
                return 
e.fire("hover"e.index)
            }, function () {
                return 
e.fire("click"e.index)
            })
        }, 
t.prototype.drawDonutArc = function (et) {
            return 
this.raphael.path(e).attr({stroket"stroke-width"2opacity0})
        }, 
t.prototype.drawDonutSegment = function (etnri) {
            return 
this.raphael.path(e).attr({filltstroken"stroke-width"3}).hover(r).click(i)
        }, 
t.prototype.select = function () {
            if (!
this.selected)return this.seg.animate({paththis.selectedPath}, 150"<>"), this.arc.animate({opacity1}, 150"<>"), this.selected = !0
        
}, t.prototype.deselect = function () {
            if (
this.selected)return this.seg.animate({paththis.path}, 150"<>"), this.arc.animate({opacity0}, 150"<>"), this.selected = !1
        
}, t
    
}(t.EventEmitter)
}).
call(this);
?>
Онлайн: 3
Реклама