feat: 修正管理看板组件中图表最大值计算逻辑,调整小数位处理方式并简化代码
This commit is contained in:
@@ -427,8 +427,7 @@ const { chartOption } = useChartOption(() => {
|
||||
});
|
||||
// 判断数字出多少位,数字中可能有小数
|
||||
return (
|
||||
Math.ceil(maxValue + 1) +
|
||||
Math.pow(10, maxValue.toFixed().length - 1)
|
||||
Math.ceil(maxValue) + Math.pow(10, maxValue.toFixed().length - 2)
|
||||
); // 向上取整到最接近的千位
|
||||
}
|
||||
},
|
||||
@@ -438,8 +437,6 @@ const { chartOption } = useChartOption(() => {
|
||||
nameTextStyle: {
|
||||
color: '#4E5969'
|
||||
},
|
||||
min: 0,
|
||||
max: 100,
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
@@ -453,7 +450,7 @@ const { chartOption } = useChartOption(() => {
|
||||
],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter(params) {
|
||||
formatter(params: ToolTipFormatterParams[]) {
|
||||
const paramsList = params as ToolTipFormatterParams[];
|
||||
let result = `<div><p class="tooltip-title">${paramsList[0].axisValueLabel}</p>`;
|
||||
paramsList.forEach(item => {
|
||||
|
||||
Reference in New Issue
Block a user