Hi!
I would like to create a pie chart with SAS but I have special needs.
In the graph it should be possible to change the colour of the text based on an independent variable.
What I want to achieve is shown below.
PROC GCHART can decide if the value are shown inside or outside the graph and the colours of them.
But what about a mixture of them, Is this possible with SAS system?
Is annotation dataset the only way to solve this problem?
Thank you in advance,
Best regards
Paolo
One way would be to annotate the text - then you have programmatical control over exactly what the label says, and also the exact color.
To do that, you'll probably need to use the cntl2txt annotate function (in combination with others), as described here (note this example annotates both the pie, and the label):
Using cntl2txt is a bit 'tricky' (I'm not very good with it, and I don't think I have any examples of using it to label a pie chart).
One way would be to annotate the text - then you have programmatical control over exactly what the label says, and also the exact color.
To do that, you'll probably need to use the cntl2txt annotate function (in combination with others), as described here (note this example annotates both the pie, and the label):
Using cntl2txt is a bit 'tricky' (I'm not very good with it, and I don't think I have any examples of using it to label a pie chart).
Hi Robert and thank you for your fast answer!
As you said I don't think there are other ways than create an annotation dataset with all the informations about slice colors, label and everything else.
I've found this paper on the net and it seems to be a very nice starting point.
http://www.mwsug.org/proceedings/2011/coders/MWSUG-2011-CC13.pdf
Br
Paolo
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.