问题描述
我使用google chart api在我的应用程序中显示折线图,在该图表现在我想显示具有百分比符号的垂直轴值。为我尝试了以下选项
chart.draw(data,{vAxis:{format:'#%'}}) ; 中提及的
使用此方法时,「 值乘以100.即,而不是'12%' - 在vaxis中获得1200%!
我已签入文档,我找不到任何方法来做到这一点。
转义格式中的百分比符号对我有用。
chart.draw(data,{vAxis:{format:'#\'%\''}});
这显示了Y轴标签百分号,没有任何数据更新。 b $ b
Im using google chart api to show line chart in my application, in that chart now i want to show the vertical axis values with percentage sign. for that i tried the following option
chart.draw(data, {vAxis: {format:'#%'} } );
as mentioned in
How do you set percentage in Google Visualization Chart API?
by 'B Seven'
when using this method, the vertical axis values got multiplied by 100. i.e instead of '12%' - im getting 1200% in vaxis!!!!
i have checked in https://developers.google.com documents also, i cant find any approach to do this.
Is there any alternate to show percentage sign in vaxis.
Escaping the percentage sign in format works for me.
chart.draw(data, {vAxis: {format: '#\'%\''} } );
This shows Y axis labels with percentage sign without any data update as i expected.
这篇关于Google图表veritcal轴与百分比符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!