A quick followup on the Google charts I covered last week. They have a chart type that Publisher does not support out of the box - that is Maps. Not your regular Google Maps (saving those for another day) but color coded static maps. Oracle does have its MapViewer solution that will be more powerful certainly and I intend to cover that another day too. For now I thought I would try and get to grips with the Google versions.
Getting to grips is a good expression here, they are not as easy as they might be, but they follow the same pattern as the other charts with a twist. Here's what we want.
<xsl:variable name="vState"> <xsl:for-each select=".//Row[position() > 1]"> <xsl:value-of select="Data[2]"/> </xsl:for-each> </xsl:variable>The chd string holds the data for the states. Google needs you to encode your data, its not enough to pass a comma delimited list. Im not going to get into it here, suffice to say I did the encoding in the data layer. I took the raw population data and rounded it to the nearest million e.g. CA=37 and then mapped 37 to the alpha character Google supports, this happens to be 'i' - its all covered in their web pages. Once I had these two pieces it was a case of concatenating the strings with the rest of the URL in a dummy image in the template:
url:{concat('http://chart.apis.google.com
/chart?chco=f5f5f5,edf0d4,6c9642,365e24,13390a&chd=s:',$dList,'&chf=bg,s,eaf7fe&
chtm=usa&chld=',$vState,'&chs=440x220&cht=t')}
and Bob's your long lost rich uncle! Here's my effort: