Data visualization with SAS programming

Setting GraphData Styles in Proc Template

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Setting GraphData Styles in Proc Template

Hi Community,

I've got a question concerning the Graphdata Option.

I want to create a graphical chart withvectorplots and scatterplots.

The vectorplotlines should have a different thickness for every group (I've got five).

I've created a style which should do this and if I'm changing the Linestyle option everything works fine for me, but it won't accept the linethickness and color attribute changes.

Has anyone an idea how to solve this problem? Code is attached below.

Thanks in advance!

Greetings,

T.K.

ODS GRAPHICS ON / IMAGEMAP=YES;

ODS HTML style=styles.vw;

proc template;

    define style styles.vw;

        parent=styles.default;

        *class GraphDataDefault /  linethickness=5px;

        class Graphdata1 / Linestyle=2 linethickness=5px;

        class Graphdata2 / Linestyle=1 linethickness=4px;

        class Graphdata3 / Linestyle=1 linethickness=3px;

        class Graphdata4 / Linestyle=1 linethickness=2px;

        class Graphdata5 / Linestyle=1 linethickness=1px;

    end;

   

  define statgraph diagonal;

    begingraph;

        layout overlay / xaxisopts=(display=none) yaxisopts=(display=none);

            vectorplot x=x1 y=y1 xorigin=x yorigin=y / arrowheads=FALSE GROUP=grouping index=grouping ROLENAME=(TIP1=capacity) TIP=(TIP1);

            scatterplot x=x y=y / datalabel=regionid datalabelposition=TOP;

            scatterplot x=x1 y=y1 / datalabel=toregionid datalabelposition=TOP;

        endlayout;

      endgraph;

   end;

run;

proc sgrender data=vw.test template=diagonal;

run;


Accepted Solutions
Solution
‎02-15-2013 08:54 AM
SAS Super FREQ
Posts: 1,081

Re: Setting GraphData Styles in Proc Template

Line thickness and marker size are ignored for GRAPHDATA1 - N.  This is because these style elements are used for groups that are supposed to be visually distinct, but also equal in weight.  So, line color and pattern are supported, and marker symbol and color are supported.

The way to get different line thicknesses for each vector is to use 5 separate vector plots, one for each vector, and set their thicknesses individually in the plot statement LINEATTRS.

View solution in original post


All Replies
Solution
‎02-15-2013 08:54 AM
SAS Super FREQ
Posts: 1,081

Re: Setting GraphData Styles in Proc Template

Line thickness and marker size are ignored for GRAPHDATA1 - N.  This is because these style elements are used for groups that are supposed to be visually distinct, but also equal in weight.  So, line color and pattern are supported, and marker symbol and color are supported.

The way to get different line thicknesses for each vector is to use 5 separate vector plots, one for each vector, and set their thicknesses individually in the plot statement LINEATTRS.

New Contributor
Posts: 3

Re: Setting GraphData Styles in Proc Template

Hello Sanjay,

thanks for the quick reply.

I will try to do this on Monday and will let you know if it was successfull!

Thanks and have a nice weekend!

T.K.

New Contributor
Posts: 3

Re: Setting GraphData Styles in Proc Template

Hi Sanjay,

your solution worked perfectly fine for me, thanks a lot Smiley Happy

Regards,

T.K.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1269 views
  • 1 like
  • 2 in conversation