Code trying to run, does not pickup the rangealtcolormodel colors.
proc template;
define statgraph ap01t;
begingraph / drawspace=datavalue;
* entrytitle "";
rangeattrmap name="densityrange" ;
range MISSING / rangealtcolor=gray ;
range MIN - MAX / rangealtcolormodel=(red orange yellow) ;
endrangeattrmap ;
rangeattrvar attrvar=rangevar var=ACT_CUST_OUT attrmap="densityrange";
layout overlayequated / equatetype=equate border=false
xaxisopts=(label=" " display=none)
yaxisopts=(label=" " display=none)
;
polygonplot x=X y=Y id=Shape / display=(fill)
COLORRESPONSE=rangevar
name="Shape"
;
polygonplot x=X y=Y id=Shape / display=(outline) OUTLINEATTRS=(color=black) group=Otln;
continuouslegend "Shape" / orient=vertical
location=outside valign=center halign=right
valuecounthint=10 title="Shape";
endlayout;
* entryfootnote halign=left "";
endgraph;
end;
run;
proc sgrender data=Shape template=ap01t;
run;
Since these are filled areas, use RANGECOLOR and RANGECOLORMODEL instead of use RANGEALTCOLOR and RANGEALTCOLORMODEL.
The answer is "Yes". Please attach full code with data to debug your case.
Had to generate some data since my data set has over 100,000 rows but this generated data set gives me the same result.
data Shape;
;
infile datalines delimiter='09'x dsd firstobs=1;
input Obs Otln id x y vrRng;
datalines;
1 1 1 0 0 10
2 1 1 20 0 10
3 1 1 20 30 10
4 1 1 0 30 10
5 1 1 0 0 10
6 1 2 30 0 5
7 1 2 50 0 5
8 1 2 40 30 5
9 1 2 30 0 5
10 1 3 60 0 15
11 1 3 80 5 15
12 1 3 80 15 15
13 1 3 70 30 15
14 1 3 60 30 15
15 1 3 60 0 15
16 1 4 30 40 25
17 1 4 50 40 25
18 1 4 40 70 25
19 1 4 30 40 25
20 1 5 0 50 10
21 1 5 20 50 10
22 1 5 20 80 10
23 1 5 0 80 10
24 1 5 0 50 10
25 1 3 60 50 .
26 1 3 80 55 .
27 1 3 80 65 .
28 1 3 70 80 .
29 1 3 60 80 .
30 1 3 60 50 .
;
Run;
proc template;
define statgraph Map01t;
begingraph / drawspace=datavalue;
* entrytitle "";
rangeattrmap name="densityrange" ;
range MISSING / rangealtcolor=gray ;
range MIN - MAX / rangealtcolormodel=(red orange yellow) ;
endrangeattrmap ;
rangeattrvar attrvar=rangevar var=vrRng attrmap="densityrange";
layout overlayequated / equatetype=equate border=false
xaxisopts=(label=" " display=none)
yaxisopts=(label=" " display=none)
;
polygonplot x=X y=Y id=id / display=(fill)
COLORRESPONSE=rangevar
name="Shape"
;
polygonplot x=X y=Y id=id / display=(outline) OUTLINEATTRS=(color=black) group=Otln;
continuouslegend "Shape" / orient=vertical
location=outside valign=center halign=right
valuecounthint=10 title="Shape";
endlayout;
* entryfootnote halign=left "";
endgraph;
end;
run;
proc sgrender data=Shape template=Map01t;
run;
Since these are filled areas, use RANGECOLOR and RANGECOLORMODEL instead of use RANGEALTCOLOR and RANGEALTCOLORMODEL.
Thanks that worked.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.