<?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: Series plot CURVELABEL overlapping in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484769#M16704</link>
    <description>&lt;P&gt;You have so much white space to the left of this graph, would you be able to just fit a KEYLEGEND for this plot into there alone?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Aug 2018 14:49:23 GMT</pubDate>
    <dc:creator>JeffMeyers</dc:creator>
    <dc:date>2018-08-07T14:49:23Z</dc:date>
    <item>
      <title>Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/483938#M16687</link>
      <description>&lt;P&gt;I am attempting to create a patient profile plot with four panels using PROC SGPANEL. The fourth panel consists of a&amp;nbsp;series&amp;nbsp;plot with two groups and I would like each of the two curves to be labeled. I am using the CURVELABEL option to accomplish this, but it appears that the labels overlap when the baseline values are similar. Any suggestions on how to stagger these labels? My code and output are below. Thank you in advanced!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Safety and Efficacy Profile for Subject 10001";
proc sgpanel data=test nocycleattrs dattrmap=attrmap;;
	panelby id / onepanel layout=rowlattice uniscale=column novarname spacing=10;
	refline 0 / axis=x lineattrs=(thickness=1 color=black);
	highlow y=mhdecod low=stdy high=endy / type=bar barwidth=0.8 lowlabel=mhlabel lowcap=lowcap highcap=highcap fillattrs=(color=CX003DF5);
	highlow y=acmdecod low=stdy high=endy / type=bar barwidth=0.8 lowlabel=cmlabel lowcap=lowcap highcap=highcap fillattrs=(color=CXED7D31);
	highlow y=aedecod low=stdy high=endy / type=bar group=severity labelattrs=(color=black) lineattrs=(color=black pattern=solid) barwidth=0.8 lowlabel=aelabel highcap=highcap attrid=Severity;
	series x=stdy y=aval / group=param attrid=Outcome curvelabel curvelabelpos=start curvelabelattrs=(color=black) lineattrs=(pattern=solid);
	rowaxis display=(nolabel noticks novalues) min=0;
	colaxis grid label='                                                 Study Day' offsetmin=0.3 values=(-28 to 210 by 7) fitpolicy=thin;
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="SGPanel1.png" style="width: 467px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22213iD14A0936C3CDE4A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel1.png" alt="SGPanel1.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 22:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/483938#M16687</guid>
      <dc:creator>hsaul</dc:creator>
      <dc:date>2018-08-03T22:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/483977#M16688</link>
      <description>&lt;P&gt;Even if you stagger the curve labels, it won't be obvious which curve they are associated with. There would be room for curvelabelpos=end, which would better identify your curves.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 05:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/483977#M16688</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-08-04T05:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484464#M16691</link>
      <description>&lt;P&gt;Thanks for your feedback! Unfortunately, since I am generating this for multiple subjects, the data could go either way and the overlap is just as likely to occur at the end as the beginning.&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="2018-08-06_10-44-34.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22268i7861B85B3B6AE6E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-08-06_10-44-34.jpg" alt="2018-08-06_10-44-34.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is a solution for staggering, I thought I might be able to color code the labels to match the curves so that they could be easily identifiable. Open to any other suggestions though!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 17:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484464#M16691</guid>
      <dc:creator>hsaul</dc:creator>
      <dc:date>2018-08-06T17:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484510#M16692</link>
      <description>&lt;P&gt;If your data is likely to be close often enough then perhaps you should not be excluding that bit from the legend.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 19:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484510#M16692</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-06T19:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484769#M16704</link>
      <description>&lt;P&gt;You have so much white space to the left of this graph, would you be able to just fit a KEYLEGEND for this plot into there alone?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 14:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484769#M16704</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-08-07T14:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484792#M16705</link>
      <description>&lt;P&gt;Curve labels do not have collision avoidance.&amp;nbsp; However, data labels do.&amp;nbsp; One work around would be to display datalabels on your series plot only for the first or last point by creating a label variable that has the curve value only for the first or last point.&amp;nbsp; The labels should avoid collision.&amp;nbsp;&amp;nbsp;If the labels are not too close, the will be put in the upper right position.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simple sample code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data stocks;
  set sashelp.stocks(where=(date &amp;gt; '01Jan2004'd));
  if date = '01Dec05'd then label=stock;
run;

proc sgplot data=stocks;
  series x=date y=close / group=stock datalabel=label;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 15:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484792#M16705</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-08-07T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484960#M16724</link>
      <description>&lt;P&gt;Sanjay - This is very helpful and an elegant workaround! Thanks very much!&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="2018-08-07_17-55-03.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22311i940EA17C9D50D455/image-size/large?v=v2&amp;amp;px=999" role="button" title="2018-08-07_17-55-03.jpg" alt="2018-08-07_17-55-03.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 01:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/484960#M16724</guid>
      <dc:creator>hsaul</dc:creator>
      <dc:date>2018-08-08T01:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Series plot CURVELABEL overlapping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/485177#M16733</link>
      <description>&lt;P&gt;Good to know it works.&amp;nbsp; Now, if you want better control on the position of the labels, you could instead overlay a TEXT plot with the same idea.&amp;nbsp; However, now you can set&amp;nbsp;a position column in the data for each label, one as TOPLEFT, one as BOTTOMLEFT.&amp;nbsp; Now, you can get the two clean labels on the left, one above, one below without collision.&amp;nbsp; However, note this idea may work only for your specific 2 label case with coincident starting point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; text x=x y=y text=label / position=position;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 14:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Series-plot-CURVELABEL-overlapping/m-p/485177#M16733</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-08-08T14:59:38Z</dc:date>
    </item>
  </channel>
</rss>

