Search code examples
apichartsgoogle-visualizationnumber-formatting

How do you set percentage in Google Visualization Chart API?


How do you set the vertical axis to display percent such as 25%, 50%, 75%, 100%?


Solution

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

    To get comma for thousands, use {format:'#,###%'}.

    See http://code.google.com/apis/chart/interactive/docs/gallery/linechart.html