/**
 * Theme: Adminox Admin Template
 * Author: Coderthemes
 * Module/App: Flot-Chart
 */

!function(o){"use strict"
var a=function(){this.$body=o("body"),this.$realData=[]}
a.prototype.createPlotGraph=function(a,t,e,r,l,i,s,n){o.plot(o(a),[{data:t,label:l[0],color:i[0]},{data:e,label:l[1],color:i[1]},{data:r,label:l[2],color:i[2]}],{series:{lines:{show:!0,fill:!0,lineWidth:2,fillColor:{colors:[{opacity:.3},{opacity:.3},{opacity:.3}]}},points:{show:!0},shadowSize:0},grid:{hoverable:!0,clickable:!0,borderColor:s,tickColor:"#f9f9f9",borderWidth:1,labelMargin:30,backgroundColor:n},legend:{position:"ne",margin:[0,-32],noColumns:0,labelBoxBorderColor:null,labelFormatter:function(o,a){return""+o+"&nbsp;&nbsp;"},width:30,height:2},yaxis:{axisLabel:"Daily Visits",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},xaxis:{axisLabel:"Last Days",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},tooltip:!0,tooltipOpts:{content:"%s: Value of %x is %y",shifts:{x:-60,y:25},defaultTheme:!1},splines:{show:!0,tension:.1,lineWidth:1}})},a.prototype.createPlotDotGraph=function(a,t,e,r,l,i,s){o.plot(o(a),[{data:t,label:r[0],color:l[0]},{data:e,label:r[1],color:l[1]}],{series:{lines:{show:!0,fill:!1,lineWidth:3,fillColor:{colors:[{opacity:.3},{opacity:.3}]}},curvedLines:{apply:!0,active:!0,monotonicFit:!0},splines:{show:!0,tension:.4,lineWidth:5,fill:.4}},grid:{hoverable:!0,clickable:!0,borderColor:i,tickColor:"#f9f9f9",borderWidth:1,labelMargin:10,backgroundColor:s},legend:{position:"ne",margin:[0,-32],noColumns:0,labelBoxBorderColor:null,labelFormatter:function(o,a){return""+o+"&nbsp;&nbsp;"},width:30,height:2},yaxis:{axisLabel:"Gold Price(USD)",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},xaxis:{axisLabel:"Numbers",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},tooltip:!1})},a.prototype.createPieGraph=function(a,t,e,r){var l=[{label:t[0],data:e[0]},{label:t[1],data:e[1]},{label:t[2],data:e[2]},{label:t[3],data:e[3]}],i={series:{pie:{show:!0,radius:1,label:{show:!0,radius:1,background:{opacity:.2}}}},legend:{show:!1},grid:{hoverable:!0,clickable:!0},colors:r,tooltip:!0,tooltipOpts:{content:"%s, %p.0%"}}
o.plot(o(a),l,i)},a.prototype.randomData=function(){var o=300
for(this.$realData.length>0&&(this.$realData=this.$realData.slice(1));this.$realData.length<o;){var a=this.$realData.length>0?this.$realData[this.$realData.length-1]:50,t=a+10*Math.random()-5
0>t?t=0:t>100&&(t=100),this.$realData.push(t)}for(var e=[],r=0;r<this.$realData.length;++r)e.push([r,this.$realData[r]])
return e},a.prototype.createRealTimeGraph=function(a,t,e){var r=o.plot(a,[t],{colors:e,series:{grow:{active:!1},shadowSize:0,lines:{show:!0,fill:!0,lineWidth:2,steps:!1}},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:{axisLabel:"Response Time (ms)",min:0,max:100,tickColor:"#f5f5f5",color:"rgba(0,0,0,0.1)"},xaxis:{axisLabel:"Point Value (1000)",show:!0,tickColor:"#f5f5f5"}})
return r},a.prototype.createDonutGraph=function(a,t,e,r){var l=[{label:t[0],data:e[0]},{label:t[1],data:e[1]},{label:t[2],data:e[2]},{label:t[3],data:e[3]}],i={series:{pie:{show:!0,innerRadius:.7}},legend:{show:!0,labelFormatter:function(o,a){return'<div style="font-size:14px;">&nbsp;'+o+"</div>"},labelBoxBorderColor:null,margin:50,width:20},grid:{hoverable:!0,clickable:!0},colors:r,tooltip:!0,tooltipOpts:{content:"%s, %p.0%"}}
o.plot(o(a),l,i)},a.prototype.createStackBarGraph=function(a,t,e,r){var l={bars:{show:!0,barWidth:.2,fill:1},grid:{show:!0,aboveData:!1,labelMargin:5,axisMargin:0,borderWidth:1,minBorderMargin:5,clickable:!0,hoverable:!0,autoHighlight:!1,mouseActiveRadius:20,borderColor:"#f5f5f5"},series:{stack:0},legend:{position:"ne",margin:[0,-32],noColumns:0,labelBoxBorderColor:null,labelFormatter:function(o,a){return""+o+"&nbsp;&nbsp;"},width:30,height:2},yaxis:t.y,xaxis:t.x,colors:e,tooltip:!0,tooltipOpts:{content:"%s : %y.0",shifts:{x:-30,y:-50}}}
o.plot(o(a),r,l)},a.prototype.createLineGraph=function(a,t,e,r){var l={series:{lines:{show:!0},points:{show:!0}},legend:{position:"ne",margin:[0,-32],noColumns:0,labelBoxBorderColor:null,labelFormatter:function(o,a){return""+o+"&nbsp;&nbsp;"},width:30,height:2},yaxis:t.y,xaxis:t.x,colors:e,grid:{hoverable:!0,borderColor:"#f5f5f5",borderWidth:1,backgroundColor:"#fff"},tooltip:!0,tooltipOpts:{content:"%s : %y.0",shifts:{x:-30,y:-50}}}
return o.plot(o(a),r,l)},a.prototype.createCombineGraph=function(a,t,e,r){var l=[{label:e[0],data:r[0],lines:{show:!0,fill:!0},points:{show:!0}},{label:e[1],data:r[1],lines:{show:!0},points:{show:!0}},{label:e[2],data:r[2],bars:{show:!0}}],i={series:{shadowSize:0},grid:{hoverable:!0,clickable:!0,tickColor:"#f9f9f9",borderWidth:1,borderColor:"#eeeeee"},colors:["#4489e4","#78c350","#f18f1c"],tooltip:!0,tooltipOpts:{defaultTheme:!1},legend:{position:"ne",margin:[0,-32],noColumns:0,labelBoxBorderColor:null,labelFormatter:function(o,a){return""+o+"&nbsp;&nbsp;"},width:30,height:2},yaxis:{axisLabel:"Point Value (1000)",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},xaxis:{axisLabel:"Daily Hours",ticks:t,tickColor:"#f5f5f5",font:{color:"#bdbdbd"}}}
o.plot(o(a),l,i)},a.prototype.init=function(){function a(){x.setData([y.randomData()]),x.draw(),setTimeout(a,(o("html").hasClass("mobile-device"),500))}var t=[[0,13],[1,13],[2,14],[3,17],[4,13],[5,10],[6,12],[7,13],[8,12],[9,20],[10,18],[11,16],[12,14]],e=[[0,8],[1,10],[2,12],[3,14],[4,11],[5,7],[6,9],[7,10],[8,9],[9,17],[10,15],[11,13],[12,11]],r=[[0,3],[1,6],[2,8],[3,10],[4,7],[5,3],[6,5],[7,7],[8,6],[9,14],[10,12],[11,10],[12,8]],l=["Google","Yahoo","Facebook"],i=["#4489e4","#78c350","#f18f1c"],s="#f5f5f5",n="#fff"
this.createPlotGraph("#website-stats",t,e,r,l,i,s,n)
var h=[[0,2],[1,4],[2,7],[3,9],[4,6],[5,3],[6,10],[7,8],[8,5],[9,14],[10,10],[11,10],[12,8]],d=[[0,1],[1,3],[2,6],[3,7],[4,4],[5,2],[6,8],[7,6],[8,4],[9,10],[10,8],[11,14],[12,5]],b=["Visits","Page views"],c=["#34bd25","#ff4433"],f="#f5f5f5",p="#fff"
this.createPlotDotGraph("#website-stats1",h,d,b,c,f,p)
var u=["Mobile Phones","iPhone 7","iMac","Macbook"],g=[20,30,15,32],m=["#47dea3","#23d0ea","#fb6d9d","#3f4958"]
this.createPieGraph("#pie-chart #pie-chart-container",u,g,m)
var x=this.createRealTimeGraph("#flotRealTime",this.randomData(),["#64c5b1"])
x.draw()
var y=this
a()
var C=["Mobile Phones","iPhone 7","iMac","Macbook"],w=[35,20,10,20],v=["#60befc","#6248ff","#e3b0db","#dbdbdb"]
this.createDonutGraph("#donut-chart #donut-chart-container",C,w,v)
var k=[[0,201],[1,520],[2,337],[3,261],[4,157],[5,95],[6,200],[7,250],[8,320],[9,500],[10,152],[11,214],[12,364],[13,449],[14,558],[15,282],[16,379],[17,429],[18,518],[19,470],[20,330],[21,245],[22,358],[23,74]],D=[[0,311],[1,630],[2,447],[3,371],[4,267],[5,205],[6,310],[7,360],[8,430],[9,610],[10,262],[11,324],[12,474],[13,559],[14,668],[15,392],[16,489],[17,539],[18,628],[19,580],[20,440],[21,355],[22,468],[23,184]],M=[[23,727],[22,128],[21,110],[20,92],[19,172],[18,63],[17,150],[16,592],[15,12],[14,246],[13,52],[12,149],[11,123],[10,2],[9,325],[8,10],[7,15],[6,89],[5,65],[4,77],[3,600],[2,200],[1,385],[0,200]],G=[[0,"22h"],[1,""],[2,"00h"],[3,""],[4,"02h"],[5,""],[6,"04h"],[7,""],[8,"06h"],[9,""],[10,"08h"],[11,""],[12,"10h"],[13,""],[14,"12h"],[15,""],[16,"14h"],[17,""],[18,"16h"],[19,""],[20,"18h"],[21,""],[22,"20h"],[23,""]],L=["Last 24 Hours","Last 48 Hours","Difference"],B=[k,D,M]
this.createCombineGraph("#combine-chart #combine-chart-container",G,L,B)
for(var P={y:{axisLabel:"Sales Value (USD)",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},x:{axisLabel:"Last 10 Days",tickColor:"#f5f5f5",font:{color:"#bdbdbd"}}},W=[],$=0;10>=$;$+=1)W.push([$,parseInt(30*Math.random())])
for(var F=[],$=0;10>=$;$+=1)F.push([$,parseInt(30*Math.random())])
for(var S=[],$=0;10>=$;$+=1)S.push([$,parseInt(30*Math.random())])
var T=[]
T.push({label:"Series One",data:W,bars:{order:3}}),T.push({label:"Series Two",data:F,bars:{order:2}}),T.push({label:"Series Three",data:S,bars:{order:1}}),this.createStackBarGraph("#ordered-bars-chart",P,["#23d0ea","#3f4958","#ebeff2"],T)
for(var O={y:{min:-1.2,max:1.2,tickColor:"#f5f5f5",font:{color:"#bdbdbd"}},x:{tickColor:"#f5f5f5",font:{color:"#bdbdbd"}}},R=[],V=[],H=0,$=0;12>$;$+=.2)R.push([$,Math.sin($+H)]),V.push([$,Math.cos($+H)])
var z=[{data:R,label:"Google"},{data:V,label:"Yahoo"}]
this.createLineGraph("#line-chart-alt",O,["#f5707a","#188ae2"],z)},o.FlotChart=new a,o.FlotChart.Constructor=a}(window.jQuery),function(o){"use strict"
o.FlotChart.init()}(window.jQuery)