NEZ-953 fix: 优化tooltip数字

This commit is contained in:
chenjinsong
2021-08-31 16:49:31 +08:00
parent aedc414fd6
commit 0e6a2a8a33
5 changed files with 23 additions and 51 deletions

View File

@@ -94,6 +94,7 @@ import * as echarts from 'echarts'
import { getChart, setChart, getMousePoint } from '../common/js/common'
import chartConfig from '../page/dashboard/overview/chartConfig'
import { randomcolor } from '../common/js/radomcolor/randomcolor'
import {formatScientificNotation} from "@/components/common/js/tools";
export default {
name: 'pieChart', // 饼图 或者 柱状图的统计
components: {
@@ -345,13 +346,7 @@ export default {
show: true,
fontSize: 10,
formatter (val, index) {
let value = val
if (val !== 0) {
value = parseFloat(Number(val).toFixed(2))
if (value === 0) {
value = Number(val).toExponential(2)
}
}
const value = formatScientificNotation(val, 2)
// const flag = JSON.stringify(value).length > JSON.stringify(chartDataFormat.Interval(maxValue, copies, unit.type)).length
if (chartDataFormat.Interval(maxValue, copies, unit.type, 'min') < 1 && dot < 2) {
dot = 2