-1

I am working with Google Charts. I need to add a '$' before the values on the y-axis as well as the value in the bubbles.

Is there a setting for this?

take care, lee

UPdate,

Here is the data being used by the charts:

'Month','Semi-Detached in Toronto E04','Semi-Detached in Toronto E08','Condominium Townhouse in Toronto E04','Condominium Townhouse in Toronto E08',                ],
                ['7/2011', 4354000,15305800,6776500,495000],['8/2011', 700000,10514418,7060786,0],['9/2011', 6854800,17805400,12087300,0],['10/2011', 7287400,14248900,16206500,0],['11/2011', 2696245,9733270,12698090,0],['12/2011', 1965800,6054500,8854390,0],['1/2012', 2450968,9012200,5500100,0]             ]);

I've tried adding '$' before the values as well as '%24' as suggested before, but both throw syntax errors. And the values cannot be quoted without throwing a Google Charts error ' Data column(s) for axis #0 cannot be of type string×'.

Thanks everyone for your input. I found a question that was 99.9% the same: How to set tooltips to display percentages to match axis in Google Visualization Line Chart?

Community
  • 1
  • 1
Lee Loftiss
  • 3,035
  • 7
  • 45
  • 73
  • What do you need code for? There either is or isn't a setting for this in Google Charts. – Lee Loftiss Mar 26 '13 at 14:12
  • Were you putting the $ on the numeric values, or in the strings ? – SteveP Mar 26 '13 at 14:22
  • I'm not sure what strings you might be talking about. The values are numeric. Knowing this, I tried to add the $ and put quotes around the values anyway just to see what would happen. SInce the values are numeric, it seems adding a '$' would be an option somewhere, but I cannot find anything like that. I found something about value formatting but that does not seem to apply to Bar charts and line graphs. – Lee Loftiss Mar 26 '13 at 14:27
  • possible duplicate of [How to set tooltips to display percentages to match axis in Google Visualization Line Chart?](http://stackoverflow.com/questions/6724451/how-to-set-tooltips-to-display-percentages-to-match-axis-in-google-visualization) – Lee Loftiss Mar 26 '13 at 15:05

2 Answers2

1

Try using %24 which is the urlencoded form for $.

SteveP
  • 18,840
  • 9
  • 47
  • 60
0

Use:

var formatter = new google.visualization.NumberFormat({prefix: '$'});

Check the example here:

https://developers.google.com/chart/interactive/docs/examples#interaction_example

More details here:

https://developers.google.com/chart/interactive/docs/reference#numberformatter

Khrys
  • 2,670
  • 9
  • 49
  • 82