<?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 Juletip #19 - Spice up your bar charts with images in SAS Community Nordic</title>
    <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-19-Spice-up-your-bar-charts-with-images/m-p/850311#M405</link>
    <description>&lt;P&gt;&lt;FONT size="4" color="#000080"&gt;&lt;STRONG&gt;Want to make your charts more playful? Well, why not replace the bars with images!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;Let's start with a normal, and perhaps not so exciting bar chart.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Xmas;
  input Year Gifts;	
  datalines;
2017 11
2018 8
2019 12
2020 19
2021 5
;
run;&lt;BR /&gt;
/* Bar Chart */
ods graphics / reset width=600px height=400px imagename='Xmas gifts Bar Chart';
title;footnote; 
proc sgplot data=Xmas noborder noautolegend;
  vbar year / response=Gifts datalabel datalabelattrs=(size=12 weight=bold);
  xaxis display=(noticks noline nolabel) integer;
  yaxis display=(nolabel noticks noline) min=0 integer grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;And here is the resulting image. Perfectly fine.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Barchart med ram.png" style="width: 603px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78583iE5FE78DBA0D9F4E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Barchart med ram.png" alt="Barchart med ram.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;Now let's do a scatter plot using the &lt;STRONG&gt;SYMBOLIMAGE&lt;/STRONG&gt; statement, plotting out a suitable Santa instead of the bars.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;The image file&amp;nbsp;&lt;EM&gt;santa.png&lt;/EM&gt;&amp;nbsp;is not included in this article, so google and get yourself a nice&amp;nbsp;image or just take whatever you've got to test this out.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Add variable for position of the value (text statement) a bit above the image */
data Xmas_Image;
  set Xmas;
  Gifts_Text_location = Gifts+5;
run;

%let IMGPATH=%str(C:\temp);
ods graphics / reset width=600px height=400px imagename='Xmas gifts with image';
proc sgplot data=Xmas_Image noborder noautolegend;
  symbolimage name=Santa image="&amp;amp;IMGPATH.\santa.png";
  scatter x=Year y=Gifts / markerattrs=(symbol=Santa size=110);
  text x=Year y=Gifts_Text_location text=Gifts / textattrs=(size=20 weight=bold color=white) strip position=left backlight=0.75;
  xaxis display=(noticks noline nolabel) integer offsetmin=0.15 offsetmax=0.15;
  yaxis display=none offsetmin=0.2 offsetmax=0.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;And here we are!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Santa chart med ram.png" style="width: 599px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78582i9432E4725785AB0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Santa chart med ram.png" alt="Santa chart med ram.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jan 2023 14:36:03 GMT</pubDate>
    <dc:creator>DanielRingqvist</dc:creator>
    <dc:date>2023-01-02T14:36:03Z</dc:date>
    <item>
      <title>Juletip #19 - Spice up your bar charts with images</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-19-Spice-up-your-bar-charts-with-images/m-p/850311#M405</link>
      <description>&lt;P&gt;&lt;FONT size="4" color="#000080"&gt;&lt;STRONG&gt;Want to make your charts more playful? Well, why not replace the bars with images!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;Let's start with a normal, and perhaps not so exciting bar chart.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Xmas;
  input Year Gifts;	
  datalines;
2017 11
2018 8
2019 12
2020 19
2021 5
;
run;&lt;BR /&gt;
/* Bar Chart */
ods graphics / reset width=600px height=400px imagename='Xmas gifts Bar Chart';
title;footnote; 
proc sgplot data=Xmas noborder noautolegend;
  vbar year / response=Gifts datalabel datalabelattrs=(size=12 weight=bold);
  xaxis display=(noticks noline nolabel) integer;
  yaxis display=(nolabel noticks noline) min=0 integer grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;And here is the resulting image. Perfectly fine.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Barchart med ram.png" style="width: 603px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78583iE5FE78DBA0D9F4E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Barchart med ram.png" alt="Barchart med ram.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;Now let's do a scatter plot using the &lt;STRONG&gt;SYMBOLIMAGE&lt;/STRONG&gt; statement, plotting out a suitable Santa instead of the bars.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;The image file&amp;nbsp;&lt;EM&gt;santa.png&lt;/EM&gt;&amp;nbsp;is not included in this article, so google and get yourself a nice&amp;nbsp;image or just take whatever you've got to test this out.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Add variable for position of the value (text statement) a bit above the image */
data Xmas_Image;
  set Xmas;
  Gifts_Text_location = Gifts+5;
run;

%let IMGPATH=%str(C:\temp);
ods graphics / reset width=600px height=400px imagename='Xmas gifts with image';
proc sgplot data=Xmas_Image noborder noautolegend;
  symbolimage name=Santa image="&amp;amp;IMGPATH.\santa.png";
  scatter x=Year y=Gifts / markerattrs=(symbol=Santa size=110);
  text x=Year y=Gifts_Text_location text=Gifts / textattrs=(size=20 weight=bold color=white) strip position=left backlight=0.75;
  xaxis display=(noticks noline nolabel) integer offsetmin=0.15 offsetmax=0.15;
  yaxis display=none offsetmin=0.2 offsetmax=0.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;And here we are!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Santa chart med ram.png" style="width: 599px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78582i9432E4725785AB0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Santa chart med ram.png" alt="Santa chart med ram.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 14:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-19-Spice-up-your-bar-charts-with-images/m-p/850311#M405</guid>
      <dc:creator>DanielRingqvist</dc:creator>
      <dc:date>2023-01-02T14:36:03Z</dc:date>
    </item>
  </channel>
</rss>

