Wednesday, January 04, 2017

Set percentage sign in Vertical axis of in Google Visualization Chart API charts

Using the below line set the vertical axis to display percent but with that it also multiply the original data value by 100. i.e if your current vertical axis for your data value is 10,20,30.
 applying the below option will make that as 1000%, 2000%, 3000%.

To overcome this you need to divide each data value for the vertical axis by 100.

chart.draw(data, {vAxis: {format:'#%'} } );

To fix this i tried the following, i have escaped the % by quotes in options, this works
chart.draw(data, {vAxis: {format: '#\'%\''} } );

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.

Bookmark and Share


mrkdvsn February 11, 2020 at 12:08 AM  

Happy to found this blog. I have some facts related to this blog and I would like to share with all its readers. Definitely it is going to help everyone and aware people with some more knowledgeable points.bioresonantie haarlem

Post a Comment

Tech World

Label Cloud

Must Buy

  © Blogger templates by updated with tips

Back to TOP