admin 管理员组文章数量: 887021
2024年1月11日发(作者:计算机汉语言编程)
代码结构详细代码//
const endBtn = new MyButton(elector("#end")); ntListener("click",function(){ closeTimer(timer); (); });}function startTimer(){ return timer = setInterval(function(){ (); },1000,myChart);}function closeTimer(timer){ clearInterval(timer)}//
data:values }] });
} function createTimes(myChart){ let {dotNum,interval,lastStartTime} = myChart; let startTime = lastStartTime?lastStartTime:new Date().getTime(); lastStartTime = startTime + interval; let times = [];
for(var i=0;i function createValues(myChart){ let {dotNum,lastValues} = myChart; let values; if( === 0){ values = []; for(var i=0;i function formatTime(time){ const hour = rs(); const min = utes(); const sec = onds(); const h = hour<10 ? "0"+hour : hour; const m = min<10 ? "0"+min : min; const s = sec<10 ? "0"+sec : sec; return h+":"+m+":"+s; } t = MyChart;}(window)) //(function(win){ function MyButton(elm){ = elm; } ntListener = function(type,handler){ if(ntListener){ ntListener(type,handler,false); }else { ["on"+type] = handler; } } e = function(){ ("disabled"); } = function(){ ("disabled"); } on = MyButton;}(window)); //#myChart{ display:inline-block; width:400px;height:200px; border:1px solid lightgray; border-right:none; vertical-align:middle;}.container{ display:inline-block; width:80px;height:200px; border:1px solid lightgray; border-left:none; margin:-5px; vertical-align:middle;}.buttons{ display:table-cell; width:inherit;height: inherit; vertical-align: middle;}.button{ font-size:0.75em; padding:.3em; background-color:rgba(0,0,255,.5); border:1px solid transparent; border-radius:.5em; box-shadow:1px 1px 1px black; text-align:center; margin:1em;}.button:hover{ cursor:pointer; background-color:rgba(0,0,255,1); color:white;}.disabled{ background-color:lightgray; color:lavender; box-shadow:1px 1px 1px lightslategray;}.disabled:hover{ cursor:not-allowed; background-color:lightgray; color:lavender;}
版权声明:本文标题:ECharts实现动态曲线(上) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1704926097h466896.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论