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