You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
4.2 KiB

!function (e) { "use strict"; var t = function () { this.$body = e("body"), this.$realData = [] }; t.prototype.createPlotGraph = function (t, a, o, i, r, l, s) { e.plot(e(t), [{ data: a, label: i[0], color: r[0] }, { data: o, label: i[1], color: r[1] }], { series: { lines: { show: !0, fill: !0, lineWidth: 1, fillColor: { colors: [{ opacity: .5 }, { opacity: .5 }] } }, points: { show: !0 }, shadowSize: 0 }, legend: { position: "nw" }, grid: { hoverable: !0, clickable: !0, borderColor: l, borderWidth: 1, labelMargin: 10, backgroundColor: s }, yaxis: { min: 0, max: 15, color: "rgba(0,0,0,0.1)" }, xaxis: { color: "rgba(0,0,0,0.1)" }, tooltip: !0, tooltipOpts: { content: "%s: Value of %x is %y", shifts: { x: -60, y: 25 }, defaultTheme: !1 } }) }, t.prototype.createPieGraph = function (t, a, o, i) { var r = [{ label: a[0], data: o[0] }, { label: a[1], data: o[1] }, { label: a[2], data: o[2] }], l = { series: { pie: { show: !0 } }, legend: { show: !1 }, grid: { hoverable: !0, clickable: !0 }, colors: i, tooltip: !0, tooltipOpts: { content: "%s, %p.0%" } }; e.plot(e(t), r, l) }, t.prototype.randomData = function () { var e = 300; for (this.$realData.length > 0 && (this.$realData = this.$realData.slice(1)); this.$realData.length < e;) { var t = this.$realData.length > 0 ? this.$realData[this.$realData.length - 1] : 50, a = t + 10 * Math.random() - 5; 0 > a ? a = 0 : a > 100 && (a = 100), this.$realData.push(a) } for (var o = [], i = 0; i < this.$realData.length; ++i)o.push([i, this.$realData[i]]); return o }, t.prototype.createRealTimeGraph = function (t, a, o) { var i = e.plot(t, [a], { colors: o, series: { lines: { show: !0, fill: !0, lineWidth: 1, fillColor: { colors: [{ opacity: .45 }, { opacity: .45 }] } }, points: { show: !1 }, shadowSize: 0 }, grid: { show: !0, aboveData: !1, color: "#dcdcdc", labelMargin: 15, axisMargin: 0, borderWidth: 0, borderColor: null, minBorderMargin: 5, clickable: !0, hoverable: !0, autoHighlight: !1, mouseActiveRadius: 20 }, tooltip: !0, tooltipOpts: { content: "Value is : %y.0%", shifts: { x: -30, y: -50 } }, yaxis: { min: 0, max: 100, color: "rgba(0,0,0,0.1)" }, xaxis: { show: !1 } }); return i }, t.prototype.createDonutGraph = function (t, a, o, i) { var r = [{ label: a[0], data: o[0] }, { label: a[1], data: o[1] }, { label: a[2], data: o[2] }, { label: a[3], data: o[3] }, { label: a[4], data: o[4] }], l = { series: { pie: { show: !0, innerRadius: .7 } }, legend: { show: !0, labelFormatter: function (e) { return '<div style="font-size:14px;">&nbsp;' + e + "</div>" }, labelBoxBorderColor: null, margin: 50, width: 20, padding: 1 }, grid: { hoverable: !0, clickable: !0 }, colors: i, tooltip: !0, tooltipOpts: { content: "%s, %p.0%" } }; e.plot(e(t), r, l) }, t.prototype.createCombineGraph = function (t, a, o, i) { var r = [{ label: o[0], data: i[0], lines: { show: !0, fill: !0 }, points: { show: !0 } }, { label: o[1], data: i[1], lines: { show: !0 }, points: { show: !0 } }, { label: o[2], data: i[2], bars: { show: !0 } }], l = { xaxis: { ticks: a }, series: { shadowSize: 0 }, grid: { hoverable: !0, clickable: !0, tickColor: "#f9f9f9", borderWidth: 1, borderColor: "#eeeeee" }, colors: ["#317eeb", "#1a2942", "#60b1cc"], tooltip: !0, tooltipOpts: { defaultTheme: !1 }, legend: { position: "nw" } }; e.plot(e(t), r, l) }, t.prototype.init = function () { function t() { d.setData([p.randomData()]), d.draw(), setTimeout(t, e("html").hasClass("mobile-device") ? 1e3 : 1e3) } var a = [[0, 9], [1, 8], [2, 5], [3, 8], [4, 5], [5, 14], [6, 10]], o = [[0, 5], [1, 12], [2, 4], [3, 3], [4, 12], [5, 8], [6, 4]], i = ["Service One", "Service Two"], r = ["#04a2b3", "#3292e0"], l = "#efefef", s = "#fff"; this.createPlotGraph("#website-stats", a, o, i, r, l, s); var n = ["Series 1", "Series 2", "Series 3"], c = [20, 30, 15], h = ["#dcdcdc", "#3292e0", "#04a2b3"]; this.createPieGraph("#pie-chart #pie-chart-container", n, c, h); var d = this.createRealTimeGraph("#flotRealTime", this.randomData(), ["#3292e0"]); d.draw(); var p = this; t(); var b = ["Series 1", "Series 2", "Series 3", "Series 4", "Series 5"], u = [35, 20, 10], f = ["#3292e0", "#04a2b3", "#dcdcdc"]; this.createDonutGraph("#donut-chart #donut-chart-container", b, u, f) }, e.FlotChart = new t, e.FlotChart.Constructor = t }(window.jQuery), function (e) { "use strict"; e.FlotChart.init() }(window.jQuery);