03-09-2015 09:49 AM
Hello, I need to create a bullet graph by category. I have actual sales and predicted sales for individual products and the are grouped by category. I would like to use different colors for each category and in the legend show only actual and predicted sales. When I used ssgpanel, the p[roblem I'm facing is that the products in one category is also appearing in other category. Please see below for a reproducible example. I'm using SAS 9.3.
My question is: how can I create a bullet graph by data driven color schemes ?
input cat $ product $ actual predict;
X A 10 5
X B 12 15
X C 15 18
X D 13 20
Y E 20 15
Y F 22 25
Y G 25 38
Y H 23 40
input id $ value $ fillcolor $;
my_id X blue
my_id Y red
proc sgpanel data = sales dattrmap=attrs;
PANELBY cat/LAYOUT= rowlattice;
hbar product/response = actual group = cat attrid=my_id ;
hbar product/response = predict group = cat BARWIDTH =0.2 FILLATTRS = (color = black) ;
Products E,F,G and H appear in cat x even though cat x does not have these products vice versa.
Need further help from the community? Please ask a new question.