"use strict";var sparklineDemo={init:function(){this.bindUIActions()},bindUIActions:function(){this.lineChart(),this.barChart(),this.compositeLineChart(),this.normalRangeChart(),this.compositeChart(),this.discreteChart(),this.lineCustomChart(),this.tristateChart(),this.plotChart(),this.bulletChart(),this.pieChart(),this.drawMouseSpeed()},colors:function(){return{red:"#B76BA3",orange:"#EC935E",yellow:"#F7C46C",green:"#A7C796",teal:"#00A28A",blue:"#346CB0",purple:"#5F4B8B",gray:"#BEC1C4",grayLight:"#D4D5D7",grayLighter:"#F5F5F5"}},getColor:function(o){return this.colors()[o]},lineChart:function(){$(".sparkline").sparkline("html",{lineColor:this.getColor("teal"),fillColor:"#E0F8F4"})},barChart:function(){$(".sparkbar").sparkline("html",{type:"bar",barColor:this.getColor("teal"),negBarColor:this.getColor("red"),stackedBarColor:[this.getColor("teal"),this.getColor("purple"),this.getColor("blue"),this.getColor("yellow")]})},compositeLineChart:function(){$("#compositeline").sparkline("html",{fillColor:!1,changeRangeMin:0,chartRangeMax:10,lineColor:this.getColor("teal")}),$("#compositeline").sparkline([4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7],{composite:!0,fillColor:!1,lineColor:this.getColor("red"),changeRangeMin:0,chartRangeMax:10})},normalRangeChart:function(){$("#normalline").sparkline("html",{fillColor:!1,normalRangeMin:-1,normalRangeMax:8,lineColor:this.getColor("teal"),normalRangeColor:this.getColor("grayLighter")}),$("#normalExample").sparkline("html",{fillColor:!1,normalRangeMin:80,normalRangeMax:95,normalRangeColor:this.getColor("orange")})},compositeChart:function(){$("#compositebar").sparkline("html",{type:"bar",barColor:this.getColor("teal")}),$("#compositebar").sparkline([4,1,5,7,9,9,8,7,6,6,4,7,8,4,3,2,2,5,6,7],{composite:!0,fillColor:!1,lineColor:this.getColor("red")})},discreteChart:function(){$(".discrete1").sparkline("html",{type:"discrete",lineColor:this.getColor("blue"),xwidth:18}),$("#discrete2").sparkline("html",{type:"discrete",lineColor:this.getColor("blue"),thresholdColor:this.getColor("red"),thresholdValue:4})},lineCustomChart:function(){$("#linecustom").sparkline("html",{height:"1.5em",width:"8em",lineColor:this.getColor("teal"),fillColor:"#E7F6F4",minSpotColor:!1,maxSpotColor:!1,spotColor:this.getColor("yellow"),spotRadius:3})},tristateChart:function(){$(".sparktristate").sparkline("html",{type:"tristate",posBarColor:this.getColor("teal"),negBarColor:this.getColor("red")}),$(".sparktristatecols").sparkline("html",{type:"tristate",colorMap:{"-2":this.getColor("red"),"-1":this.getColor("yellow"),0:this.getColor("purple"),1:this.getColor("teal"),2:this.getColor("blue")}})},plotChart:function(){$(".sparkboxplot").sparkline("html",{type:"box",lineColor:this.getColor("purple"),boxLineColor:this.getColor("purple"),whiskerColor:this.getColor("gray"),outlierLineColor:this.getColor("gray"),outlierFillColor:this.getColor("grayLight"),medianColor:this.getColor("red"),targetColor:this.getColor("yellow")}),$(".sparkboxplotraw").sparkline([1,3,5,8,10,15,18],{type:"box",raw:!0,showOutliers:!0,target:6,lineColor:this.getColor("blue"),boxLineColor:this.getColor("blue"),whiskerColor:this.getColor("gray"),outlierLineColor:this.getColor("gray"),outlierFillColor:this.getColor("grayLighter"),medianColor:this.getColor("red"),targetColor:this.getColor("yellow")})},bulletChart:function(){$(".sparkbullet").sparkline("html",{type:"bullet",targetColor:this.getColor("red"),performanceColor:this.getColor("teal"),rangeColors:["#C0F0E8","#A1E9DD","#82E2D2"]})},pieChart:function(){$(".sparkpie").sparkline("html",{type:"pie",height:"1.0em",sliceColors:[this.getColor("purple"),this.getColor("teal"),this.getColor("blue"),this.getColor("yellow")]})},drawMouseSpeed:function(){var l=this,r=-1,i=-1,a=void 0,s=0,n=[];$("html").mousemove(function(o){var t=o.pageX,e=o.pageY;-1<r&&(s+=Math.max(Math.abs(t-r),Math.abs(e-i))),r=t,i=e});setTimeout(function o(){var t=(new Date).getTime();if(a&&a!=t){var e=Math.round(s/(t-a)*1e3);n.push(e),30<n.length&&n.splice(0,1),s=0,$("#mousespeed").sparkline(n,{width:2*n.length,tooltipSuffix:" pixels per second",lineColor:l.getColor("teal"),fillColor:"#E0F8F4"})}a=t,setTimeout(o,500)},500)}};sparklineDemo.init();