ECharts gauge title 和 detail 使用 valueFormatter 后不显示动画问题
ECharts About 226 words问题
为了使ECharts动画在初始加载时执行(gauge图),而且保留原先formatter的格式,使用了valueFormatter。
但valueFormatter中,因为需要计算不同圆环的百分比,不得不使用外部变量,导致了在valueFormatter中没有使用函数中的value值。
在没有使用到value值时,动画将不再执行。
解决
不使用外部变量,外部计算好的百分比变量,在valueFormatter中再换算回来即可(浪费一点点算力)。
Views: 10 · Posted: 2026-03-12
———         Thanks for Reading         ———
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...