Data visualization with SAS programming

How to explode slice on pie chart using using GTL?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

How to explode slice on pie chart using using GTL?

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


Accepted Solutions
Solution
‎05-13-2015 08:50 AM
SAS Super FREQ
Posts: 1,040

Re: How to explode slice on pie chart using using GTL?

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


All Replies
Solution
‎05-13-2015 08:50 AM
SAS Super FREQ
Posts: 1,040

Re: How to explode slice on pie chart using using GTL?

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.

Occasional Contributor
Posts: 6

Re: How to explode slice on pie chart using using GTL?

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.

Post a Question
Discussion Stats
  • 2 replies
  • 472 views
  • 1 like
  • 2 in conversation