修改按单批次饼图鼠标聚焦提示
This commit is contained in:
parent
c123a87789
commit
56cff6ecdd
|
@ -54,6 +54,7 @@
|
|||
|
||||
<script>
|
||||
//import { pagination } from 'mock/_util';
|
||||
import { red } from '@ant-design/colors';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
|
@ -326,18 +327,31 @@
|
|||
this.participate_Piechartloading = true;
|
||||
this.tableloading = true;
|
||||
let result = await defHttp.get({ url: url, params: queryParams });
|
||||
let totalRate = 0;
|
||||
for (let key in result.gradeData) {
|
||||
totalRate += parseFloat(result.gradeData[key].passRate);
|
||||
}
|
||||
console.log(totalRate, 'totalRate');
|
||||
console.log(result, 'result');
|
||||
let chartsData = [];
|
||||
for (let key in result.gradeData) {
|
||||
chartsData.push({
|
||||
name: key + '级',
|
||||
value: result.gradeData[key].passRate,
|
||||
value: (parseFloat(result.gradeData[key].passRate) / totalRate) * 100,
|
||||
});
|
||||
}
|
||||
let option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
conginee: false,
|
||||
formatter: function (params) {
|
||||
return params.name + ': ' + params.value.toFixed(1) + '%';
|
||||
},
|
||||
textStyle: {
|
||||
color: '#ec2e30', // 设置文本颜色
|
||||
fontSize: 14, // 设置字体大小
|
||||
fontWeight: 'bold', // 设置字体加粗
|
||||
},
|
||||
//字体大小
|
||||
itemStytle: {
|
||||
// 设置阴影效果
|
||||
|
|
Loading…
Reference in New Issue