title: Change color of certain bars in proc sgplot vbar
body: <p>I am using SAS 9.3
  How can I change colors of bars in proc sgplot vbar.</p>
  
  <p>This is what I want but I would like to have s2 and s5 to have different color in the plot. Preferably there should be legend as well.:</p>
  
  <pre><code>data gr;
      input x $ y  groupvar $;
      datalines;
      s1 20 a
      s2 20 b
      s3 30 a
      s4 25 a
      s5 45 b
      ;
  run;
  
  proc sgplot data=gr;
      vbar x /response=y CATEGORYORDER=RESPDESC ;
  run;
  </code></pre>
  
  <p>This produces what I want except now my CATEGORYORDER statement gets ignored:</p>
  
  <pre><code>proc sgplot data=gr;
      vbar x /response=y group=groupvar CATEGORYORDER=RESPDESC ;
  run;
  </code></pre>
  
  <p>Then I have also tried this but it doesn't help anything.</p>
  
  <pre><code>proc sort data=gr;
      by groupvar;
  run;
  
  proc sgplot data=gr;
      vbar x /response=y group=groupvar GROUPORDER = DATA;
  run;
  </code></pre>
  
  <p>Comment:
  I am not sure if the group statement can help me here because it seems to be designed for the situations when there are actually all x-axis variables present in all of the groups. For example like this.</p>
  
  <pre><code>data gr;
      input x $ y  groupvar $;
      datalines;
      s1 20 a
      s1 20 b
      s2 30 a
      s2 25 b
      s3 10 a
      s3 12 b
      ;
  run;
  
  proc sgplot data=gr;
      vbar x /response=y group=groupvar GROUPDISPLAY=CLUSTER GROUPORDER = DATA;
  run;
  </code></pre>