How do you set the vertical axis to display percent such as 25%, 50%, 75%, 100%?
Percentage is being automatically added to Google Pie charts tooltips, and there is no built-in option to remove it. However, you can use wpDataChart callbacks to tweak this. Charts usually support custom options appropriate to that visualization. You can use it for adding options that are available in Google Api.
The <div> element must have a unique id. Then load the Google Graph API: Load the Visualization API and the corechart package. Set a callback function to call when the API is loaded.
A pie chart, sometimes called a circle chart, is a way of summarizing a set of nominal data or displaying the different values of a given variable (e.g. percentage distribution). This type of chart is a circle divided into a series of segments.
var options = { title: 'Chart Title', vAxis: { minValue: 0, maxValue: 100, format: '#\'%\'' } };
Try escaping the % sign. I've used this to just append the % sign in the y axis.
chart.draw(data, {vAxis: {format:'#%'} } );
To get comma for thousands, use {format:'#,###%'}
.
See http://code.google.com/apis/chart/interactive/docs/gallery/linechart.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With