<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc Gmap Hover Tooltip in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501278#M17114</link>
    <description>&lt;P&gt;Also I believe that the HTML= option in the choro statement is to specify tooltip text over boundary areas and not plotted points. I remember that was one hang up the first time around i was trying to plot annotated points with hover text.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 20:33:27 GMT</pubDate>
    <dc:creator>rcleven2</dc:creator>
    <dc:date>2018-10-03T20:33:27Z</dc:date>
    <item>
      <title>Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501272#M17111</link>
      <description>&lt;P&gt;I have posted on here before about adding Hover-Over tooltip text and I have been successful with the help of the community at adding it to my output. However, I have completed a new project and now for some reason I can not get the too-tip text to pop up. Attached if the graphic output that I get from my code. The hover text should appear over and identify the roadways. I have compared the current code i have for this project to other code i have done for completely different projects that still provide me with the desired outcome and I can not tell what I have done wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried inserting the Var= "title='" !!&amp;nbsp; !! "'" statement in at different points and different data sets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Boundary map data set, the road annotat dataset and the plotted points dataset. I just want the name of the roads (Variable "FULLNAME") to appear at hover test.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* MAP DATASET */
data cherokee_county_map;
	set map;
	where county =57;
run;
/* ROAD DATASET */
proc sort data=work.road;
	by linearid;
run;

%annomac()
data cherokee_map_roads;
	%dclanno
	set road;
	by linearid;
	html="title='" !! trim(left(fullname)) !! "'";
	%system(2,2,3)
	when='A';
	if first.linearid then function='MOVE';
		else function='DRAW';
	color='antiquewhite';
	size=.01;
	if rttyp='I' then
		do;
			color='crimson';
			size = .4;
		
		end;
	if rttyp='S' then 
		do;
			color='gold';
			size=.2;
		
		end;
run;
proc sort data=cherokee_map_roads;
	by size;
run;

/* DATA/Annotate DATASET */
data data1;
	set data;
	if county ne 57 then delete;
run; 
data annotate_district_dots(keep=x y state statecode county _status_ patient_id event_id sex race ethnicity dx collect_dt when text color style size xsys ysys hsys);
			%dclanno
			length text $60;
			set data1;
		/*	LABEL(x1, y1, text, color, ang, rot, ht, font, pos)*/
			%system(2,2,1);
			when='a';
			
			if sex = 1 then point='Q';
				else if sex = 2 then point="R";
			if dx='bad' then color='papb';
				else if dx='sucks' then color='ligb';
				else if dx='the worst' then color='coral';
				else color='mediumvioletred';
		%label(x,y,point,*,0,0,2,'Marker',5);
run;


data all_dxs;
	set work.annotate_district_dots;
	
run;


data annotations;
	set work.cherokee_map_roads work.all_dxs;
	html="title='" !! (trim(left(fullname))) !! "'";
run;



goptions reset=all device=png;
/*ods pdf file="c:\users\rgclevenger\desktop\SASoutput\Maps\tif_dot.pdf";*/
ods html path="c:\users\rgclevenger\desktop\SASoutput\Maps" (url=none) file="Tiffany_TO.html";

title "MAP OF CHEROKEE COUNTY";
title2 "Geo-Locating of all STD's in 2017";
proc gmap data=work.annotations map=cherokee_county_map all anno=work.annotations ;
	id state county;
	choro state /
					nolegend 
					stat=first 
					cempty=darkgray 
					woutline=1
					
					;	
	pattern1 v=s c=darkseagreen;
run;

ods _all_ close;
goptions reset=all;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 20:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501272#M17111</guid>
      <dc:creator>rcleven2</dc:creator>
      <dc:date>2018-10-03T20:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501275#M17112</link>
      <description>&lt;P&gt;It looks like your are missing the HTML= option on the CHORO statement to indicate the variable with the text to display.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 20:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501275#M17112</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-03T20:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501276#M17113</link>
      <description>&lt;P&gt;There most definitely is a variable in the Annotations DS named HTML and an example of what one observation may hold would be&amp;nbsp;title='Bluffs Pkwy'. If I put html=html in the Choro statement nothing happens. No error, No warning, no text. I have played around with naming it something different and even specifying the dataset that hold that variable in different positions whether it be the data= , map= or anno=. None of it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a protion of the code form a totally separate program that still works. The difference is in the one that works I have the text hover over plotted points at to here I want it to hover over the streets.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* MAP DATASET */
data districtmap;
	set map;
	where county in(57 111 123 213 227 313);
run;


/*ROADS* - Only need the roads that are located within the square window of the district */
data lat_long_road;
	set work.road;
	where x between -0.027927437 and -0.012479502 and y between 0.0244506075 and 0.0405140664;
run;
	proc sort data=work.districtmap ;
		by state county;
	run;
			/* Procedure that trims all roads that are not INSIDE the map area */
			proc ginside data=lat_long_road map=work.districtmap insideonly out=Georgia_roads;
				id state county;
			run;

%annomac()
					data district_roads;
						%dclanno
						set work.georgia_roads;
						by linearid;
						%system(2,2,3);
						when = 'b';
						if first.linearid then function='MOVE';
							else function='DRAW';
						if mtfcc='S1100' then do;
									color='tomato';
									size=.4;
								end;
							else if mtfcc='S1200' then do;
									color='lightseagreen';
									size=.1;
								end;
					run;

/* PATIENT DOTS*/
data district_data;
	set data;
	if county = 115 then delete;
	if county in(57 111 123 213 227 313) then output;
		else if county not in(57 111 123 213 227 313) and point='L' then output;	
run;

		data annotate_district_dots(keep=x y state statecode county _status_ urn patient_name patient_type html when text color style size xsys ysys hsys);
			%dclanno
			length text $60;
			length state_fips 5;
			set district_data;
			html="title='" !! trim(left(patient_name)) !! "'"; 
			where _status_="Found";
		/*	LABEL(x1, y1, text, color, ang, rot, ht, font, pos)*/
			%system(2,2,1);
			when='a';
			if patient_type="1" then color='crimson';
				else if patient_type="2" then color='goldenrod';
				else if patient_type="3" then color='dodgerblue';
			%label(x,y,point,*,0,0,3.5,'Special',5);
			output;
		run;
		data anno_size;
			set work.annotate_district_dots;
			if color='dodgerblue' then size=3;
			output;	
		run;	
			proc sort data=anno_size out=anno_nodup nodupkey;
				by urn;
			run;
				proc sort data=anno_nodup out=annotate_pt_loc ;
					by descending patient_type;
				run;

/*ROADS  +  DOTS*/;
data anna_tate;
	set annotate_pt_loc district_roads;
run;

/*Legend to show on map*/
data anno_legend;
	%dclanno
	length text $50;
	%system(3,3,1);
	%label(3,15,'L',crimson,0,0,6,'Special',5);
	%label(5,15,'New Positive',black,0,0,4,'Thorndale AMT',6);
	%label(3,10,'M',goldenrod,0,0,6,'Special',5);
	%label(5,10,'New to TLBC',black,0,0,4,'Thorndale AMT',6);
	%label(3,5,'J',dodgerblue,0,0,6,'Special',5);
	%label(5,5,'Previously Entered into Care',black,0,0,4,'Thorndale AMT',6);
	output;
run;


goptions reset=all device=png;
ods html path="c:\users\rgclevenger\desktop\SASoutput\Maps" (url=none) file="map.html";

proc gmap data=district_data map=districtmap all anno=anna_tate ;
	id state county;
	choro state /  nolegend 
					anno=anno_legend 
					stat=first 
					cempty=darkgray 
					woutline=1
					;	
	pattern1 v=s c=A90D9D733;
run;

ods _all_ close;
goptions reset=all;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 20:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501276#M17113</guid>
      <dc:creator>rcleven2</dc:creator>
      <dc:date>2018-10-03T20:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501278#M17114</link>
      <description>&lt;P&gt;Also I believe that the HTML= option in the choro statement is to specify tooltip text over boundary areas and not plotted points. I remember that was one hang up the first time around i was trying to plot annotated points with hover text.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 20:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501278#M17114</guid>
      <dc:creator>rcleven2</dc:creator>
      <dc:date>2018-10-03T20:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501300#M17115</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't spot anything odd in your program, but it's difficult to reply without running any code.&lt;/P&gt;
&lt;P&gt;I would:&lt;/P&gt;
&lt;P&gt;1- Post a bit of data so we can run your code.&lt;/P&gt;
&lt;P&gt;2- Look in the HTML page for any malformed HTML tag.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 23:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501300#M17115</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-03T23:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501468#M17116</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions reset=all device=png;

ods html path="c:\users\rgclevenger\desktop\SASoutput\Maps" (url=none) file="road_hover.html";

title "Map of Health Departments in Cherokee Co.";
title2 "with Hover Text for Roads";
proc gmap data=sascom.data map=sascom.cherokee_county_map all anno=sascom.annotate_cherokee_map_roads ;
	id state county;
	choro state /	anno=sascom.annotate_data	
					html= "?"
					nolegend 
					stat=first 
					cempty=darkgray 
					woutline=1
					
					;	
	pattern1 v=s c=darkseagreen;
run;

ods _all_ close;
goptions reset=all;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The code for Proc Gmap that I have been using and all the necessary data file.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The same Map Dataset&lt;/LI&gt;&lt;LI&gt;The same Road dataset with annotations &amp;lt;This is where the tooltip text should come from, Variable "FULLNAME"&amp;gt;&lt;/LI&gt;&lt;LI&gt;Sample Data&lt;/LI&gt;&lt;LI&gt;Sample Data with Annotations&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 04 Oct 2018 13:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501468#M17116</guid>
      <dc:creator>rcleven2</dc:creator>
      <dc:date>2018-10-04T13:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501487#M17117</link>
      <description>&lt;P&gt;Data sets in Excel format. I can not get them to upload as sas dataset files.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 13:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501487#M17117</guid>
      <dc:creator>rcleven2</dc:creator>
      <dc:date>2018-10-04T13:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501710#M17118</link>
      <description>&lt;P&gt;I did a few tests and annotate does not create the tooltip for lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote a macro that does it for you. I started playing with line tip styles, but can't really spend more time on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%macro lineplus(x1, y1, x2, y2, width, fillcolor, fillpattern, edgecolor, edgestyle, edgesize, tipstyle);
  %if ^%length(&amp;amp;width      ) %then %let width      = 1    ;
  %if ^%length(&amp;amp;fillcolor  ) %then %let fillcolor  = black;
  %if ^%length(&amp;amp;fillpattern) %then %let fillpattern= ms   ;
  %if ^%length(&amp;amp;edgecolor  ) %then %let edgecolor  = red  ;
  %if ^%length(&amp;amp;edgestyle  ) %then %let edgestyle  = 1    ;
  %if ^%length(&amp;amp;edgesize   ) %then %let edgesize   = 1    ;

  %local angle;
  %let angle=%sysfunc( atan2(&amp;amp;y2-&amp;amp;y1,&amp;amp;x2-&amp;amp;x1) ); 

  X = &amp;amp;x2.-sin(&amp;amp;angle.)*&amp;amp;width.; 
  Y = &amp;amp;y2.+cos(&amp;amp;angle.)*&amp;amp;width.;
  %poly2(X, Y, &amp;amp;fillcolor., &amp;amp;fillpattern., &amp;amp;edgestyle., &amp;amp;edgesize.);
  X = &amp;amp;x2.+sin(&amp;amp;angle.)*&amp;amp;width.; 
  Y = &amp;amp;y2.-cos(&amp;amp;angle.)*&amp;amp;width.;
  %polycont(X, Y, &amp;amp;edgecolor.);
  X = &amp;amp;x1.+sin(&amp;amp;angle.)*&amp;amp;width.; 
  Y = &amp;amp;y1.-cos(&amp;amp;angle.)*&amp;amp;width.;
  %polycont(X, Y, &amp;amp;edgecolor.);
  X = &amp;amp;x1.-sin(&amp;amp;angle.)*&amp;amp;width.; 
  Y = &amp;amp;y1.+cos(&amp;amp;angle.)*&amp;amp;width.;
  %polycont(X, Y, &amp;amp;edgecolor.);

  %if &amp;amp;tipstyle.=round %then 
  %slice(&amp;amp;x1., &amp;amp;y1., 0, 360, &amp;amp;width./2, &amp;amp;fillcolor., &amp;amp;fillpattern., 0);

%mend;        
  
data ANNO;  
  retain XSYS YSYS '1' HTML 'title="aa"';
  %lineplus(30, 30, 40, 40, 1); 
  %lineplus(10, 10, 20, 10, 1, green, ms, green, 1, 0, round);
run;  
 
goptions xpixels=500 ypixels=500;
proc ganno annotate =ANNO; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 226px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23791i3646BD1334B35E2B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 04:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501710#M17118</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-05T04:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Gmap Hover Tooltip</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501872#M17123</link>
      <description>&lt;P&gt;I appreciate it. I may have to find a different solution to the problem but this is definitely helpful. Im glad I know now that lines are the problem and not something I was doing in the code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 13:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Gmap-Hover-Tooltip/m-p/501872#M17123</guid>
      <dc:creator>rcleven2</dc:creator>
      <dc:date>2018-10-05T13:07:25Z</dc:date>
    </item>
  </channel>
</rss>

