mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
动态功率图形已经工作
This commit is contained in:
@@ -151,9 +151,7 @@
|
||||
</div>
|
||||
|
||||
<div class="page page1 demo-graphs mdl-shadow--2dp mdl-cell mdl-cell--8-col">
|
||||
<svg fill="currentColor" viewBox="0 0 500 250" class="demo-graph">
|
||||
<use xlink:href="#chart" />
|
||||
</svg>
|
||||
<div class="ct-chart ct-perfect-fourth"></div>
|
||||
<svg fill="currentColor" viewBox="0 0 500 250" class="demo-graph">
|
||||
<use xlink:href="#chart" />
|
||||
</svg>
|
||||
@@ -310,6 +308,12 @@
|
||||
alert(re.status);
|
||||
}
|
||||
|
||||
var data = {
|
||||
series: [
|
||||
[]
|
||||
]
|
||||
};
|
||||
var t = new Chartist.Line('.ct-chart', data);
|
||||
var power_idx = 0;
|
||||
function GetPowerRecord() {
|
||||
$.ajax({
|
||||
@@ -320,7 +324,8 @@
|
||||
re = re.replace(/'/g, '"');
|
||||
var power = JSON.parse(re);
|
||||
power_idx = power.idx + 1;
|
||||
alert(power.powers);
|
||||
data.series[0].push(power_idx/10);
|
||||
t.update(data);
|
||||
window.setTimeout(GetPowerRecord, 3000);
|
||||
},
|
||||
error: AjaxErr
|
||||
|
||||
Reference in New Issue
Block a user