<?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: How to use a line chart instead of a barchart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721382#M21091</link>
    <description>&lt;P&gt;Okay, i think i figured it out. The below worked for me.&lt;/P&gt;&lt;P&gt;@ DAN Thanks again for your help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph GRAPHY;
   begingraph;
      entrytitle 'SLEPT ';
      layout lattice / rowweights=(.65 .35);
         layout overlay;
	    SERIESPLOT x=Quarter y=percent / group=SLEPT datalabel=percent 
		display =all
		lineattrs = (thickness = 3 pattern=solid) 
		markerattrs=( symbol= circlefilled size=9 color= black) datalabelattrs=percent (size=8) name='b';
		discretelegend 'b'/location=outside 
							across =4
							autoalign =auto
							exclude =(" " ".");
	 endlayout;
	 layout overlay / xaxisopts=(type=discrete label='CY Quarter' 
                          display=(label)) walldisplay=none;
	    blockplot x=Quarter block=C_Count / class=Quarter display=(outline values label) 
                                              repeatedvalues=true;
	 endlayout;
      endlayout;
   endgraph;
   end;
run;


proc sgrender data=SLEPT template=GRAPHY;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2021 20:12:32 GMT</pubDate>
    <dc:creator>Scooby3g</dc:creator>
    <dc:date>2021-02-23T20:12:32Z</dc:date>
    <item>
      <title>How to use a line chart instead of a barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721336#M21084</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm new to using charts in sas. I want to have a line chart and a table below the chart. I used code from the following reference from the link: &lt;A href="https://support.sas.com/kb/49/697.html" target="_blank"&gt;https://support.sas.com/kb/49/697.html&lt;/A&gt; but instead of using a bar chart. I want to use a line chart so that each value for one of the variables ("Slept") is graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i replace "barchart" with something else to make this into a line graph? Thanks in advance for your thoughts and suggestions.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scooby3g_0-1614098949493.png" style="width: 729px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55085i3CD0BE76EE431642/image-dimensions/729x339?v=v2" width="729" height="339" role="button" title="Scooby3g_0-1614098949493.png" alt="Scooby3g_0-1614098949493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA Slept;
INPUT QUARTER SLEPT PERCENT C_Count;
DATALINES;
2019Q1	NA	5	6
2019Q2	NO	2	3
2019Q3	UKNOWN	6	8
2019Q4	YES	5	7
2020Q1	NA	5	6
2020Q2	NO	9	11
2020Q3	UKNOWN	5	6
2020Q4	YES	5	7
2019Q1	NA	0	
2019Q2	NO	17	
2019Q3	UKNOWN	0	
2019Q4	YES	83	
2020Q1	NA	0	
2020Q2	NO	14	
2020Q3	UKNOWN	14	
2020Q4	YES	71	
2019Q1	NA	0	
2019Q2	NO	100	
2019Q3	UKNOWN	0	
2019Q4	YES	0	
2020Q1	NA	0	
2020Q2	NO	0	
2020Q3	UKNOWN	0	
2020Q4	YES	100	
2019Q1	NA	0	
2019Q2	NO	0	
2019Q3	UKNOWN	0	
2019Q4	YES	100	
2020Q1	NA	0	
2020Q2	NO	0	
2020Q3	UKNOWN	0	
2020Q4	YES	100	
;
RUN;

proc template;
   define statgraph GRAPHY;
   begingraph;
      entrytitle 'SLEPT ';
      layout lattice / rowweights=(.65 .35);
         layout overlay;
	    barchart X=Quarter y=percent / group=SLEPT barlabel=true dataskin=gloss;
	 endlayout;
	 layout overlay / xaxisopts=(type=discrete label='Number per CY Quarter' 
                          display=(label)) walldisplay=none;
	    blockplot x=Quarter block=C_Count / class=Quarter display=(outline values label) 
                                              repeatedvalues=true;
	 endlayout;
      endlayout;
   endgraph;
   end;
run;
proc sgrender data=SLEPT template=GRAPHY;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2021 16:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721336#M21084</guid>
      <dc:creator>Scooby3g</dc:creator>
      <dc:date>2021-02-23T16:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a line chart instead of a barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721338#M21085</link>
      <description>&lt;P&gt;GTL supports a LINECHART statement. That should do what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 17:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721338#M21085</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2021-02-23T17:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a line chart instead of a barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721358#M21088</link>
      <description>&lt;P&gt;Hi Dan, Thanks for your response. It seems to work after i replaced "barchart" with "SERIESPLOT". However, I can't seem to get the labels and keylegend to show. Any suggestions or ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph GRAPHY;
   begingraph;
      entrytitle 'slept ';
      layout lattice / rowweights=(.65 .35);
         layout overlay;
	    SERIESPLOT x=Quarter y=percent / group=slept 
		lineattrs = (thickness = 3 pattern=solid) 
		markerattrs=( symbol= circlefilled size=9 color= white) datalabelattrs=(label (size=8)) name='b';
		discretelegend 'b'/location=inside
							across =1
							autoalign =auto
							exclude =(" " ".");
	 endlayout;
	 layout overlay / xaxisopts=(type=discrete label='Number per CY Quarter' 
                          display=(label)) walldisplay=none;
	    blockplot x=Quarter block=C_Count / class=Quarter display=(outline values label) 
                                              repeatedvalues=true;
	 endlayout;
      endlayout;
   endgraph;
   end;
run;


proc sgrender data=slept template=GRAPHY;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2021 18:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721358#M21088</guid>
      <dc:creator>Scooby3g</dc:creator>
      <dc:date>2021-02-23T18:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a line chart instead of a barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721364#M21089</link>
      <description>&lt;P&gt;Add the following option to the SERIESPLOT to get your curve labels:&lt;/P&gt;
&lt;P&gt;curvelabel=slept&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you saying you're not getting.a legend?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 18:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721364#M21089</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2021-02-23T18:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a line chart instead of a barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721375#M21090</link>
      <description>&lt;P&gt;Thanks Dan!!&lt;/P&gt;&lt;P&gt;I added the the suggestion but put "percent" instead of "slept" because i wanted the percentage to show. The legend appears now but not all of the labels for "Percent" appears. Below is the sas code with some changes.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scooby3g_0-1614107799753.png" style="width: 929px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55089iC37E0E16A76FD1F0/image-dimensions/929x625?v=v2" width="929" height="625" role="button" title="Scooby3g_0-1614107799753.png" alt="Scooby3g_0-1614107799753.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph GRAPHY;
   begingraph;
      entrytitle 'slept ';
      layout lattice / rowweights=(.65 .35);
         layout overlay;
	    SERIESPLOT x=Quarter y=percent / group=slept curvelabel=percent
		lineattrs = (thickness = 3 pattern=solid) 
		markerattrs=( symbol= circlefilled size=9 color= white) datalabelattrs=label (size=8)name='b';
		discretelegend 'b'/location=inside
							across =1
							autoalign =auto
							exclude =(" " ".");
	 endlayout;
	 layout overlay / xaxisopts=(type=discrete label='Number per CY Quarter' 
                          display=(label)) walldisplay=none;
	    blockplot x=Quarter block=C_Count / class=Quarter display=(outline values label) 
                                              repeatedvalues=true;
	 endlayout;
      endlayout;
   endgraph;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 19:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721375#M21090</guid>
      <dc:creator>Scooby3g</dc:creator>
      <dc:date>2021-02-23T19:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a line chart instead of a barchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721382#M21091</link>
      <description>&lt;P&gt;Okay, i think i figured it out. The below worked for me.&lt;/P&gt;&lt;P&gt;@ DAN Thanks again for your help.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph GRAPHY;
   begingraph;
      entrytitle 'SLEPT ';
      layout lattice / rowweights=(.65 .35);
         layout overlay;
	    SERIESPLOT x=Quarter y=percent / group=SLEPT datalabel=percent 
		display =all
		lineattrs = (thickness = 3 pattern=solid) 
		markerattrs=( symbol= circlefilled size=9 color= black) datalabelattrs=percent (size=8) name='b';
		discretelegend 'b'/location=outside 
							across =4
							autoalign =auto
							exclude =(" " ".");
	 endlayout;
	 layout overlay / xaxisopts=(type=discrete label='CY Quarter' 
                          display=(label)) walldisplay=none;
	    blockplot x=Quarter block=C_Count / class=Quarter display=(outline values label) 
                                              repeatedvalues=true;
	 endlayout;
      endlayout;
   endgraph;
   end;
run;


proc sgrender data=SLEPT template=GRAPHY;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 20:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-use-a-line-chart-instead-of-a-barchart/m-p/721382#M21091</guid>
      <dc:creator>Scooby3g</dc:creator>
      <dc:date>2021-02-23T20:12:32Z</dc:date>
    </item>
  </channel>
</rss>

