<?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 unending lines in the series plot of proc template in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768220#M21974</link>
    <description>&lt;P&gt;Dear Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is with regard to the unending lines issue observed in the proc template when i use the discreteattrmap. I want to use the discreteattrmap and still avoid the unending lines. Here is the sample code and dummy data, please let us know how i can avoid the unending lines.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data full_subset;
input RGROUP$      USUBJID$     AVISITN MONTH CHANGE;
cards;
dose1 00005 1 0 0
dose1 00005 2 1.3 1.639344262
dose1 00005 3 3.2 10.95081967
dose1 00006 1 0 0
dose1 00006 2 1.3 1.039344262
dose1 00006 3 3.2 16.95081967
;

proc sort data=full_subset;
by rgroup usubjid avisitn;
run;

proc template;
define statgraph sgplot;
begingraph / collation=binary dataContrastColors=( red orange green violet yellow grey ) dataSymbols=( EOT );
SymbolChar char=delta_u NAME=EOT / scale=1;
discreteattrmap name='TGROUPS';
value 'Treatment Ongoing' /markerattrs=(symbol=trianglerightfilled color=black size=12);
enddiscreteattrmap;
discreteattrvar attrvar=TGROUP1 var=TGROUP attrmap='TGROUPS';
discreteattrmap name='RGROUPS';

value 'dose1' /markerattrs=(symbol=squarefilled color=red size=12) Lineattrs=( Pattern=1 Thickness=2 color=red);
enddiscreteattrmap;

discreteattrvar attrvar=RGROUP1 var=rgroup attrmap='RGROUPS';

layout overlay / walldisplay=(fill) xaxisopts=( Label="Time since first dose date (months)" type=linear linearopts=(tickvaluesequence=(start=0 end=15 increment=0.5))) y2axisopts=(labelFitPolicy=Split) yaxisopts=( Label="Tumor size (% change from baseline)" labelFitPolicy=Split type=linear ) y2axisopts=(labelFitPolicy=Split);

SeriesPlot X=month Y=change /xaxis=x yaxis=y Group=RGROUP1 LineColorGroup=RGROUP1 MarkerColorGroup=RGROUP1 markersymbolgroup=rgroup1 display=(markers) LegendLabel="CHANGE" NAME="trt";

 Layout Gridded / Border=true autoalign=(topleft topright) valign=top;

Layout Gridded;

endlayout;

endlayout;

DiscreteLegend "trt" /*"b"*/ / Location=Inside across=1 type=marker halign=right Title ="Dose Level" ValueAttrs=( Size=5) Opaque=true titleattrs=(family="Arial" size=8pt) titleborder=true sortorder=ascendingformatted autoalign=(TOPRIGHT) order=rowmajor border=false valueattrs=(family="Arial" size=8pt) Opaque=true;

endlayout;

endgraph;
end;
run;

proc sgrender data=FULL_SUBSET template=sgplot  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jagadishkatam_0-1631850577419.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63677iFED2CF1E4FA2A249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_0-1631850577419.png" alt="Jagadishkatam_0-1631850577419.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;P&gt;What i am expecting is as below, where we can observe the unending lines but the legend is disturbed. I want the legend as dose1 with only 1 row&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="Jagadishkatam_1-1631850684319.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63678iB324512F241DE785/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_1-1631850684319.png" alt="Jagadishkatam_1-1631850684319.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 03:52:23 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2021-09-17T03:52:23Z</dc:date>
    <item>
      <title>unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768220#M21974</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is with regard to the unending lines issue observed in the proc template when i use the discreteattrmap. I want to use the discreteattrmap and still avoid the unending lines. Here is the sample code and dummy data, please let us know how i can avoid the unending lines.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data full_subset;
input RGROUP$      USUBJID$     AVISITN MONTH CHANGE;
cards;
dose1 00005 1 0 0
dose1 00005 2 1.3 1.639344262
dose1 00005 3 3.2 10.95081967
dose1 00006 1 0 0
dose1 00006 2 1.3 1.039344262
dose1 00006 3 3.2 16.95081967
;

proc sort data=full_subset;
by rgroup usubjid avisitn;
run;

proc template;
define statgraph sgplot;
begingraph / collation=binary dataContrastColors=( red orange green violet yellow grey ) dataSymbols=( EOT );
SymbolChar char=delta_u NAME=EOT / scale=1;
discreteattrmap name='TGROUPS';
value 'Treatment Ongoing' /markerattrs=(symbol=trianglerightfilled color=black size=12);
enddiscreteattrmap;
discreteattrvar attrvar=TGROUP1 var=TGROUP attrmap='TGROUPS';
discreteattrmap name='RGROUPS';

value 'dose1' /markerattrs=(symbol=squarefilled color=red size=12) Lineattrs=( Pattern=1 Thickness=2 color=red);
enddiscreteattrmap;

discreteattrvar attrvar=RGROUP1 var=rgroup attrmap='RGROUPS';

layout overlay / walldisplay=(fill) xaxisopts=( Label="Time since first dose date (months)" type=linear linearopts=(tickvaluesequence=(start=0 end=15 increment=0.5))) y2axisopts=(labelFitPolicy=Split) yaxisopts=( Label="Tumor size (% change from baseline)" labelFitPolicy=Split type=linear ) y2axisopts=(labelFitPolicy=Split);

SeriesPlot X=month Y=change /xaxis=x yaxis=y Group=RGROUP1 LineColorGroup=RGROUP1 MarkerColorGroup=RGROUP1 markersymbolgroup=rgroup1 display=(markers) LegendLabel="CHANGE" NAME="trt";

 Layout Gridded / Border=true autoalign=(topleft topright) valign=top;

Layout Gridded;

endlayout;

endlayout;

DiscreteLegend "trt" /*"b"*/ / Location=Inside across=1 type=marker halign=right Title ="Dose Level" ValueAttrs=( Size=5) Opaque=true titleattrs=(family="Arial" size=8pt) titleborder=true sortorder=ascendingformatted autoalign=(TOPRIGHT) order=rowmajor border=false valueattrs=(family="Arial" size=8pt) Opaque=true;

endlayout;

endgraph;
end;
run;

proc sgrender data=FULL_SUBSET template=sgplot  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jagadishkatam_0-1631850577419.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63677iFED2CF1E4FA2A249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_0-1631850577419.png" alt="Jagadishkatam_0-1631850577419.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;P&gt;What i am expecting is as below, where we can observe the unending lines but the legend is disturbed. I want the legend as dose1 with only 1 row&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="Jagadishkatam_1-1631850684319.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63678iB324512F241DE785/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_1-1631850684319.png" alt="Jagadishkatam_1-1631850684319.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 03:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768220#M21974</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-17T03:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768294#M21975</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151"&gt;@Jagadishkatam&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want your image to look like the image below?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so you use the sort below instead. When using the SERIESPLOT statement it is important to sort the dataset by the value in the x-axis. I noticed you also have two subjects in your dataset, so perhaps you want to use the GROUP=USUBJID option to get two lines, i.e. one for each subject.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=full_subset;
  by rgroup month;
run;&lt;/CODE&gt;&lt;/PRE&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="SAS Help2.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63686i3524A9003EE9A904/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS Help2.png" alt="SAS Help2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768294#M21975</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-09-17T13:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768295#M21976</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151"&gt;@Jagadishkatam&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've actually just realised that you infact did want to have two separate lines, and so I have put the full code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data full_subset;
input RGROUP$      USUBJID$     AVISITN MONTH CHANGE;
cards;
dose1 00005 1 0 0
dose1 00005 2 1.3 1.639344262
dose1 00005 3 3.2 10.95081967
dose1 00006 1 0 0
dose1 00006 2 1.3 1.039344262
dose1 00006 3 3.2 16.95081967
;

proc sort data=full_subset;
by rgroup month;
run;

proc template;
define statgraph sgplot;
begingraph / collation=binary dataContrastColors=( red orange green violet yellow grey ) dataSymbols=( EOT );
SymbolChar char=delta_u NAME=EOT / scale=1;
discreteattrmap name='TGROUPS';
value 'Treatment Ongoing' /markerattrs=(symbol=trianglerightfilled color=black size=12);
enddiscreteattrmap;
discreteattrvar attrvar=TGROUP1 var=TGROUP attrmap='TGROUPS';
discreteattrmap name='RGROUPS';

value 'dose1' /markerattrs=(symbol=squarefilled color=red size=12) Lineattrs=( Pattern=1 Thickness=2 color=red);
enddiscreteattrmap;

discreteattrvar attrvar=RGROUP1 var=rgroup attrmap='RGROUPS';

layout overlay / walldisplay=(fill) xaxisopts=( Label="Time since first dose date (months)" type=linear linearopts=(tickvaluesequence=(start=0 end=15 increment=0.5))) y2axisopts=(labelFitPolicy=Split) yaxisopts=( Label="Tumor size (% change from baseline)" labelFitPolicy=Split type=linear ) y2axisopts=(labelFitPolicy=Split);

SeriesPlot X=month Y=change /xaxis=x yaxis=y Group=USUBJID LineColorGroup=RGROUP1 MarkerColorGroup=RGROUP1 markersymbolgroup=rgroup1 display=(markers) LegendLabel="CHANGE" NAME="trt";

 Layout Gridded / Border=true autoalign=(topleft topright) valign=top;

Layout Gridded;

endlayout;

endlayout;

DiscreteLegend "trt" /*"b"*/ / Location=Inside across=1 type=marker halign=right Title ="Dose Level" ValueAttrs=( Size=5) Opaque=true titleattrs=(family="Arial" size=8pt) titleborder=true sortorder=ascendingformatted autoalign=(TOPRIGHT) order=rowmajor border=false valueattrs=(family="Arial" size=8pt) Opaque=true;

endlayout;

endgraph;
end;
run;

proc sgrender data=FULL_SUBSET template=sgplot  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768295#M21976</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-09-17T13:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768330#M21977</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;for your response.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried updating the code to use group=usubjid, and this will generate the graph without the unending lines. But it will affect the legend, like it will display two rows for two subjects and if there are many subjects then the same number of rows will be displayed in the legend.&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="Jagadishkatam_0-1631894269879.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63687iCE034A805B69A500/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_0-1631894269879.png" alt="Jagadishkatam_0-1631894269879.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this is not my expectation, I want to avoid the unending lines but still display only one row for legend as both the subjects took the same dose i.e., 'dose1'.&amp;nbsp;&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="Jagadishkatam_1-1631894405357.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63688i53249C9730928567/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_1-1631894405357.png" alt="Jagadishkatam_1-1631894405357.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>Fri, 17 Sep 2021 16:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768330#M21977</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-17T16:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768356#M21978</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 19:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768356#M21978</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-17T19:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768361#M21979</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151"&gt;@Jagadishkatam&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to just have a different legend, you can simply use a different plot statement without the GROUP option, and then using the attribute option, you can not display the line. Look at the example below, where I use another SERIESPLOT statement to create the legend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data full_subset;
input RGROUP$      USUBJID$     AVISITN MONTH CHANGE;
cards;
dose1 00005 1 0 0
dose1 00005 2 1.3 1.639344262
dose1 00005 3 3.2 10.95081967
dose1 00006 1 0 0
dose1 00006 2 1.3 1.039344262
dose1 00006 3 3.2 16.95081967
;

proc sort data=full_subset;
by rgroup month;
run;

proc template;
define statgraph sgplot;
begingraph / collation=binary dataContrastColors=( red orange green violet yellow grey ) dataSymbols=( EOT );
SymbolChar char=delta_u NAME=EOT / scale=1;
discreteattrmap name='TGROUPS';
value 'Treatment Ongoing' /markerattrs=(symbol=trianglerightfilled color=black size=12);
enddiscreteattrmap;
discreteattrvar attrvar=TGROUP1 var=TGROUP attrmap='TGROUPS';
discreteattrmap name='RGROUPS';

value 'dose1' /markerattrs=(symbol=squarefilled color=red size=12) Lineattrs=( Pattern=1 Thickness=2 color=red);
enddiscreteattrmap;

discreteattrvar attrvar=RGROUP1 var=rgroup attrmap='RGROUPS';

layout overlay / walldisplay=(fill) xaxisopts=( Label="Time since first dose date (months)" type=linear linearopts=(tickvaluesequence=(start=0 end=15 increment=0.5))) y2axisopts=(labelFitPolicy=Split) yaxisopts=( Label="Tumor size (% change from baseline)" labelFitPolicy=Split type=linear ) y2axisopts=(labelFitPolicy=Split);

SeriesPlot X=month Y=change /xaxis=x yaxis=y Group=USUBJID LineColorGroup=RGROUP1 MarkerColorGroup=RGROUP1 markersymbolgroup=rgroup1 display=(markers);

SeriesPlot X=month Y=change / lineattrs=(thickness=0 color=red) LegendLabel="Dose 1" NAME="trt";

 Layout Gridded / Border=true autoalign=(topleft topright) valign=top;

Layout Gridded;

endlayout;

endlayout;

DiscreteLegend "trt"  / Location=Inside across=1 type=line halign=right Title ="Dose Level" ValueAttrs=( Size=5) Opaque=true titleattrs=(family="Arial" size=8pt) titleborder=true sortorder=ascendingformatted autoalign=(TOPRIGHT) order=rowmajor border=false valueattrs=(family="Arial" size=8pt) Opaque=true;

endlayout;

endgraph;
end;
run;

proc sgrender data=FULL_SUBSET template=sgplot  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 19:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768361#M21979</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2021-09-17T19:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768366#M21980</link>
      <description>&lt;P&gt;I don't know what an "unending line" means.&lt;/P&gt;
&lt;P&gt;It looks like the legend is obstructing the lines. If that is the problem, you can&lt;/P&gt;
&lt;P&gt;1. Move the legend position&lt;/P&gt;
&lt;P&gt;2. Add an offset to the maximum side of the Y axis, such as&amp;nbsp;OFFSETMAX=0.1. &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/n0fksz728ytyz2n1ws13vlnkudyn.htm#n1loxdh119l761n170hz4vz6jqz9a" target="_self"&gt;See the doc.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 20:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768366#M21980</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-09-17T20:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768369#M21981</link>
      <description>&lt;P&gt;In your data, after every change in USUBJID, add another observation with missing values for MONTH and CHANGE. Remove the GROUP option from the SERIESPLOT and add BREAK=TRUE to that statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this works for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 20:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768369#M21981</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2021-09-17T20:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768393#M21982</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;for your response ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I updated the code as below and i get&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data&amp;nbsp;full_subset;
infile&amp;nbsp;cards&amp;nbsp;missover;
input
RGROUP$&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;USUBJID$&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AVISITN MONTH&amp;nbsp;CHANGE;
cards;
dose1 00005 1 0 0
dose1 00005 1
dose1 00005 2 1.3 1.639344262
dose1 00005 2
dose1 00005 3 3.2 10.95081967
dose1 00005 3
dose1 00006 1 0 0
dose1 00006 1
dose1 00006 2 1.3 1.039344262
dose1 00006 2
dose1 00006 3 3.2 16.95081967
dose1 00006 3
;

proc&amp;nbsp;sort&amp;nbsp;data=full_subset;
by&amp;nbsp;rgroup&amp;nbsp;usubjid&amp;nbsp;avisitn;
run;
proc&amp;nbsp;template;
define&amp;nbsp;statgraph&amp;nbsp;sgplot;
begingraph&amp;nbsp;/ collation=binary&amp;nbsp;dataContrastColors=( red&amp;nbsp;orange green&amp;nbsp;violet yellow grey )&amp;nbsp;dataSymbols=( EOT );
SymbolChar&amp;nbsp;char=delta_u&amp;nbsp;NAME=EOT / scale=1;
discreteattrmap&amp;nbsp;name='TGROUPS';
value&amp;nbsp;'Treatment Ongoing'&amp;nbsp;/markerattrs=(symbol=trianglerightfilled&amp;nbsp;color=black size=12);
enddiscreteattrmap;
discreteattrvar&amp;nbsp;attrvar=TGROUP1 var=TGROUP&amp;nbsp;attrmap='TGROUPS';
discreteattrmap&amp;nbsp;name='RGROUPS';
value&amp;nbsp;'dose1'&amp;nbsp;/markerattrs=(symbol=squarefilled&amp;nbsp;color=red size=12)&amp;nbsp;Lineattrs=( Pattern=1&amp;nbsp;Thickness=2&amp;nbsp;color=red);
enddiscreteattrmap;
discreteattrvar&amp;nbsp;attrvar=RGROUP1 var=rgroup&amp;nbsp;attrmap='RGROUPS';

layout&amp;nbsp;overlay&amp;nbsp;/&amp;nbsp;walldisplay=(fill)&amp;nbsp;xaxisopts=(&amp;nbsp;Label="Time since first dose date (months)"&amp;nbsp;type=linear&amp;nbsp;linearopts=(tickvaluesequence=(start=0&amp;nbsp;end=15&amp;nbsp;increment=0.5)))&amp;nbsp;y2axisopts=(labelFitPolicy=Split)&amp;nbsp;yaxisopts=(&amp;nbsp;Label="Tumor size (% change from baseline)"&amp;nbsp;labelFitPolicy=Split type=linear )&amp;nbsp;y2axisopts=(labelFitPolicy=Split);

SeriesPlot&amp;nbsp;X=month&amp;nbsp;Y=change /xaxis=x&amp;nbsp;yaxis=y&amp;nbsp;/*Group=usubjid*/&amp;nbsp;break=true&amp;nbsp;LineColorGroup=RGROUP1&amp;nbsp;MarkerColorGroup=RGROUP1&amp;nbsp;markersymbolgroup=rgroup1&amp;nbsp;display=(markers)&amp;nbsp;LegendLabel="CHANGE"&amp;nbsp;NAME="trt";

Layout&amp;nbsp;Gridded&amp;nbsp;/&amp;nbsp;Border=true&amp;nbsp;autoalign=(topleft&amp;nbsp;topright)&amp;nbsp;valign=top;

Layout&amp;nbsp;Gridded;
endlayout;
endlayout;
DiscreteLegend&amp;nbsp;"trt"&amp;nbsp;/*"b"*/&amp;nbsp;/&amp;nbsp;Location=Inside&amp;nbsp;across=1&amp;nbsp;type=marker&amp;nbsp;halign=right&amp;nbsp;Title&amp;nbsp;="Dose Level"&amp;nbsp;ValueAttrs=(&amp;nbsp;Size=5)&amp;nbsp;Opaque=true&amp;nbsp;titleattrs=(family="Arial"&amp;nbsp;size=8pt)&amp;nbsp;titleborder=true&amp;nbsp;sortorder=ascendingformatted&amp;nbsp;autoalign=(TOPRIGHT)&amp;nbsp;order=rowmajor&amp;nbsp;border=false&amp;nbsp;valueattrs=(family="Arial"&amp;nbsp;size=8pt)&amp;nbsp;Opaque=true;

endlayout;
endgraph;
end;

run;

proc&amp;nbsp;sgrender&amp;nbsp;data=FULL_SUBSET&amp;nbsp;template=sgplot&amp;nbsp;/*sganno=anno*/;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="font-weight: 400;"&gt;&lt;SPAN style="font-style: inherit; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&lt;SPAN style="font-style: inherit; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jagadishkatam_0-1631919979029.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63695iC4AD02287368CC92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jagadishkatam_0-1631919979029.png" alt="Jagadishkatam_0-1631919979029.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 23:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768393#M21982</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-17T23:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768394#M21983</link>
      <description>The unending line is the line returning back to the origin again or circling back, its visible for the second subject data, and this is happening when i use the group=rgoup1 from the discreteattrmap. when i don't use it and simply put group=usubjid in seriesplot then the unending lines are not visible and the subject data is properly plotted. &lt;BR /&gt;&lt;BR /&gt;I want to use the group=rgroup1 from discreteattrmap, so that i can use it for controlling the legend. &lt;BR /&gt;&lt;BR /&gt;I hope i am clear, please check the images of the graphs i posted in the main message. Could you please help with me with it.</description>
      <pubDate>Fri, 17 Sep 2021 23:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768394#M21983</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-17T23:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768395#M21984</link>
      <description>&lt;P&gt;Clearly you need to use GROUP=usubjid to get two separate line segments, one each for "00005" and "00006".&amp;nbsp; Maybe your discreteattrmap and discreteattrvar are not set up correctly.&amp;nbsp; They are set up for the RGROUPS variable, but should be setup for the USUBJID with two values '00005' and '00006'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;discreteattrvar attrvar=USUBJID1 var=usubjid attrmap='USUBJIDS';&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, use usubjid1 as the group variable.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 23:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768395#M21984</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2021-09-17T23:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768397#M21985</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt; for your response. I agree with you , the issue when i use var=usubjid is that i get two separate lines as per the expectation but the legend shows two lines for two subjects, however both of the subjects took the same dose , so i want to show the legend with the type pf dose taken in that case i should see only one row in legend. but that is not happening.</description>
      <pubDate>Fri, 17 Sep 2021 23:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768397#M21985</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-17T23:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768398#M21986</link>
      <description>&lt;P&gt;In that case I suggest you use GROUP=USUBJID, LINECOLORGROUP=RGROUP and MARKERCOLORGROUP=RGROUP. You may be able to use the discreteattrvar RGROUP1 for these two options.&amp;nbsp; You may also need to add the TYPE=LINECOLOR to the Discretelegend.&lt;BR /&gt;&lt;BR /&gt;Also, you may be able to use SGPLOT for this graph with the attrmaps defined as data sets using GROUPLC and LCATTRID.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 23:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768398#M21986</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2021-09-17T23:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768413#M21988</link>
      <description>Thanks a lot Kris, the use of legenditem statement suggestion is helpful.</description>
      <pubDate>Sat, 18 Sep 2021 06:40:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768413#M21988</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2021-09-18T06:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: unending lines in the series plot of proc template</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768559#M21991</link>
      <description>&lt;P&gt;For the record, I think you misunderstood my suggestion. You only needed to add one "missing" record after each change in subject ID. This means you should have had one missing record after the last "0005". Having one after the last '0006' would not have hurt, and would make the data step loop simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 13:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/unending-lines-in-the-series-plot-of-proc-template/m-p/768559#M21991</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2021-09-20T13:48:19Z</dc:date>
    </item>
  </channel>
</rss>

