sensor_chart_C.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <!-- 宣告我們要套用模板 -->
  2. {% extends "base.html" %}
  3. {% block title %}{{ title }}{% endblock %}
  4. {% block script %}
  5. <!--引入 echarts.js -->
  6. <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
  7. <script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js'></script>
  8. <script src='https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.js'></script>
  9. <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-zoom/0.3.0/Chart.Zoom.min.js"></script>
  10. <script language="JavaScript">
  11. var tank = '{{tank}}';
  12. var sensor_name = '{{sensor_name}}';
  13. var tid = '{{tid}}';
  14. var status = '{{status}}';
  15. var username = '{{username}}';
  16. $(document).ready(function(){
  17. $("#coffee_title_pc").text(' 清洗槽感測器圖表');
  18. $("#coffee_title_phone").text(' 感測器');
  19. $('#navbarDropdown_user_pc').text(username);
  20. $('#navbarDropdown_user_phone').text(username);
  21. });
  22. </script>
  23. {% endblock %}
  24. {% block main %}
  25. <div class="album py-5 bg-light">
  26. <div class="container">
  27. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1 g-3">
  28. <div class="col">
  29. <div class="card shadow-sm">
  30. <div class="card-body">
  31. <div class="d-flex justify-content-between align-items-center">
  32. <table style="margin: auto; border:3px gray solid; width: 80%; text-align: center;" cellpadding="6" rules='ALL'>
  33. <tr>
  34. <td style="border:1px gray solid;">
  35. {% if tid == '2'%}
  36. <select id="tank_num">
  37. <option value="C1">清洗槽_1</option>
  38. <option value="C2" selected>清洗槽_2</option>
  39. <option value="C3">清洗槽_3</option>
  40. <option value="C4">清洗槽_4</option>
  41. <option value="C5">清洗槽_5</option>
  42. <option value="C6">清洗槽_6</option>
  43. <option value="C7">清洗槽_7</option>
  44. <option value="C8">清洗槽_8</option>
  45. <option value="C9">清洗槽_9</option>
  46. <option value="C10">清洗槽_10</option>
  47. <option value="C11">清洗槽_11</option>
  48. <option value="C12">清洗槽_12</option>
  49. </select>
  50. {% elif tid == '3'%}
  51. <select id="tank_num">
  52. <option value="C1">清洗槽_1</option>
  53. <option value="C2">清洗槽_2</option>
  54. <option value="C3" selected>清洗槽_3</option>
  55. <option value="C4">清洗槽_4</option>
  56. <option value="C5">清洗槽_5</option>
  57. <option value="C6">清洗槽_6</option>
  58. <option value="C7">清洗槽_7</option>
  59. <option value="C8">清洗槽_8</option>
  60. <option value="C9">清洗槽_9</option>
  61. <option value="C10">清洗槽_10</option>
  62. <option value="C11">清洗槽_11</option>
  63. <option value="C12">清洗槽_12</option>
  64. </select>
  65. {% elif tid == '4'%}
  66. <select id="tank_num">
  67. <option value="C1">清洗槽_1</option>
  68. <option value="C2">清洗槽_2</option>
  69. <option value="C3">清洗槽_3</option>
  70. <option value="C4" selected>清洗槽_4</option>
  71. <option value="C5">清洗槽_5</option>
  72. <option value="C6">清洗槽_6</option>
  73. <option value="C7">清洗槽_7</option>
  74. <option value="C8">清洗槽_8</option>
  75. <option value="C9">清洗槽_9</option>
  76. <option value="C10">清洗槽_10</option>
  77. <option value="C11">清洗槽_11</option>
  78. <option value="C12">清洗槽_12</option>
  79. </select>
  80. {% elif tid == '5'%}
  81. <select id="tank_num">
  82. <option value="C1">清洗槽_1</option>
  83. <option value="C2">清洗槽_2</option>
  84. <option value="C3">清洗槽_3</option>
  85. <option value="C4">清洗槽_4</option>
  86. <option value="C5" selected>清洗槽_5</option>
  87. <option value="C6">清洗槽_6</option>
  88. <option value="C7">清洗槽_7</option>
  89. <option value="C8">清洗槽_8</option>
  90. <option value="C9">清洗槽_9</option>
  91. <option value="C10">清洗槽_10</option>
  92. <option value="C11">清洗槽_11</option>
  93. <option value="C12">清洗槽_12</option>
  94. </select>
  95. {% elif tid == '6'%}
  96. <select id="tank_num">
  97. <option value="C1">清洗槽_1</option>
  98. <option value="C2">清洗槽_2</option>
  99. <option value="C3">清洗槽_3</option>
  100. <option value="C4">清洗槽_4</option>
  101. <option value="C5">清洗槽_5</option>
  102. <option value="C6" selected>清洗槽_6</option>
  103. <option value="C7">清洗槽_7</option>
  104. <option value="C8">清洗槽_8</option>
  105. <option value="C9">清洗槽_9</option>
  106. <option value="C10">清洗槽_10</option>
  107. <option value="C11">清洗槽_11</option>
  108. <option value="C12">清洗槽_12</option>
  109. </select>
  110. {% elif tid == '7'%}
  111. <select id="tank_num">
  112. <option value="C1">清洗槽_1</option>
  113. <option value="C2">清洗槽_2</option>
  114. <option value="C3">清洗槽_3</option>
  115. <option value="C4">清洗槽_4</option>
  116. <option value="C5">清洗槽_5</option>
  117. <option value="C6">清洗槽_6</option>
  118. <option value="C7" selected>清洗槽_7</option>
  119. <option value="C8">清洗槽_8</option>
  120. <option value="C9">清洗槽_9</option>
  121. <option value="C10">清洗槽_10</option>
  122. <option value="C11">清洗槽_11</option>
  123. <option value="C12">清洗槽_12</option>
  124. </select>
  125. {% elif tid == '8'%}
  126. <select id="tank_num">
  127. <option value="C1">清洗槽_1</option>
  128. <option value="C2">清洗槽_2</option>
  129. <option value="C3">清洗槽_3</option>
  130. <option value="C4">清洗槽_4</option>
  131. <option value="C5">清洗槽_5</option>
  132. <option value="C6">清洗槽_6</option>
  133. <option value="C7">清洗槽_7</option>
  134. <option value="C8" selected>清洗槽_8</option>
  135. <option value="C9">清洗槽_9</option>
  136. <option value="C10">清洗槽_10</option>
  137. <option value="C11">清洗槽_11</option>
  138. <option value="C12">清洗槽_12</option>
  139. </select>
  140. {% elif tid == '9'%}
  141. <select id="tank_num">
  142. <option value="C1">清洗槽_1</option>
  143. <option value="C2">清洗槽_2</option>
  144. <option value="C3">清洗槽_3</option>
  145. <option value="C4">清洗槽_4</option>
  146. <option value="C5">清洗槽_5</option>
  147. <option value="C6">清洗槽_6</option>
  148. <option value="C7">清洗槽_7</option>
  149. <option value="C8">清洗槽_8</option>
  150. <option value="C9" selected>清洗槽_9</option>
  151. <option value="C10">清洗槽_10</option>
  152. <option value="C11">清洗槽_11</option>
  153. <option value="C12">清洗槽_12</option>
  154. </select>
  155. {% elif tid == '10'%}
  156. <select id="tank_num">
  157. <option value="C1">清洗槽_1</option>
  158. <option value="C2">清洗槽_2</option>
  159. <option value="C3">清洗槽_3</option>
  160. <option value="C4">清洗槽_4</option>
  161. <option value="C5">清洗槽_5</option>
  162. <option value="C6">清洗槽_6</option>
  163. <option value="C7">清洗槽_7</option>
  164. <option value="C8">清洗槽_8</option>
  165. <option value="C9">清洗槽_9</option>
  166. <option value="C10" selected>清洗槽_10</option>
  167. <option value="C11">清洗槽_11</option>
  168. <option value="C12">清洗槽_12</option>
  169. </select>
  170. {% elif tid == '11'%}
  171. <select id="tank_num">
  172. <option value="C1">清洗槽_1</option>
  173. <option value="C2">清洗槽_2</option>
  174. <option value="C3">清洗槽_3</option>
  175. <option value="C4">清洗槽_4</option>
  176. <option value="C5">清洗槽_5</option>
  177. <option value="C6">清洗槽_6</option>
  178. <option value="C7">清洗槽_7</option>
  179. <option value="C8">清洗槽_8</option>
  180. <option value="C9">清洗槽_9</option>
  181. <option value="C10">清洗槽_10</option>
  182. <option value="C11" selected>清洗槽_11</option>
  183. <option value="C12">清洗槽_12</option>
  184. </select>
  185. {% elif tid == '12'%}
  186. <select id="tank_num">
  187. <option value="C1">清洗槽_1</option>
  188. <option value="C2">清洗槽_2</option>
  189. <option value="C3">清洗槽_3</option>
  190. <option value="C4">清洗槽_4</option>
  191. <option value="C5">清洗槽_5</option>
  192. <option value="C6">清洗槽_6</option>
  193. <option value="C7">清洗槽_7</option>
  194. <option value="C8">清洗槽_8</option>
  195. <option value="C9">清洗槽_9</option>
  196. <option value="C10">清洗槽_10</option>
  197. <option value="C11">清洗槽_11</option>
  198. <option value="C12" selected>清洗槽_12</option>
  199. </select>
  200. {% else %}
  201. <select id="tank_num">
  202. <option value="C1" selected>清洗槽_1</option>
  203. <option value="C2">清洗槽_2</option>
  204. <option value="C3">清洗槽_3</option>
  205. <option value="C4">清洗槽_4</option>
  206. <option value="C5">清洗槽_5</option>
  207. <option value="C6">清洗槽_6</option>
  208. <option value="C7">清洗槽_7</option>
  209. <option value="C8">清洗槽_8</option>
  210. <option value="C9">清洗槽_9</option>
  211. <option value="C10">清洗槽_10</option>
  212. <option value="C11">清洗槽_11</option>
  213. <option value="C12">清洗槽_12</option>
  214. </select>
  215. {% endif %}
  216. {% if sensor_name=='motorEncoder' %}
  217. <select id="sensors">
  218. <option value="UltraSonic">咖啡生豆高度</option>
  219. <option value="motorEncoder" selected>馬達編碼器</option>
  220. <option value="Turbidity">濁度計</option>
  221. <option value="butterflyvalve">蝴蝶閥編碼器</option>
  222. </select>
  223. {% elif sensor_name=='turbidity' %}
  224. <select id="sensors">
  225. <option value="UltraSonic">咖啡生豆高度</option>
  226. <option value="motorEncoder">馬達編碼器</option>
  227. <option value="Turbidity" selected>濁度計</option>
  228. <option value="butterflyvalve">蝴蝶閥編碼器</option>
  229. </select>
  230. {% elif sensor_name=='UltraSonic' %}
  231. <select id="sensors">
  232. <option value="UltraSonic"selected>咖啡生豆高度</option>
  233. <option value="motorEncoder">馬達編碼器</option>
  234. <option value="Turbidity" >濁度計</option>
  235. <option value="butterflyvalve">蝴蝶閥編碼器</option>
  236. </select>
  237. {% elif sensor_name=='butterflyvalve' %}
  238. <select id="sensors">
  239. <option value="UltraSonic">咖啡生豆高度</option>
  240. <option value="motorEncoder">馬達編碼器</option>
  241. <option value="Turbidity" >濁度計</option>
  242. <option value="butterflyvalve"selected>蝴蝶閥編碼器</option>
  243. </select>
  244. {% else %}
  245. <select id="sensors">
  246. <option value="UltraSonic" selected>咖啡生豆高度</option>
  247. <option value="motorEncoder">馬達編碼器</option>
  248. <option value="Turbidity">濁度計</option>
  249. <option value="butterflyvalve">蝴蝶閥編碼器</option>
  250. </select>
  251. {% endif %}
  252. </td>
  253. </tr>
  254. <tr>
  255. <td style="border:1px gray solid;">
  256. 時間間隔:
  257. <select name="time-interval" class="text-right">
  258. <option value="month">逐月</option>
  259. <option value="day">逐日</option>
  260. <option value="hour">逐時</option>
  261. </select>
  262. &nbsp;
  263. <!--
  264. 從&nbsp;
  265. <input type="datetime-local" name="sensor_starttime" id="sensor_starttime" value={{starttime}}>
  266. &nbsp;到&nbsp;
  267. <input type="datetime-local" name="sensor_endtime" id="sensor_endtime" value={{endtime}}>
  268. &nbsp;為止
  269. -->
  270. <span>從</span>
  271. <label for="querydate-start"></label><input id="querydate-start" type="date">
  272. <span>到</span>
  273. <label for="querydate-end"></label><input id="querydate-end" type="date">
  274. <span>為止</span>
  275. </td>
  276. </tr>
  277. <tr>
  278. <td style="border:1px gray solid;">
  279. 資料類型:
  280. <label><input type="checkbox" name="data-type" value="max">最大值</label>
  281. <label><input type="checkbox" name="data-type" value="avg">平均值</label>
  282. <label><input type="checkbox" name="data-type" value="min">最小值</label>
  283. <br>
  284. </td>
  285. </tr>
  286. <tr>
  287. <td style="border:1px gray solid;">
  288. <!--
  289. <button type="submit" name="charting">繪製圖表</button>
  290. <button type="submit" onclick="" id="btn_save_chart" style="display: none;">儲存圖表</button>
  291. -->
  292. <input type="button" class="btn btn-secondary" value="查詢" onclick="ShowInfo()">
  293. <input type="button" class="btn btn-secondary" value="匯出" onclick="downloadFile()">
  294. <script>
  295. function ShowInfo() {
  296. // 取得桶號、感測器名稱
  297. tid = document.getElementById("tank_num").value
  298. console.log('tid: ' + tid)
  299. sensor_name = document.getElementById("sensors").value
  300. console.log('sensor_name: ' + sensor_name)
  301. // 數據整理
  302. Echart(sensor_name, tid)
  303. // 顯示圖表
  304. };
  305. function downloadFile() {
  306. tid = document.getElementById("tank_num").value
  307. sensor_name = document.getElementById("sensors").value
  308. //藉型別陣列建構的 blob 來建立 URL
  309. let fileName = "ChartData_" + tid + "_" + sensor_name + ".csv";
  310. //"\ufeff"解決打開CSV中文亂碼問題
  311. const data = "\ufeff" + getData();
  312. let blob = new Blob([data], {
  313. type: 'text/csv,charset=UTF-8'
  314. });
  315. var href = URL.createObjectURL(blob);
  316. // 從 Blob 取出資料
  317. var link = document.createElement("a");
  318. document.body.appendChild(link);
  319. link.href = href;
  320. link.download = fileName;
  321. link.click();
  322. };
  323. //所有資料函數
  324. function getData() {
  325. var header = "日期," + data_name + "\n";
  326. var data = "";
  327. var length = all_datetime.length;
  328. for (var i = 0; i < length; i++) {
  329. data = data + all_datetime[i] + ',' + all_data[i] + '\n';
  330. };
  331. return header + data;
  332. };
  333. //最大最小平均資料函數
  334. function getData() {
  335. var header = data_name + "\n日期,";
  336. if (max_data) {
  337. console.log(max_data);
  338. header = header + "最大值,";
  339. };
  340. if (avg_data) {
  341. header = header + "平均值,";
  342. };
  343. if (min_data) {
  344. header = header + "最小值,";
  345. };
  346. header = header + "\n";
  347. var data = "";
  348. var length = xAxis_data.length;
  349. for (var i = 0; i < length; i++) {
  350. data = data + xAxis_data[i] + ',';
  351. if (max_data) {
  352. data = data + max_data[i] + ',';
  353. };
  354. if (avg_data) {
  355. data = data + avg_data[i] + ',';
  356. };
  357. if (min_data) {
  358. data = data + min_data[i] + ',';
  359. };
  360. data = data + '\n';
  361. };
  362. return header + data;
  363. };
  364. </script>
  365. </td>
  366. </tr>
  367. <tr>
  368. <td>
  369. <!--
  370. <img src={{ url }}>
  371. -->
  372. <div id="" class="show-info" style="text-align: center;">
  373. <center>
  374. <div class="show-chart" style="height: 420px; width: 100%; text-align: center;">
  375. 圖表
  376. </div>
  377. </center>
  378. </div>
  379. </td>
  380. </tr>
  381. </table>
  382. </div>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. {% endblock %}
  390. {% block script2 %}
  391. <script>
  392. var all_datetime = 0; // 所有資料時間 ?
  393. var all_data = 0; // 所有感測器數據 ?
  394. var data_name = 0; // 感測器名稱 // "溫溼度"
  395. var xAxis_data = 0; // x 軸資料
  396. var max_data = 0; //
  397. var min_data = 0; //
  398. var avg_data = 0; //
  399. function Echart(sensor_name, tid) {
  400. // Echart(sensor_name, tid)
  401. //將echarts圖形銷毀
  402. $(".show-chart").removeAttr("_echarts_instance_").empty();
  403. // Rita:sensor 與 data_name 重複
  404. // var sensor = evt.substring(2);
  405. if (!$("input[value=avg]").prop('checked') && !$("input[value=min]").prop('checked') && !$("input[value=max]").prop('checked')) {
  406. alert("請至少選擇一種資料類型!");
  407. return false;
  408. };
  409. if ($("#querydate-start").val() == '' || $("#querydate-end").val() == '') {
  410. alert("請選擇日期範圍!");
  411. return false;
  412. };
  413. //基於準備好的dom,初始化echarts例項
  414. var myChart = echarts.init(document.getElementsByClassName('show-chart')[0]); // class="col-10 show-chart"
  415. var date_start = $("#querydate-start").val();
  416. var date_end = $("#querydate-end").val();
  417. var avg = 0;
  418. var max = 0;
  419. var min = 0;
  420. var time_interval = $("select[name=time-interval]").val();
  421. var legend = new Array();
  422. var color = new Array();
  423. var series = new Array();
  424. if ($("input[value=max]").prop('checked')) {
  425. max = 1;
  426. legend.push("最大值");
  427. color.push("#1e88e5"); // 水藍色
  428. };
  429. if ($("input[value=avg]").prop('checked')) {
  430. avg = 1;
  431. legend.push("平均值");
  432. color.push("#43a047"); // 草綠色
  433. };
  434. if ($("input[value=min]").prop('checked')) {
  435. min = 1;
  436. legend.push("最小值");
  437. color.push("#e64a19"); // 橘紅色
  438. };
  439. var json = {
  440. 'tid': tid,
  441. 'sensor_name': sensor_name,
  442. 'avg': avg,
  443. 'max': max,
  444. 'min': min,
  445. 'time-interval': time_interval,
  446. 'date-start': date_start,
  447. 'date-end': date_end
  448. };
  449. console.log('json___' +
  450. 'tid: ' + tid +
  451. 'sensor_name: ' + sensor_name +
  452. 'avg: ' + avg +
  453. 'max: ' + max +
  454. 'min: ' + min +
  455. 'time-interval: ' + time_interval +
  456. 'date-start: ' + date_start +
  457. 'date-end: ' + date_end
  458. )
  459. $.get('/history_data_new', json, function (resText) {
  460. if (resText.max) {
  461. var max_series = {
  462. 'name': '最大值',
  463. 'type': 'scatter',
  464. 'data': resText.max.map(function (item) { return item[1]; }),
  465. 'itemStyle': { 'normal': { 'lineStyle': { 'color': '#1e88e5' } } },
  466. };
  467. series.push(max_series); // 把上面的 dict 加入 series array 內
  468. xAxis_data = resText.max.map(function (item) { return item[0]; });
  469. max_data = resText.max.map(function (item) { return item[1]; });
  470. };
  471. if (resText.avg) {
  472. var avg_series = { 'name': '平均值', 'type': 'scatter', 'data': resText.avg.map(function (item) { return item[1]; }), 'itemStyle': { 'normal': { 'lineStyle': { 'color': '#43a047' } } }, };
  473. series.push(avg_series);
  474. xAxis_data = resText.avg.map(function (item) { return item[0]; });
  475. console.log('xAxis_data: ' + xAxis_data) // 2021-07-09 10:00:00,2021-07-20 09:00:00,2021-07-22 15:00:00,2021-07-26 15:00:00,2021-07-26 16:00:00
  476. avg_data = resText.avg.map(function (item) { return item[1]; });
  477. console.log('avg_data: ' + avg_data) // 91.0,98.0,11.0,15.2,30.5
  478. };
  479. if (resText.min) {
  480. var min_series = { 'name': '最小值', 'type': 'scatter', 'data': resText.min.map(function (item) { return item[1]; }), 'itemStyle': { 'normal': { 'lineStyle': { 'color': '#e64a19' } } }, };
  481. series.push(min_series);
  482. xAxis_data = resText.min.map(function (item) { return item[0]; }); // all
  483. min_data = resText.min.map(function (item) { return item[1]; }); // min
  484. };
  485. //獲取日期內所有數據
  486. all_datetime = resText.all.map(function (item) { return item[0]; }); // all
  487. all_data = resText.all.map(function (item) { return item[1]; });
  488. //指定圖表的配置項和資料
  489. option = {
  490. title: {
  491. text: '', // 'Data History'
  492. left: '1%'
  493. },
  494. tooltip: {
  495. trigger: 'axis'
  496. },
  497. color: color,
  498. legend: {
  499. data: legend,
  500. },
  501. xAxis: {
  502. data: xAxis_data,
  503. },
  504. yAxis: {
  505. splitLine: {
  506. show: true,
  507. lineStyle: {
  508. color: ''
  509. }
  510. }
  511. },
  512. toolbox: {
  513. show: true,
  514. feature: {
  515. saveAsImage: {}
  516. }
  517. },
  518. dataZoom: [{
  519. startValue: '2021-01-01'
  520. }, {
  521. type: 'inside'
  522. }],
  523. series: series,
  524. /*
  525. series: [
  526. {
  527. name: '最大值',
  528. type: 'line',
  529. data: resText.max.map(function (item) {
  530. return item[1];
  531. }),
  532. itemStyle: {
  533. normal: {
  534. lineStyle: {
  535. color: '#1e88e5'
  536. }
  537. }
  538. },
  539. },
  540. {
  541. name: '平均值',
  542. type: 'line',
  543. data: [20.0, 20.0, 20.0, 20.0, 20.0, 20.0],
  544. itemStyle: {
  545. normal: {
  546. lineStyle: {
  547. color: '#43a047'
  548. }
  549. }
  550. },
  551. },
  552. {
  553. name: '最小值',
  554. type: 'line',
  555. data: [15.0, 15.0, 15.0, 15.0, 15.0, 15.0],
  556. itemStyle: {
  557. normal: {
  558. lineStyle: {
  559. color: '#e64a19'
  560. }
  561. }
  562. }
  563. },
  564. ]
  565. */
  566. };
  567. console.log('SHOW myChart')
  568. //使用剛指定的配置項和資料顯示圖表
  569. myChart.setOption(option);
  570. window.addEventListener('resize', myChart.resize);
  571. }, 'json');
  572. } // Echart(sensor_name, tid)
  573. </script>
  574. {% endblock %}