(see code at the bottom) I build my own custom style ('mystyle') for the creation of graphs, but I don't seem to get my own user-defined style elements to work. I am using exactly the same syntax as used in the styles.default template source code, but even though my custom style element seems to be defined just fine, it drops following note and indeed uses the default style element (in this case 'GraphTitleText'): NOTE: The style element 'mygraphtitletext' in the option TEXTATTRS is invalid. The default will be used. I know there are several other alternatives that I could use (other than defining a custom style), e.g. changing the style element GraphTitleText itself in my custom style, but since I will be using this style in many other graphs and parts of a much more complex program, I really want to get this done in a user-defined style element. Example code: proc template;
define style mystyle;
parent=styles.default;
style myGraphFonts /
'myGraphTitleFont' = ("<sans-serif>, <MTsans-serif>",20pt,bold);
style myGraphColors /
'mygtext' = cx00FFFF;
style myGraphTitleText /
font = myGraphFonts('myGraphTitleFont')
color = myGraphColors('mygtext');
end;
run;
ods listing style=mystyle;
proc template;
define statgraph histogram;
begingraph;
entrytitle "title 1 test" / textattrs=myGraphTitleText;
entrytitle "title 2 test" / textattrs=GraphTitleText;
layout overlay;
histogram weight;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.class
template=histogram;
run; Output:
... View more