title: Stacked bar chart with percentage
body: <p>Using Sas 9.3 I'm trying to do a stacked bar chart basing on some crosstab. I know, how to do it with 9.4, but in 9.3 it looks much more difficult to me.</p>
  
  <p>Let's say a I have such a crosstab (in wide form):</p>
  
  <pre><code>group    v1_0    v1_1
    A       12       88
    B       17       83
    C       29       71
  </code></pre>
  
  <p>As you can see - rows sum up to 100.</p>
  
  <p>Alternatively, I can have it in a long form:</p>
  
  <pre><code>group    v1    val
    A      0      12
    A      1      88
    B      0      17
    B      1      83
    C      0      29
    C      1      71
  </code></pre>
  
  <p>I tried, among others:</p>
  
  <pre><code>proc sgplot data=long_form_data;
      vbar val / groupdisplay=stack group=group response=v1;
  run;
  </code></pre>
  
  <p>But It does not produce anything sensible.</p>
  
  <p>I'll appreciate any help. Thanks in advance.</p>
  
  <p>EDIT:</p>
  
  <p>9.4 code would look probably like this:</p>
  
  <pre><code>proc sgplot data=long_form_data pctlevel=group;
      vbar val / groupdisplay=stack group=group response=v1;
  run;
  </code></pre>
  
  <p>And same chart made with Excel looks like below:</p>
  
  <p><a href="https://i.stack.imgur.com/dbPRX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dbPRX.png" alt="Example chart"></a></p>