首页 > 其他分享 >echart 柱状图 分五等分

echart 柱状图 分五等分

时间:2022-12-14 10:47:11浏览次数:41  
标签:return echart truncated max value 柱状图 五等 const Math

 ceilNumber = (value: number) => {   let truncated = parseInt(`${value}`.slice(0, 2)) const mod = truncated % 5
if (mod === 0) { truncated = truncated + 5 } else { truncated = 5 - mod + truncated }   return parseInt(`${truncated}${Array(`${Math.trunc(value)}`.slice(2).length).fill(0).join('')}`) }   yAxis: [   max: ((value) => { if (Array.isArray(value)) { const max = Math.max(...value); return ceilNumber(max); } return 0; })(yxisDataValue), interval: ((value) => { if (Array.isArray(value)) { const max = Math.max(...value); return ceilNumber(max) / 5; } return 0; })(yxisDataValue), Y轴数组 ]

标签:return,echart,truncated,max,value,柱状图,五等,const,Math
From: https://www.cnblogs.com/Daguaishou0704/p/16981438.html

相关文章