%PDF- %PDF-
Direktori : /home/opti/workflow/src/public/app-assets/js/scripts/charts/echarts/advance/ |
Current File : /home/opti/workflow/src/public/app-assets/js/scripts/charts/echarts/advance/dynamic-data.min.js |
/*! * stack-admin-theme (https://pixinvent.com/bootstrap-admin-template/stack) * Copyright 2018 PIXINVENT * Licensed under the Themeforest Standard Licenses */ $(window).on("load",function(){require.config({paths:{echarts:"../../../app-assets/vendors/js/charts/echarts"}}),require(["echarts","echarts/chart/bar","echarts/chart/line"],function(ec){var myChart=ec.init(document.getElementById("dynamic-data"));chartOptions={tooltip:{trigger:"axis"},legend:{data:["Latest price","Pre-order queue"]},color:["#FF4558","#00A5A8"],toolbox:{show:!0,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},dataZoom:{show:!1,start:0,end:100},xAxis:[{type:"category",boundaryGap:!0,data:function(){for(var now=new Date,res=[],len=10;len--;)res.unshift(now.toLocaleTimeString().replace(/^\D*/,"")),now=new Date(now-2e3);return res}()},{type:"category",boundaryGap:!0,data:function(){for(var res=[],len=10;len--;)res.push(len+1);return res}()}],yAxis:[{type:"value",scale:!0,name:"Price",boundaryGap:[.2,.2]},{type:"value",scale:!0,name:"Futures volume",boundaryGap:[.2,.2]}],series:[{name:"Pre-order queue",type:"bar",xAxisIndex:1,yAxisIndex:1,data:function(){for(var res=[],len=10;len--;)res.push(Math.round(1e3*Math.random()));return res}()},{name:"Latest price",type:"line",data:function(){for(var res=[],len=10;len--;)res.push((10*Math.random()+5).toFixed(1)-0);return res}()}]},myChart.setOption(chartOptions),$(function(){function resize(){setTimeout(function(){myChart.resize()},200)}$(window).on("resize",resize),$(".menu-toggle").on("click",resize);var axisData,lastData=11;clearInterval(timeTicket);var timeTicket=setInterval(function(){lastData+=Math.random()*(Math.round(10*Math.random())%2==0?1:-1),lastData=lastData.toFixed(1)-0,axisData=(new Date).toLocaleTimeString().replace(/^\D*/,""),myChart.addData([[0,Math.round(1e3*Math.random()),!0,!1],[1,lastData,!1,!1,axisData]])},2100)})})});