Hannoun Yassir
Hannoun Yassir

Reputation: 21202

how to display measuring unit with google chart api

i want to display the values on the y-axis with $ but i couldn't figure out how it is done. is it even possible? if yes please how can i do it? is it also possible to make use a gradient in bars ?

Upvotes: 2

Views: 1129

Answers (1)

moinudin
moinudin

Reputation: 138387

Define a format string in chxs. Use cUSD to format as US dollars.

Here's an example from the docs:

https://chart.googleapis.com/chart
    ?cht=s
    &chd=s:984sttvuvkQIBLKNCAIi,DEJPgq0uov17zwopQODS,AFLPTXaflptx159gsDrn
    &chxt=x,y,r
    &chxr=0,0,1000000,250000|1,0,60|2,0,5000
    &chxs=0N*e*,000000|1N*cUSD*Mil,FF0000|2N*sz2*,0000FF
    &chs=250x125

The relevant portion being chxs=...1N*cUSD*Mil,FF0000.

Upvotes: 2

Related Questions