pos-gis/public/assets/js/pages/features/charts/flotcharts.min.js

1 line
8.5 KiB
JavaScript
Raw Permalink Normal View History

2024-10-07 06:13:42 +00:00
"use strict";var KTFlotchartsDemo=function(){var e=function(){function e(){return Math.floor(21*Math.random())+20}var t=[[1,e()],[2,e()],[3,2+e()],[4,3+e()],[5,5+e()],[6,10+e()],[7,15+e()],[8,20+e()],[9,25+e()],[10,30+e()],[11,35+e()],[12,25+e()],[13,15+e()],[14,20+e()],[15,45+e()],[16,50+e()],[17,65+e()],[18,70+e()],[19,85+e()],[20,80+e()],[21,75+e()],[22,80+e()],[23,75+e()],[24,70+e()],[25,65+e()],[26,75+e()],[27,80+e()],[28,85+e()],[29,90+e()],[30,95+e()]],o=[[1,e()-5],[2,e()-5],[3,e()-5],[4,6+e()],[5,5+e()],[6,20+e()],[7,25+e()],[8,36+e()],[9,26+e()],[10,38+e()],[11,39+e()],[12,50+e()],[13,51+e()],[14,12+e()],[15,13+e()],[16,14+e()],[17,15+e()],[18,15+e()],[19,16+e()],[20,17+e()],[21,18+e()],[22,19+e()],[23,20+e()],[24,21+e()],[25,14+e()],[26,24+e()],[27,25+e()],[28,26+e()],[29,27+e()],[30,31+e()]];$.plot($("#kt_flotcharts_2"),[{data:t,label:"Unique Visits",lines:{lineWidth:1},shadowSize:0},{data:o,label:"Page Views",lines:{lineWidth:1},shadowSize:0}],{series:{lines:{show:!0,lineWidth:2,fill:!0,fillColor:{colors:[{opacity:.05},{opacity:.01}]}},points:{show:!0,radius:3,lineWidth:1},shadowSize:2},grid:{hoverable:!0,clickable:!0,tickColor:"#eee",borderColor:"#eee",borderWidth:1},colors:[KTApp.getSettings().colors.theme.base.primary,KTApp.getSettings().colors.theme.base.danger],xaxis:{ticks:11,tickDecimals:0,tickColor:"#eee"},yaxis:{ticks:11,tickDecimals:0,tickColor:"#eee"}});var a=null;$("#chart_2").bind("plothover",function(e,t,o){if($("#x").text(t.x.toFixed(2)),$("#y").text(t.y.toFixed(2)),o){if(a!=o.dataIndex){a=o.dataIndex,$("#tooltip").remove();var i=o.datapoint[0].toFixed(2),s=o.datapoint[1].toFixed(2);!function(e,t,o){$('<div id="tooltip">'+o+"</div>").css({position:"absolute",display:"none",top:t+5,left:e+15,border:"1px solid #333",padding:"4px",color:"#fff","border-radius":"3px","background-color":"#333",opacity:.8}).appendTo("body").fadeIn(200)}(o.pageX,o.pageY,o.series.label+" of "+i+" = "+s)}}else $("#tooltip").remove(),a=null})};return{init:function(){var t,o;!function(){for(var e=[],t=0;t<2*Math.PI;t+=.25)e.push([t,Math.sin(t)]);var o=[];for(t=0;t<2*Math.PI;t+=.25)o.push([t,Math.cos(t)]);var a=[];for(t=0;t<2*Math.PI;t+=.1)a.push([t,Math.tan(t)]);$.plot($("#kt_flotcharts_1"),[{label:"sin(x)",data:e,lines:{lineWidth:1},shadowSize:0},{label:"cos(x)",data:o,lines:{lineWidth:1},shadowSize:0},{label:"tan(x)",data:a,lines:{lineWidth:1},shadowSize:0}],{colors:[KTApp.getSettings().colors.theme.base.success,KTApp.getSettings().colors.theme.base.primary,KTApp.getSettings().colors.theme.base.danger],series:{lines:{show:!0},points:{show:!0,fill:!0,radius:3,lineWidth:1}},xaxis:{tickColor:"#eee",ticks:[0,[Math.PI/2,"π/2"],[Math.PI,"π"],[3*Math.PI/2,"3π/2"],[2*Math.PI,"2π"]]},yaxis:{tickColor:"#eee",ticks:10,min:-2,max:2},grid:{borderColor:"#eee",borderWidth:1}})}(),e(),function(){for(var e=[],t=[],o=0;o<14;o+=.1)e.push([o,Math.sin(o)]),t.push([o,Math.cos(o)]);var a=$.plot($("#kt_flotcharts_3"),[{data:e,label:"sin(x) = -0.00",lines:{lineWidth:1},shadowSize:0},{data:t,label:"cos(x) = -0.00",lines:{lineWidth:1},shadowSize:0}],{colors:[KTApp.getSettings().colors.theme.base.primary,KTApp.getSettings().colors.theme.base.warning],series:{lines:{show:!0}},crosshair:{mode:"x"},grid:{hoverable:!0,autoHighlight:!1,tickColor:"#eee",borderColor:"#eee",borderWidth:1},yaxis:{min:-1.2,max:1.2}}),i=$("#kt_flotcharts_3 .legendLabel");i.each(function(){$(this).css("width",$(this).width())});var s=null,r=null;function l(){s=null;var e=r,t=a.getAxes();if(!(e.x<t.xaxis.min||e.x>t.xaxis.max||e.y<t.yaxis.min||e.y>t.yaxis.max)){var o,l,n=a.getData();for(o=0;o<n.length;++o){var c=n[o];for(l=0;l<c.data.length&&!(c.data[l][0]>e.x);++l);var h,d=c.data[l-1],p=c.data[l];h=null==d?p[1]:null==p?d[1]:d[1]+(p[1]-d[1])*(e.x-d[0])/(p[0]-d[0]),i.eq(o).text(c.label.replace(/=.*/,"= "+h.toFixed(2)))}}}$("#kt_flotcharts_3").bind("plothover",function(e,t,o){r=t,s||(s=setTimeout(l,50))})}(),function(){var e=[],t=250;function o(){for(e.length>0&&(e=e.slice(1));e.length<t;){var o=(e.length>0?e[e.length-1]:50)+10*Math.random()-5;o<0&&(o=0),o>100&&(o=100),e.push