Dynamic Icons with color, size, text and font properties

1,920 views
Skip to first unread message

Scott H

unread,
Nov 17, 2010, 2:04:53 PM11/17/10
to Google Chart API
I've been reviewing the options for dynamic pins at
http://code.google.com/apis/chart/docs/gallery/dynamic_icons.html#pins
and can't seem to figure out a URL that meets all my needs. I think
the chst=d_map_spin is closest, but cannot figure out one thing. I
need to be able to set...
- primary color (they all seem to handle this)
- size (the scalable pins seem to be the only way to go)
- text label (I am still good with the scalable pins)
- font size (I am still good with the scalable pins)
- font color( d'oh! I want a way to use white font if I think it will
look better)

Check out the URL below. It's SO close to what I need, but cannot
figure out a way to get the font white. Perhaps there is an
undocumented hack?
http://chart.apis.google.com/chart?chst=d_map_spin&chld=2.1|0|FF8429|13|b|123

Alternative:
Going through the MapIconMaker code, I found an example more like
below. From what I've read, this is more of an internal-to-Google
used way of doing it. I got most of the URL figured out, but cannot
figure out how to set width and height **in the URL**

http://chart.apis.google.com/chart?cht=d&chdp=mapsapi&chl=pin'i\'[10'-3'f\hv'a\]h\]o\0a859c'fC\ffffff'tC\000000'eC\Lauto'f\&ext=.png

Roger Trias Sanz

unread,
Nov 22, 2010, 2:01:33 PM11/22/10
to google-c...@googlegroups.com

Hi Scott,

Glad that you were able to make it that far! Unfortunately, as you've already found out, there is no way, using "chst", to get the results that you want.
There is, indeed, an undocumented hack; please try a URL like this one:
http://chart.apis.google.com/chart?cht=d&chdp=public&chld=2.1|0|FF8429|15|b|00FFFF|123&chl=[v_maps_pin%270r\0r\1r\vi%27\2r\fC\[6..%27r\]ha\V\[=%273r\]sc%27\f\4r\f\5r\tC\va\]o\ba\
where the contents of the "chld" argument are the same as for "d_map_spin", except that there's a new value in the 6th position that is the text color. There is another solution that is similar to what you found with the MapIconMaker, but I think that this one is easier to use because the data is separate.

Happy charting!

--Roger

 

--
You received this message because you are subscribed to the Google Groups "Google Chart API" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to google-chart-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-chart-api?hl=en.




--
Google Switzerland GmbH  - Identifikationsnummer: CH-020.4.028.116-1


Reply all
Reply to author
Forward
0 new messages