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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

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

3 REPLIES 3
Jay54
Meteorite | Level 14

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.

TKrueger
Calcite | Level 5

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.

TKrueger
Calcite | Level 5

Hi Sanjay,

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

Regards,

T.K.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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