There is no way to make the charts dynamically shorten the axis values. The best you can do is modify your data to put it in the scale you want and then manually append the 'Million' in the axis format. Something like this:
// this assumes that you have already formatted the data in the DataTablevar view = new google.visualization.DataView(data);view.setColumns([0, { label: data.getColumnLabel(1), type: 'number', calc: function (dt, row) { // reformat the data in millions return {v: dt.getValue(row, 1) / 1000000, f: dt.getFormattedValue(row, 1)}; }}]);chart.draw(view, { vAxis: { // format the axis values to millions format: '### Million' }}); There is no way to have the charts change from millions to billions (or other values) without explicitly changing the format and redrawing (ie, the axis values can't be: ...800M, 900M, 1B, 1.1B...)
On Monday, June 18, 2012 6:12:05 PM UTC-4, Zhengli Sun wrote:
I have large numbers on Y axis in my data.
I want to make it show as 20Million instead of 20,000,000. How can I write the formatter?