Browse Source

vnaRawData.html添加图表显示

erp、
RonNurKe 1 year ago
parent
commit
eb1a562654
  1. 36
      ruoyi-admin/src/main/resources/templates/rfMsg/vnaRawData/vnaRawData.html

36
ruoyi-admin/src/main/resources/templates/rfMsg/vnaRawData/vnaRawData.html

@ -2,6 +2,9 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('rf测试历史结果列表')" /> <th:block th:include="include :: header('rf测试历史结果列表')" />
<script src="
https://cdn.jsdelivr.net/npm/echarts@5.4.2/dist/echarts.min.js
"></script>
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
@ -176,10 +179,43 @@
// + "</td></tr>"; // + "</td></tr>";
// } // }
//将动态生成的table添加的事先隐藏的div中. //将动态生成的table添加的事先隐藏的div中.
var chartsInfo ="";
chartsInfo+="<tr><td colspan='"+listValue.length+"'>" +
"<div id='charts"+id+"' style='height: 55vh;width: 90vw'></div>" +
"" +
"</td></tr>"
tableTbody+=chartsInfo
$("#tbody_"+id).html(tableTbody); $("#tbody_"+id).html(tableTbody);
initEcharts(listKey,listValue,id)
} }
}) })
} }
function initEcharts(listKey ,listValue,id){
var chartDom = document.getElementById('charts'+id);
var myChart = echarts.init(chartDom);
var option;
option = {
xAxis: {
type: 'category',
data: listKey
},
yAxis: {
type: 'value'
},
series: [
{
data: listValue,
type: 'line',
smooth: true
}
]
};
option && myChart.setOption(option);
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save