提交 53a9de3c authored 作者: mry's avatar mry

fix(base): 修改了报告样式

上级 c333d7ee
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
</div> </div>
<div class="form-group flex"> <div class="form-group flex">
<label for="probability">通过率:</label> <label for="probability">通过率:</label>
<input class="form-control" id="probability" readonly="readonly" value="${overView.probability + "%"!}"/> <input class="form-control" id="probability" readonly="readonly"
value="${overView.probability + "%"!}"/>
</div> </div>
<#else> <#else>
</#if> </#if>
...@@ -289,10 +290,9 @@ ...@@ -289,10 +290,9 @@
pieChart = { pieChart = {
title: { title: {
text: '测试结果', text: '测试通过率',
subtext: ' ' + subtext: '${overView.probability + "%"!}',
' ${"测试通过率:" + overView.probability + "%"!}', left: 'center'
left: 'left'
}, },
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
}, },
series: [ series: [
{ {
name: '是否成功', name: '是否通过',
type: 'pie', type: 'pie',
radius: ['25%', '50%'], radius: ['25%', '50%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
...@@ -330,21 +330,21 @@ ...@@ -330,21 +330,21 @@
}, },
data: [ data: [
{value: ${overView.passNum!}, name: 'pass',itemStyle: { {
value: ${overView.passNum!}, name: 'pass', itemStyle: {
color: 'green' color: 'green'
}}, }
{value: ${overView.failNum!}, name: 'fail',itemStyle: { },
{
value: ${overView.failNum!}, name: 'fail', itemStyle: {
color: '#a90000' color: '#a90000'
}}, }
},
] ]
} }
] ]
}; };
pieChart && myChart.setOption(pieChart);
</script>
<script>
let chartDom2 = document.getElementById('histogram'); let chartDom2 = document.getElementById('histogram');
let myChart2 = echarts.init(chartDom2); let myChart2 = echarts.init(chartDom2);
let histogram; let histogram;
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
}], }],
type: 'bar', type: 'bar',
showBackground: true, showBackground: true,
barWidth : 50, barWidth: 50,
backgroundStyle: { backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)' color: 'rgba(180, 180, 180, 0.2)'
} }
...@@ -380,7 +380,12 @@ ...@@ -380,7 +380,12 @@
] ]
}; };
histogram && myChart2.setOption(histogram); myChart.setOption(pieChart);
myChart2.setOption(histogram);
window.onresize = function () {
myChart.resize();
myChart2.resize();
}
</script> </script>
</body> </body>
......
...@@ -145,10 +145,9 @@ ...@@ -145,10 +145,9 @@
pieChart = { pieChart = {
title: { title: {
text: '测试结果', text: '测试通过率',
subtext: ' ' + subtext: '50%',
' 测试通过率: 100%', left: 'center',
left: 'left',
}, },
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
...@@ -186,21 +185,21 @@ ...@@ -186,21 +185,21 @@
}, },
data: [ data: [
{value: 1, name: 'pass',itemStyle: { {
value: 1, name: 'pass', itemStyle: {
color: 'green' color: 'green'
}}, }
{value: 1, name: 'fail',itemStyle: { },
{
value: 1, name: 'fail', itemStyle: {
color: '#a90000' color: '#a90000'
}}, }
},
] ]
} }
] ]
}; };
pieChart && myChart.setOption(pieChart);
</script>
<script>
let chartDom2 = document.getElementById('histogram'); let chartDom2 = document.getElementById('histogram');
let myChart2 = echarts.init(chartDom2); let myChart2 = echarts.init(chartDom2);
let histogram; let histogram;
...@@ -227,7 +226,7 @@ ...@@ -227,7 +226,7 @@
} }
}], }],
type: 'bar', type: 'bar',
barWidth : 50, barWidth: 50,
showBackground: true, showBackground: true,
backgroundStyle: { backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)' color: 'rgba(180, 180, 180, 0.2)'
...@@ -236,7 +235,12 @@ ...@@ -236,7 +235,12 @@
] ]
}; };
histogram && myChart2.setOption(histogram); myChart.setOption(pieChart);
myChart2.setOption(histogram);
window.onresize = function () {
myChart.resize();
myChart2.resize();
}
</script> </script>
</body> </body>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论