<?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 Re: chart in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622667#M183181</link>
    <description>&lt;P&gt;This is the chart that I made but i need to improve it.&lt;/P&gt;
&lt;P&gt;I need to add also information about ACTUAL field (one way is to add another bar for each month and second way is to create stack bar with information of ACTUAL and OFFERED fields)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=example_Summary_Info noborder;
    vbar month / response=OFFERED dataskin=pressed baselineattrs=(thickness=0) fillattrs=graphdata1 
            name='a' nostatlabel;
    vline month / response=PCT_USED y2axis lineattrs=(color=gold thickness=4) nostatlabel name='b';
    xaxis discreteorder=data display=(noline nolabel noticks);
    yaxis display=(noline noticks) grid label='(Millions USD)' values=(200 to 1000 by 50) offsetmin=0;
    y2axis display=(noline noticks) values=(0 to 1 by 0.05) offsetmin=0;
    keylegend 'a' 'b' / title='' linelength=24;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Feb 2020 11:29:07 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-02-06T11:29:07Z</dc:date>
    <item>
      <title>chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622663#M183178</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In this example there are 4 fields:&lt;/P&gt;
&lt;P&gt;Month- period of the informaton&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;ACTUAL- Sum of Loans that were taken in Millions of $&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;OFFERED-Sum of offers of loans that were given to customers in Millions of $&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;PCT_USED - percet of offers that were used by loans&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;I want to create a visual way (chart) to show this summary table.&lt;/P&gt;
&lt;P&gt;In the x-asix will be month&lt;/P&gt;
&lt;P&gt;In Y-axis1 will be amount in Millions of $&lt;/P&gt;
&lt;P&gt;In Y-axis2 will be PCT in %&lt;/P&gt;
&lt;P&gt;What is the best way to create for each month 2 bars (one for ACTUAL and second for OFFERED) and also create a line chart of PCT_USED?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is another good way to&amp;nbsp;&lt;STRONG&gt;represent the information then I will be happy to learn.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I also think of another way to show it:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;For each month will have 1 stack bar (with information about ACTUAL and&amp;nbsp; OFFERED) and also create a line chart of PCT_USED?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data example_Summary_Info;
Retain Month ACTUAL	OFFERED	PCT_USED;
informat PCT_USED percent9.1;
format  PCT_USED percent9.1;
Input Month $	ACTUAL	OFFERED	PCT_USED;
cards;
10/18 250 485 51.5%
11/18 432 860 50.2%
12/18 497 950 52.3%
01/19 483 898 53.8%
02/19 435 776 56.1%
03/19 436 784 55.6%
04/19 396 684 57.9%
05/19 486 831 58.5%
06/19 438 764 57.3%
07/19 461 821 56.2%
08/19 393 714 55.0%
09/19 377 668 56.4%
10/19 358 638 56.1%
11/19 411 713 57.6%
12/19 420 728 57.7%
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622663#M183178</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-06T11:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622665#M183180</link>
      <description>&lt;P&gt;This should get you started. Feel free to ask &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data example_Summary_Info;
Retain Month ACTUAL	OFFERED	PCT_USED;
informat PCT_USED percent9.1;
format  PCT_USED percent9.1;
Input Month $	ACTUAL	OFFERED	PCT_USED;
cards;
10/18 250 485 51.5%
11/18 432 860 50.2%
12/18 497 950 52.3%
01/19 483 898 53.8%
02/19 435 776 56.1%
03/19 436 784 55.6%
04/19 396 684 57.9%
05/19 486 831 58.5%
06/19 438 764 57.3%
07/19 461 821 56.2%
08/19 393 714 55.0%
09/19 377 668 56.4%
10/19 358 638 56.1%
11/19 411 713 57.6%
12/19 420 728 57.7%
;
Run;

data temp;
    set example_Summary_Info;
    p = OFFERED; group = "OFFERED"; output;
    p = actual;  group = "Actual";  output;
run;

proc sgplot data=temp;
    vbarparm category=Month response=p / group=group groupdisplay=cluster baselineattrs=(thickness=0) name='a';
    series x=Month y=PCT_USED / y2axis lineattrs=(color=gold thickness=4) name='b';
    xaxis display=(nolabel);
    keylegend / title="";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622665#M183180</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-06T11:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622667#M183181</link>
      <description>&lt;P&gt;This is the chart that I made but i need to improve it.&lt;/P&gt;
&lt;P&gt;I need to add also information about ACTUAL field (one way is to add another bar for each month and second way is to create stack bar with information of ACTUAL and OFFERED fields)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=example_Summary_Info noborder;
    vbar month / response=OFFERED dataskin=pressed baselineattrs=(thickness=0) fillattrs=graphdata1 
            name='a' nostatlabel;
    vline month / response=PCT_USED y2axis lineattrs=(color=gold thickness=4) nostatlabel name='b';
    xaxis discreteorder=data display=(noline nolabel noticks);
    yaxis display=(noline noticks) grid label='(Millions USD)' values=(200 to 1000 by 50) offsetmin=0;
    y2axis display=(noline noticks) values=(0 to 1 by 0.05) offsetmin=0;
    keylegend 'a' 'b' / title='' linelength=24;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622667#M183181</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-06T11:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622668#M183182</link>
      <description>&lt;P&gt;Did you try my code?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622668#M183182</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-06T11:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622670#M183183</link>
      <description>&lt;P&gt;It is great, Thank you.&lt;/P&gt;
&lt;P&gt;What about display ACTUAL and OFFERED together in one bar (stack bar).&lt;/P&gt;
&lt;P&gt;Do you think it is better ?&lt;/P&gt;
&lt;P&gt;What is the way to do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622670#M183183</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-06T11:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622671#M183184</link>
      <description>&lt;P&gt;Simply do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=temp;
    vbarparm category=Month response=p / group=group groupdisplay=stacked baselineattrs=(thickness=0) name='a';
    series x=Month y=PCT_USED / y2axis lineattrs=(color=gold thickness=4) name='b';
    xaxis display=(nolabel);
    keylegend / title="";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Whether it is better or not, it depends on what you want to show.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:36:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622671#M183184</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-06T11:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622674#M183186</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an attempt to achieve this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot;
	vbar month / response = ACTUAL legendlabel='Sum of Loans that were taken' ;
	vbar month / response = OFFERED barwidth=0.5 legendlabel='Sum of offers of loans that were given to customers';
	vline month / response = PCT_USED y2axis lineattrs=(color=gold thickness=3) legendlabel='% of offers that were used by loans';
	xaxis display=(noline noticks) label='(Month)' grid ;
	yaxis display=(noline noticks) label='(Millions of $)';
	y2axis display=(noline noticks) label='%' values=(0 to 1 by .05);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="white-space: pre; background-color: #eaeaea;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture d’écran 2020-02-06 à 12.43.20.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35882i3AFE1E20A8461308/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture d’écran 2020-02-06 à 12.43.20.png" alt="Capture d’écran 2020-02-06 à 12.43.20.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622674#M183186</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-06T11:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622676#M183187</link>
      <description>&lt;P&gt;There are some small features that I want to make from your code please.&lt;/P&gt;
&lt;P&gt;1-I want to change the label in Y-axis from "P" to "Amnt in millions $"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2-Below the chart I want to change the label of the yellow line from "PCT_USED" to "%Use"&lt;/P&gt;
&lt;P&gt;3-I want to add a title within the chart to "Loans/Offers by Month"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622676#M183187</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-06T11:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622678#M183188</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot;
	title "Loans/Offers by Month";
	vbar month / response = OFFERED legendlabel='Sum of offers of loans that were given to customers';
	vbar month / response = ACTUAL legendlabel='Sum of loans that were taken' ;
	vline month / response = PCT_USED y2axis lineattrs=(color=gold thickness=3) legendlabel='%Use';
	xaxis display=(noline noticks) label='Month' grid ;
	yaxis display=(noline noticks) label='Amnt in millions $';
	y2axis display=(noline noticks) label='%' values=(0 to 1 by .05);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622678#M183188</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-06T11:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622679#M183189</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;I see that&amp;nbsp; in your output there are 3 bar charts and not 2 ( and 2 of the 3 are same). why?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622679#M183189</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-06T11:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622681#M183190</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is actually what I get -&amp;gt; so 2 bar charts (overlayed) and one line&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2020-02-06 à 12.52.20.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35883i18B008D942A1A4C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture d’écran 2020-02-06 à 12.52.20.png" alt="Capture d’écran 2020-02-06 à 12.52.20.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 11:53:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/622681#M183190</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-06T11:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/chart/m-p/623384#M183522</link>
      <description>&lt;P&gt;Why are there 2 blue bar charts in same height??&lt;/P&gt;</description>
      <pubDate>Sun, 09 Feb 2020 08:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/chart/m-p/623384#M183522</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-09T08:17:35Z</dc:date>
    </item>
  </channel>
</rss>

