BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Anita_n
Pyrite | Level 9

Dear all, 

am tring to use color grading shades  for the map I created but it's not showing any results. Am not sure if I have missing anything in my code. I will appreciate any help

proc template;
define style styles.grad1;
parent=styles.listing;
style threecolorramp /startcolor=cream endcolor=darkblue;
end;
run;

proc gmap data=mydata map=mapsgfk.germany all; 
id id;
choro cases / statistic=first discrete 
levels=4
coutline=gray anno=myanno
cdefault=CXFFFFFF
legend=legend1;
run;
quit;
1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

Hmm ... I'm not sure if levels=4 and discrete can be used together(?)

Rather than "statistic=first discrete levels=4", try just "levels=4".

 

What does your data look like?

View solution in original post

10 REPLIES 10
Anita_n
Pyrite | Level 9

you mean this?

 

ods listing style=styles.grad1;
ods html style=styles.grad1;

 

yes I tried that but I get colors like red green yellow etc. Although they are not included

GraphGuy
Meteorite | Level 14

Try twocolorramp, rather than threecolorramp.

 

Anita_n
Pyrite | Level 9

@GraphGuy This is the code I used but unfortunately no changes. Attached is my data

legend1 label =(position=top j=c h=10pt "Number of cases" )
        value=(f="Arial" h=8pt c=black justify=left)
		origin=(78,18)
		across=1
		position= (right middle)
		offset=(0.5)
		space=1
		mode=reserve
		shape= bar(.17in,.13in )/*width and height*/
		;

proc template;
define style styles.grad1;
parent=styles.listing;
style twocolorramp /startcolor=cream endcolor=darkblue;
end;
run;

ods listing style=styles.grad1;
ods html style=styles.grad1;
proc gmap data=mydata map=mydata all; 
id id;
choro cases/ statistic=first discrete 
levels=4
coutline=gray anno=myanno
cdefault=CXFFFFFF
legend=legend1;
run;
quit;

 

GraphGuy
Meteorite | Level 14

Hmm ... I'm not sure if levels=4 and discrete can be used together(?)

Rather than "statistic=first discrete levels=4", try just "levels=4".

 

What does your data look like?

Anita_n
Pyrite | Level 9

@GraphGuy thanks it worked. I deleted discrete.

Anita_n
Pyrite | Level 9

@GraphGuy  here is my data

the map data is mapsgfk.germany and  mapsgfk.germany_attr

GraphGuy
Meteorite | Level 14

Let's stick with one question per thread - this thread was for getting the gradient colors working, and we got that part working 🙂

 

Please start a fresh question/thread for the next question.

Anita_n
Pyrite | Level 9

okay

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1677 views
  • 2 likes
  • 3 in conversation