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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 3 replies
  • 4398 views
  • 1 like
  • 2 in conversation