<?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 --&amp;gt; change the font weight of a specific label of a bar chart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916303#M24350</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would want to know if it's possible to&amp;nbsp;change the font weight of a specific label of a bar chart.&lt;/P&gt;&lt;P&gt;My dataset is in an excel file.&lt;/P&gt;&lt;P&gt;My code is this currently this one:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgplot data=FINAL_RMT noborder ;&lt;BR /&gt;format pctn1 percentn.1 ;&lt;BR /&gt;hbar SRS_LIB_RGP_STD_COL_N2 / response=pctn1 group=SRS_LIB_TYP_ASS /*displaybaseline=auto*/ barwidth=0.6&lt;BR /&gt;seglabel /*datalabel*/ seglabelattrs=(size=10pt color=white) dataskin=pressed legendlabel="";&lt;BR /&gt;yaxis display=(noline noticks nolabel) values=("EFFECTIFS" "TOTAL POSTES" "Soins courants" "Pharmacie" "Optique" "Hospitalisation" "Dentaire" "Autres") valueattrs=(size=12pt);&lt;BR /&gt;xaxis display=none ;&lt;BR /&gt;keylegend / /*exclude=*/ location=outside position=bottomleft fillheight=10 fillaspect=2 noborder title="" valueattrs=(size=12pt) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would have to have EFFECTIFS in bold if it's possible.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output of proc sgplot" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93784i7D1C261B4C287108/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot_FINAL_RMT.png" alt="output of proc sgplot" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;output of proc sgplot&lt;/span&gt;&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 14:27:10 GMT</pubDate>
    <dc:creator>Mathassens</dc:creator>
    <dc:date>2024-02-15T14:27:10Z</dc:date>
    <item>
      <title>Proc sgplot --&gt; change the font weight of a specific label of a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916303#M24350</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would want to know if it's possible to&amp;nbsp;change the font weight of a specific label of a bar chart.&lt;/P&gt;&lt;P&gt;My dataset is in an excel file.&lt;/P&gt;&lt;P&gt;My code is this currently this one:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgplot data=FINAL_RMT noborder ;&lt;BR /&gt;format pctn1 percentn.1 ;&lt;BR /&gt;hbar SRS_LIB_RGP_STD_COL_N2 / response=pctn1 group=SRS_LIB_TYP_ASS /*displaybaseline=auto*/ barwidth=0.6&lt;BR /&gt;seglabel /*datalabel*/ seglabelattrs=(size=10pt color=white) dataskin=pressed legendlabel="";&lt;BR /&gt;yaxis display=(noline noticks nolabel) values=("EFFECTIFS" "TOTAL POSTES" "Soins courants" "Pharmacie" "Optique" "Hospitalisation" "Dentaire" "Autres") valueattrs=(size=12pt);&lt;BR /&gt;xaxis display=none ;&lt;BR /&gt;keylegend / /*exclude=*/ location=outside position=bottomleft fillheight=10 fillaspect=2 noborder title="" valueattrs=(size=12pt) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would have to have EFFECTIFS in bold if it's possible.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output of proc sgplot" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93784i7D1C261B4C287108/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot_FINAL_RMT.png" alt="output of proc sgplot" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;output of proc sgplot&lt;/span&gt;&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 14:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916303#M24350</guid>
      <dc:creator>Mathassens</dc:creator>
      <dc:date>2024-02-15T14:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot --&gt; change the font weight of a specific label of a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916335#M24353</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463540"&gt;@Mathassens&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can supply the individual label via an &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n17wm229xfidj7n1nfx67jsb3yj5.htm" target="_blank" rel="noopener"&gt;annotation dataset&lt;/A&gt; like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data anno;
function="text";
drawspace="datavalue";
x1=-0.105;
yc1="EFFECTIFS";
label="EFFECTIFS";
textweight="bold";
textsize=12;
width=50;
discreteoffset=-0.01;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n0n6uml63c6h8dn16phbd1arm9g9.htm#n1qrai0p2doumen1xmqctdgasflbb" target="_blank" rel="noopener"&gt;VALUESDISPLAY= option&lt;/A&gt; of the YAXIS statement to suppress the original label:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=FINAL_RMT noborder &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;sganno=anno&lt;/STRONG&gt;&lt;/FONT&gt;;
format pctn1 percentn.1 ;
hbar SRS_LIB_RGP_STD_COL_N2 / response=pctn1 group=SRS_LIB_TYP_ASS /*displaybaseline=auto*/ barwidth=0.6
seglabel /*datalabel*/ seglabelattrs=(size=10pt color=white) dataskin=pressed legendlabel="";
yaxis display=(noline noticks nolabel) values=("EFFECTIFS" "TOTAL POSTES" "Soins courants" "Pharmacie" "Optique" "Hospitalisation" "Dentaire" "Autres") valueattrs=(size=12pt)
                                &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;valuesdisplay=(" "         "TOTAL POSTES" "Soins courants" "Pharmacie" "Optique" "Hospitalisation" "Dentaire" "Autres");&lt;/STRONG&gt;&lt;/FONT&gt;
xaxis display=none ;
keylegend / /*exclude=*/ location=outside position=bottomleft fillheight=10 fillaspect=2 noborder title="" valueattrs=(size=12pt) ;

run;&lt;/PRE&gt;
&lt;P&gt;(That said, I wouldn't be surprised if one of the graph experts suggested a more elegant solution.)&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 17:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916335#M24353</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-15T17:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot --&gt; change the font weight of a specific label of a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916397#M24362</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='c:\temp\FINAL_RMT.xlsx' out=have dbms=xlsx replace;
run;
data dattrmap;
  length textweight $10;
  id='text'; value='EFFECTIFS'; textcolor='Black';textweight='bold'; output;
run;

proc sgplot data=have  dattrmap=dattrmap;
format pctn1 percent7.1 ;
hbarparm category=SRS_LIB_RGP_STD_COL_N2 response=PCTN1/group=SRS_LIB_TYP_ASS barwidth=0.6 dataskin=pressed
seglabel seglabelattrs=(size=10pt color=white) SEGLABELFITPOLICY=none ;

yaxistable SRS_LIB_RGP_STD_COL_N2  / location=outside position=left 
textgroup=SRS_LIB_RGP_STD_COL_N2 label=' ' textgroupid=text 
VALUEATTRS=(size=10pt) VALUEJUSTIFY=right;

yaxis display=(nolabel novalues);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1708058039650.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93816i8066007E95688BF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1708058039650.png" alt="Ksharp_0-1708058039650.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 04:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916397#M24362</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-02-16T04:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot --&gt; change the font weight of a specific label of a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916400#M24363</link>
      <description>&lt;P&gt;If you want SEGLABEL be BOLD, could try this one:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc import datafile='c:\temp\FINAL_RMT.xlsx' out=have dbms=xlsx replace;
run;
data want;
 set have;
 by SRS_LIB_RGP_STD_COL_N2 notsorted;
 if first.SRS_LIB_RGP_STD_COL_N2 then cum=0;
 x=cum+PCTN1/2;
 cum+PCTN1;
 format PCTN1 percent8.2;

 if SRS_LIB_RGP_STD_COL_N2='EFFECTIFS' then do;x1=x;x=.;end;
run;
proc sgplot data=want;
hbarparm category=SRS_LIB_RGP_STD_COL_N2 response=PCTN1/group=SRS_LIB_TYP_ASS barwidth=0.6 dataskin=pressed;
text x=x1 y=SRS_LIB_RGP_STD_COL_N2 text=PCTN1/strip contributeoffsets=none textattrs=(size=12pt color=white weight=bold);
text x=x y=SRS_LIB_RGP_STD_COL_N2 text=PCTN1/strip contributeoffsets=none textattrs=(size=10pt color=white weight=normal);
yaxis display=(nolabel );
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1708058734312.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93818i36BFB89C7B196584/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1708058734312.png" alt="Ksharp_1-1708058734312.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 04:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916400#M24363</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-02-16T04:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sgplot --&gt; change the font weight of a specific label of a bar chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916459#M24377</link>
      <description>Thanks you for yours answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 16 Feb 2024 14:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-gt-change-the-font-weight-of-a-specific-label-of-a/m-p/916459#M24377</guid>
      <dc:creator>Mathassens</dc:creator>
      <dc:date>2024-02-16T14:01:35Z</dc:date>
    </item>
  </channel>
</rss>

