feat:优化Y轴关于小数部分的显示
This commit is contained in:
@@ -19,19 +19,13 @@ function short(value,index,type=1,dot){
|
|||||||
|
|
||||||
}
|
}
|
||||||
function percent01(value,index){
|
function percent01(value,index){
|
||||||
let len=JSON.stringify(value);
|
value=parseFloat((value).toPrecision(12));
|
||||||
if(len.length>5){
|
return `${value} %`;
|
||||||
len=len.slice(0,5);
|
|
||||||
}
|
|
||||||
return `${len} %`;
|
|
||||||
}
|
}
|
||||||
function percent02(value,index){
|
function percent02(value,index){
|
||||||
value=value*100;
|
console.log(value);
|
||||||
let len=JSON.stringify(value);
|
value=parseFloat((value*100).toPrecision(12));
|
||||||
if(len.length>5&&value<100){
|
return `${value} %`;
|
||||||
len=len.slice(0,5);
|
|
||||||
}
|
|
||||||
return `${len} %`;
|
|
||||||
}
|
}
|
||||||
function localFormat(value,index){
|
function localFormat(value,index){
|
||||||
let num = (value || 0).toString();
|
let num = (value || 0).toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user