style(接口测试): 优化接口测试报告的饼状图

优化接口测试报告的饼状图,当某个扇面过于小时使用一个最小尺寸,避免饼状图看不到这一部分
This commit is contained in:
song-tianyang 2023-02-20 17:53:21 +08:00 committed by 建国
parent c5d061f30b
commit 506d29765d
2 changed files with 11 additions and 9 deletions

View File

@ -18,7 +18,6 @@
:is-share="isShare"
@reportExport="handleExport"
@reportSave="handleSave" />
<!-- content -->
<main v-if="isNotRunning">
<!-- content header chart -->
@ -704,8 +703,8 @@ export default {
}
}
}
if(this.content.scenarios && this.content.scenarios[0].requestResults){
this.content.scenarios[0].requestResults.push({responseResult: {}});
if (this.content.scenarios && this.content.scenarios[0].requestResults) {
this.content.scenarios[0].requestResults.push({ responseResult: {} });
}
this.reportExportVisible = true;
let reset = this.exportReportReset;

View File

@ -255,6 +255,13 @@ export default {
return total;
},
options() {
let picData = [
{ value: this.content.success > 0 ? this.content.success : '-', name: 'Success' },
{ value: this.content.error > 0 ? this.content.error : '-', name: 'Error' },
{ value: this.content.errorCode > 0 ? this.content.errorCode : '-', name: 'FakeError' },
{ value: this.content.unExecute > 0 ? this.content.unExecute : '-', name: 'Pending' },
];
return {
color: ['#67C23A', '#F56C6C', '#F6972A', '#9C9B9A'],
tooltip: {
@ -286,6 +293,7 @@ export default {
],
series: [
{
minAngle: 3,
type: 'pie',
radius: ['80%', '90%'],
avoidLabelOverlap: false,
@ -301,12 +309,7 @@ export default {
labelLine: {
show: false,
},
data: [
{ value: this.content.success, name: 'Success' },
{ value: this.content.error, name: 'Error' },
{ value: this.content.errorCode, name: 'FakeError' },
{ value: this.content.unExecute, name: 'Pending' },
],
data: picData,
},
],
};