今天遇到一个问题,有几个页面的图表,数据传递过来的是百分比的,比如 9.60% 25.05%.
解决办法是js中xml形式组装数据时,将百分号substring(0,colData.length-1);
然后<chart numberSuffix="%" decimals="2" >......,<set数据...此处略> </chart>
第一个参数是让数字之后有百分号.
第二个参数是官网上查的.
if you had data as 0.12352, 0.134 and 0.13, and you set decimals as 3, FusionCharts XT will output 0.124, 0.134 and 0.13
if you want your numbers on the chart to have trailing zeroes too, you can set <chart ... forceDecimals='1' > and now the numbers will show as 0.124, 0.134 and 0.130 respectively.


解决百分比数据在图表中的显示问题
本文解决了一个在图表中展示百分比数据时的显示问题,通过使用JavaScript进行数据处理,确保百分号正确显示并调整数值精度。

被折叠的 条评论
为什么被折叠?



