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

Hello All,

I have following code,

DATA usedata;

INPUT slicenm $ 1-8 val;

DATALINES;

Slice A  4.5

Slice B  5.8

Slice C  7.2;

RUN;

PROC TEMPLATE;

  DEFINE statgraph piechart;

  DYNAMIC _name _value;

  BEGINGRAPH;

  LAYOUT LATTICE;

  LAYOUT REGION;

  piechart category=_name response=_value / dataskin=sheen datalabellocation=inside;

  ENDLAYOUT;

  ENDLAYOUT;

  ENDGRAPH;

END;

RUN;

PROC SGRENDER DATA=usedata TEMPLATE=piechart;

  DYNAMIC _name="slicenm" _value="val";

RUN;

How can I explode specific slice on piechart using GTL? Can you please help me?

My expected output is like following:

post.png

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

There is no built-in easy way to explode a slice in GTL.  I suggest using PROC GCHART, with the PIE statement and EXPLODE option.

View solution in original post

2 REPLIES 2
Jay54
Meteorite | Level 14

There is no built-in easy way to explode a slice in GTL.  I suggest using PROC GCHART, with the PIE statement and EXPLODE option.

zahirraihan
Calcite | Level 5

Thanks Sanjay, your answer makes me clear about this option in GTL as I thought earlier there might have way in GTL to do it which I could not able to find out. I did this as following way based on your suggestion,

DATA usedata;

INPUT slicenm $ 1-8 val;

DATALINES;

Slice A  4.5

Slice B  5.8

Slice C  7.2

;

RUN;

GOPTIONS DEVICE=png;

PROC GCHART DATA=usedata;

PIE slicenm / TYPE=SUM SUMVAR=val

EXPLODE="Slice A" ANGLE=0 ASCENDING NOHEADING 

VALUE=inside SLICE=outside; 

RUN;

QUIT;

Thanks for your suggestion also.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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