/*
 *  Document   : uiWidgets.js
 *  Author     : pixelcave
 */
var UiWidgets=function(){return{init:function(){var o={type:"line",width:"200px",height:"120px",tooltipOffsetX:-25,tooltipOffsetY:20,lineColor:"#afde5c",fillColor:"#afde5c",spotColor:"#555555",minSpotColor:"#555555",maxSpotColor:"#555555",highlightSpotColor:"#555555",highlightLineColor:"#555555",spotRadius:3,tooltipPrefix:"",tooltipSuffix:" Sales",tooltipFormat:"{{prefix}}{{y}}{{suffix}}"};$("#widget-chart-sales").sparkline("html",o),o.lineColor="#5cadde",o.fillColor="#5cadde",o.tooltipPrefix="",o.tooltipSuffix=" Tickets",$("#widget-chart-tickets").sparkline("html",o);var t={type:"bar",barWidth:10,barSpacing:7,height:"120px",tooltipOffsetX:-25,tooltipOffsetY:20,barColor:"#de815c",tooltipPrefix:"$ ",tooltipSuffix:"",tooltipFormat:"{{prefix}}{{value}}{{suffix}}"};$("#widget-chart-earnings").sparkline("html",t);var i=$("#widget-chart-classic"),l=$("#widget-chart-pie"),a=[[1,1900],[2,2300],[3,3200],[4,2500],[5,4200],[6,3100],[7,3600],[8,2500],[9,4600],[10,3700],[11,4200],[12,5200]],e=[[1,850],[2,750],[3,1500],[4,900],[5,1500],[6,1150],[7,1500],[8,900],[9,1800],[10,1700],[11,1900],[12,2550]],r=[[1,130],[2,330],[3,220],[4,350],[5,150],[6,275],[7,280],[8,380],[9,120],[10,330],[11,190],[12,410]],s=[[1,"Jan"],[2,"Feb"],[3,"Mar"],[4,"Apr"],[5,"May"],[6,"Jun"],[7,"Jul"],[8,"Aug"],[9,"Sep"],[10,"Oct"],[11,"Nov"],[12,"Dec"]];$.plot(i,[{label:"Earnings",data:a,lines:{show:!0,fill:!0,fillColor:{colors:[{opacity:.6},{opacity:.6}]}},points:{show:!0,radius:5}},{label:"Sales",data:e,lines:{show:!0,fill:!0,fillColor:{colors:[{opacity:.2},{opacity:.2}]}},points:{show:!0,radius:5}},{label:"Tickets",data:r,lines:{show:!0,fill:!0,fillColor:{colors:[{opacity:.2},{opacity:.2}]}},points:{show:!0,radius:5}}],{colors:["#5ccdde","#454e59","#ffffff"],legend:{show:!0,position:"nw",backgroundOpacity:0},grid:{borderWidth:0,hoverable:!0,clickable:!0},yaxis:{tickColor:"#f5f5f5",ticks:3},xaxis:{ticks:s,tickColor:"#f5f5f5"}});var c=null,p=null;i.bind("plothover",function(o,t,i){if(i){if(c!==i.dataIndex){c=i.dataIndex,$("#chart-tooltip").remove();var l=(i.datapoint[0],i.datapoint[1]);p=0===i.seriesIndex?"$ <strong>"+l+"</strong>":1===i.seriesIndex?"<strong>"+l+"</strong> sales":"<strong>"+l+"</strong> tickets",$('<div id="chart-tooltip" class="chart-tooltip">'+p+"</div>").css({top:i.pageY-45,left:i.pageX+5}).appendTo("body").show()}}else $("#chart-tooltip").remove(),c=null}),$.plot(l,[{label:"Sales",data:30},{label:"Tickets",data:10},{label:"Earnings",data:60}],{colors:["#454e59","#5cafde","#5ccdde"],legend:{show:!1},series:{pie:{show:!0,radius:1,label:{show:!0,radius:2/3,formatter:function(o,t){return'<div class="chart-pie-label">'+o+"<br>"+Math.round(t.percent)+"%</div>"},background:{opacity:.75,color:"#000000"}}}}})}}}();