Having subjid was a bad idea, it tried to cram all 33 values of subjid into each panel. So I added a count variable to the dataset that is just 1 to whatever of subjects in the cohort. That comes a little bit better (just substituting count for subjid in the above code).
I figured I'd attempt GTL to see if I could get more control over the x-axis, but it didn't really work any better.
Too bad I can't get a combo of the two. Equal spacing for each subjid over the entire axis (like the gchart) but paneling so that I don't need color or fill attributes to distinguish the cohorts (like the sgpanel). I can't do unequal-sized panels, can I?
Thanks very much! This gives me two workable solutions without resorting to Excel, which is how these were done previously.
Based on input from others, I'm basically using your code. I needed to sort the bars within values of armcd, so this is where I am right now.
axis2 label=none minor=none offset=(0,0) order=(-100 to 100 by 10);
axis3 label=none minor=none offset=(0,0);
proc gchart data=mydataset;
format armcd armfmt.;
vbar newid / type=sum sumvar=pchg group=armcd nozero subgroup=armcd
maxis=axis1 raxis=axis2 ascending nolegend gaxis=axis3 ;
note move=(6,6.5) "Subjects with a percent change of 0 have no bar.";
I added the gaxis to get rid of the label on the group. I gave the one zero-valued pchg a value of 0.00001 so that it would appear in the chart. Newid is just the middle 3 digits of subjid (because that indicates the cohort).
The thing that would make this just right would be if I could embed a carriage return, line feed (simulate what a split character for a column header in proc report would do) into my formatted values of armcd, so it could say Cohort 1 and then on the next line, what the treatment group is, such as 200 mg. I tried putting in what I thought were the unicode values for CR+LF into one of the format values and didn't get anywhere. I'm pretty sure I don't get use unicode inside the graph elements. Any suggestions?
I don't think you can use the carriage-return character in this case.
But SAS/Graph gchart bar value do honor a 'split' character (specified in the axis statement). You can define a character as the 'split' character, and then put that character wherever you want in your text, so that it will split the text onto 2 lines accordingly.
Here is my slightly modified version of a Tech Support example: