02-27-2012 02:03 PM
Does anyone have any thoughts for generating tiny line plots to center on each state (in place of or along with a state abbreviation)? If I generated each little plot with a tiny x and y pixel size separately it seems like I could create an annotate data base that could include these just as one includes the state abbreviations - something similar to the pre and post image commands in ODS. Alternatively, has anyone had experience annotating unicode characters on a map - I could display a trend indicator using unicode characters if nothing else. The output will be PDF. Thanks in advance for any suggestions!
I will be trying to do a similar thing in PROC REPORT, annotating the little plots in one of the columns of the report.
03-05-2012 11:53 AM
I was hoping someone might have a slick/graceful/easy way to do this (maybe a macro or something)...
But since nobody has posted one up, I'll provide some info on how this could 'hypothetically' be done...
Similar to how you can annotate text on a GMap (using the annotate 'label' function), you can also annotate images on a GMap (using the 'image' function) ... in this case, the images would be very small GPlots that you have created ahead of time. The 'trick' (ie, the difficult part) is that you cannot easily center the image over the map areas like you can the text (using position='5').
With an annotated image, you must specify the bottom/left corner, and the top/right corner. Therefore the way to "center" an image on a certain location on a GMap is to first 'move' to the center (using xsys/ysys=2), and then change to the relative % coordinate system (xsys/ysys=9) and move a slight bit to the left & down for the bottom/left corner of the image, and then 2-times that offset amount for the top/right corner of the image. Here's an example (it annotates hockey team images instead of sparkline graph images)...
data logo_anno; set logo_anno (keep = x y x_offset y_offset country province city Teamname logo);
length function style $8 html $1000;
xsys='2'; ysys='2'; function='move'; output;
x=-2.0+x_offset; y=-2.5+y_offset; function='move'; output;
x=2.0*2; y=2.5*2; function='image'; imgpath=logo; style='fit'; output;
And the output it produces: