<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Proc Sgplot vbar datalabel formatting problem when group= in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652308#M19984</link>
    <description>&lt;P&gt;Hi, I would like to format the datalabel without formatting the axis values. I have used a different variable to store the format, but it does not seem to work when using group=. Here is my code.&lt;/P&gt;&lt;PRE&gt;proc format;
   picture thousand low-high='000,009.99 K$' ;
   picture thousandRound low-high='000,009' ;
run;

data TeamMap;
input id $ value &amp;amp; :$25. fillcolor :$8.;
datalines;
Team Atlanta        CX00061c 
Team Baltimore      cx000d38 
Team Boston         CX001455 
Team California     CX001b71 
Team Chicago        CX00228d 
Team Cincinnati     Cx0029aa 
Team Cleveland      CX0030c6 
Team Detroit        CX0037e2 
Team Houston        CX003eff 
Team Kansas City    CX1c53ff 
Team Los Angeles    CX3868ff 
Team Milwaukee      CX557efe 
Team Minneapolis    CX7193ff 
Team Montreal       CX8da9ff 
Team New York       CXa9beff 
Team Oakland        CXc6d4ff 
Team Philadelphia   CXe2e9ff 
Team Pittsburgh     CXf6f8ff
Team San Diego      CXfff6f8
Team San Francisco  CXffdde4
Team Seattle        CXffc3d0
Team St Louis       CXffaabd
Team Texas          CXff91a9
Team Toronto        CXff7795
;
run;

data have;
retain Team Salary Salary_F Salary_F2;
	set sashelp.baseball;
	salary_F = salary;
	salary_F2 = salary;
	format salary_F thousand. salary_f2 thousandRound.;
run;

proc sgplot data=have dattrmap=TeamMap noautolegend;
    vbar Team / response=salary_F2 datalabel=salary_F group=Team attrid=Team outlineattrs=(color=black);
	xaxis discreteorder=data;
run;&lt;/PRE&gt;&lt;P&gt;If I don't specify a variable, I don't have the right format but the datalabel is displayed. If I specify a variable, the datalabel is not showing unless I remove the group= option. I do need the group= option to specify the fill color using a dattrmap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any solution that allows me to use two different formats plus a specific fill color maping is welcome.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2020 17:09:56 GMT</pubDate>
    <dc:creator>emiliepcantin</dc:creator>
    <dc:date>2020-06-01T17:09:56Z</dc:date>
    <item>
      <title>Proc Sgplot vbar datalabel formatting problem when group=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652308#M19984</link>
      <description>&lt;P&gt;Hi, I would like to format the datalabel without formatting the axis values. I have used a different variable to store the format, but it does not seem to work when using group=. Here is my code.&lt;/P&gt;&lt;PRE&gt;proc format;
   picture thousand low-high='000,009.99 K$' ;
   picture thousandRound low-high='000,009' ;
run;

data TeamMap;
input id $ value &amp;amp; :$25. fillcolor :$8.;
datalines;
Team Atlanta        CX00061c 
Team Baltimore      cx000d38 
Team Boston         CX001455 
Team California     CX001b71 
Team Chicago        CX00228d 
Team Cincinnati     Cx0029aa 
Team Cleveland      CX0030c6 
Team Detroit        CX0037e2 
Team Houston        CX003eff 
Team Kansas City    CX1c53ff 
Team Los Angeles    CX3868ff 
Team Milwaukee      CX557efe 
Team Minneapolis    CX7193ff 
Team Montreal       CX8da9ff 
Team New York       CXa9beff 
Team Oakland        CXc6d4ff 
Team Philadelphia   CXe2e9ff 
Team Pittsburgh     CXf6f8ff
Team San Diego      CXfff6f8
Team San Francisco  CXffdde4
Team Seattle        CXffc3d0
Team St Louis       CXffaabd
Team Texas          CXff91a9
Team Toronto        CXff7795
;
run;

data have;
retain Team Salary Salary_F Salary_F2;
	set sashelp.baseball;
	salary_F = salary;
	salary_F2 = salary;
	format salary_F thousand. salary_f2 thousandRound.;
run;

proc sgplot data=have dattrmap=TeamMap noautolegend;
    vbar Team / response=salary_F2 datalabel=salary_F group=Team attrid=Team outlineattrs=(color=black);
	xaxis discreteorder=data;
run;&lt;/PRE&gt;&lt;P&gt;If I don't specify a variable, I don't have the right format but the datalabel is displayed. If I specify a variable, the datalabel is not showing unless I remove the group= option. I do need the group= option to specify the fill color using a dattrmap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any solution that allows me to use two different formats plus a specific fill color maping is welcome.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 17:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652308#M19984</guid>
      <dc:creator>emiliepcantin</dc:creator>
      <dc:date>2020-06-01T17:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot vbar datalabel formatting problem when group=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652322#M19985</link>
      <description>&lt;P&gt;The reason why is appearing in your log. You should see something like:&lt;/P&gt;
&lt;PRE&gt;NOTE: DATALABEL= option is supported with GROUP= option only when GROUPDISPLAY=CLUSTER option is
      specified. The label will not be drawn.

&lt;/PRE&gt;
&lt;P&gt;So you need a slightly different plot.&lt;/P&gt;
&lt;P&gt;Consider:&lt;/P&gt;
&lt;PRE&gt;proc summary data=sashelp.baseball nway;
   class team;
   var salary;
   output out=summary sum=salary_f2;
run;

proc sgplot data=summary dattrmap=TeamMap noautolegend;
    vbarbasic Team / response=salary_F2  
            group=Team attrid=Team outlineattrs=(color=black)
            
   ;
   scatter x=team y=salary_f2 /datalabel ;
   format salary_f2 thousandround.;
	xaxis discreteorder=data;
run;&lt;/PRE&gt;
&lt;P&gt;which uses summary to the sums of salaries by team and with a VBARBASIC plot you can overlay another.&lt;/P&gt;
&lt;P&gt;Size and color ranges mean that, at least with my defaults, some of the text isn't readable due to the segment colors and spacing.&lt;/P&gt;
&lt;P&gt;But this may get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 18:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652322#M19985</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-01T18:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot vbar datalabel formatting problem when group=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652323#M19986</link>
      <description>&lt;P&gt;On the VBAR statement, set GROUPDISPLAY=CLUSTER, and the labels should appear as you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 18:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652323#M19986</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-06-01T18:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sgplot vbar datalabel formatting problem when group=</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652328#M19987</link>
      <description>That is a good solution for my problem ! Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 01 Jun 2020 18:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Sgplot-vbar-datalabel-formatting-problem-when-group/m-p/652328#M19987</guid>
      <dc:creator>emiliepcantin</dc:creator>
      <dc:date>2020-06-01T18:30:41Z</dc:date>
    </item>
  </channel>
</rss>

