perf: tooltip数字小于0.01时使用指数形式展示
This commit is contained in:
@@ -783,7 +783,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
@@ -957,7 +957,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
|
|||||||
@@ -622,7 +622,7 @@
|
|||||||
}
|
}
|
||||||
let val =item.data[1]?parseFloat(Number(item.data[1]).toFixed(2)):'';
|
let val =item.data[1]?parseFloat(Number(item.data[1]).toFixed(2)):'';
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
@@ -740,7 +740,14 @@
|
|||||||
axisLabel: {
|
axisLabel: {
|
||||||
show:true,
|
show:true,
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
formatter: function(value,index){
|
formatter: function(val,index){
|
||||||
|
let value = val;
|
||||||
|
if (val !== 0) {
|
||||||
|
value = parseFloat(Number(val).toFixed(2));
|
||||||
|
if(value === 0){
|
||||||
|
value = Number(val).toExponential(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
let chartUnit=chartInfo.unit;
|
let chartUnit=chartInfo.unit;
|
||||||
chartUnit=chartUnit?chartUnit:2;
|
chartUnit=chartUnit?chartUnit:2;
|
||||||
let unit=chartDataFormat.getUnit(chartUnit);
|
let unit=chartDataFormat.getUnit(chartUnit);
|
||||||
@@ -850,7 +857,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
@@ -985,7 +992,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
|
|||||||
@@ -585,7 +585,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
@@ -843,7 +843,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
@@ -974,7 +974,7 @@
|
|||||||
}
|
}
|
||||||
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
let val = parseFloat(Number(item.data[1]).toFixed(2));
|
||||||
if(val===0){
|
if(val===0){
|
||||||
val = Number(item.data[1]);
|
val = Number(item.data[1]).toExponential(2);
|
||||||
}
|
}
|
||||||
sum +=val;
|
sum +=val;
|
||||||
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
str += `<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;display: flex; justify-content: space-between; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;">`;
|
||||||
|
|||||||
Reference in New Issue
Block a user