smoothie是什么

来源:互联网转载和整理 2024-05-10 16:46:41

smoothie什么意思

smoothie是什么

 Smoothie是个极小的图表库,专为实时流媒体数据设计的。 

smoothie例子

html

<canvasid="chart"width="400"height="100"></canvas>

js

//Createatimeseries

varseries=newTimeSeries();

//Findthecanvas

varcanvas=document.getElementById('chart');

//Createthechart

varchart=newSmoothieChart();

chart.addTimeSeries(series,{strokeStyle:'rgba(0,255,0,1)'});

chart.streamTo(canvas,500);

//Then,adddatatoyourtimeseriesanditwillbedisplayedonthechart:

//Randomlyaddadatapointevery500ms

setInterval(function(){

series.append(Date.now(),Math.random()*10000);

},500);