<?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: sgplot color control for multiple series with group= in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495325#M130706</link>
    <description>&lt;P&gt;thanks for your response. I spent time using the suggestions in the link but I still cannot get the colors to be in sync between the actual and moving average.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 14:46:37 GMT</pubDate>
    <dc:creator>CP2</dc:creator>
    <dc:date>2018-09-13T14:46:37Z</dc:date>
    <item>
      <title>sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495037#M130584</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;I am trying to show two lines for each group in the group= statement of an sgplot.&amp;nbsp; One line would be the actual value and the other would be the 12 month moving average. I want the actual to be a solid line and the moving average to be a dashed line but I also want the colors to be the same for each item in the group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that I could exclude the color from the lineattrs so that the defaults would just be used for each of the series but it's not working the way I had hoped. I've tried a lot of the suggestions online but still not working. Originally I want to do this with two by variables (drug and prodname) but that was making it more complicated. I ended up&amp;nbsp;wrapping the plot in a macro and calling out each drug and product name to plot separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is an hypothetical example with a drug called 'abcdrug' and prodname is blank. Is there a simple statement I can add or ods graphics option I can use without creating numerous lines of code? I often want to do these sorts of graphs on the fly and sometimes not worth creating all the code for it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro shareplot(dname=, prod=) ;&lt;BR /&gt;proc sgplot data=share (where = (drug="&amp;amp;dname." and prodname="&amp;amp;prod.")) ;&lt;BR /&gt;title "Shares Over Time";&lt;BR /&gt;title2 "&amp;amp;dname., &amp;amp;prod." ;&lt;BR /&gt;series y=share x= month/ group=strength lineattrs=(thickness=2 pattern=solid) legendlabel="Share by Month" ;&lt;BR /&gt;series y=share_12 x= month/ group=strength lineattrs=(thickness=2 pattern=longdash) legendlabel="Share by Month - 12 month MA" ;&lt;BR /&gt;YAXIS LABEL = 'Share (%)' ;&lt;BR /&gt;YAXIS min=0 max=1 ;&lt;BR /&gt;FOOTNOTE " ";&lt;BR /&gt;where MONTH&amp;gt;='01JAN2013'd ;&lt;BR /&gt;run;&lt;BR /&gt;%mend plot ;&lt;BR /&gt;%shareplot(dname=abcdrug);&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 21:04:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495037#M130584</guid>
      <dc:creator>CP2</dc:creator>
      <dc:date>2018-09-12T21:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495048#M130590</link>
      <description>&lt;P&gt;Have you looked at DATA ATTRIBUTE Maps? That's likely what you're after.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/01/30/auto-discrete-attr-map.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/01/30/auto-discrete-attr-map.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 21:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495048#M130590</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-12T21:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495263#M130672</link>
      <description>Check option grouplc=
seriese ......./group=strength  grouplc= 

Or statment :
styleattrs ...........</description>
      <pubDate>Thu, 13 Sep 2018 12:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495263#M130672</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-13T12:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495325#M130706</link>
      <description>&lt;P&gt;thanks for your response. I spent time using the suggestions in the link but I still cannot get the colors to be in sync between the actual and moving average.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 14:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495325#M130706</guid>
      <dc:creator>CP2</dc:creator>
      <dc:date>2018-09-13T14:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495327#M130707</link>
      <description>&lt;P&gt;Post your code so we can see and work off what you've already done please.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 14:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495327#M130707</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-13T14:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495342#M130714</link>
      <description>I suppose i can add 'lineattrs' in the map instead of marketstyleelement and hardcode in the colors. I'll try this. Let me know if you have other suggestions related to data attribute maps.</description>
      <pubDate>Thu, 13 Sep 2018 14:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495342#M130714</guid>
      <dc:creator>CP2</dc:creator>
      <dc:date>2018-09-13T14:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495347#M130717</link>
      <description>&lt;P&gt;Without seeing what you've already done, it's pretty hard to make any suggestions here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59791"&gt;@CP2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I suppose i can add 'lineattrs' in the map instead of marketstyleelement and hardcode in the colors. I'll try this. Let me know if you have other suggestions related to data attribute maps.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495347#M130717</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-13T15:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot color control for multiple series with group=</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495359#M130721</link>
      <description>can you help me figure out why I am getting errors with this supposedly simple loop and scan? I'm trying to add a color to the attribute map.&lt;BR /&gt;%let VarName = strength_; /* specify name of grouping variable */&lt;BR /&gt;proc freq data=Have&lt;BR /&gt;ORDER=FORMATTED; /* or ORDER=DATA|FREQ */&lt;BR /&gt;tables &amp;amp;VarName / out=Attrs(rename=(&amp;amp;VarName=Value));&lt;BR /&gt;run;&lt;BR /&gt;%let colorlist=blue, red, green, lightblue, cyan, orange, fuscia, brown, lavendar, purple ;&lt;BR /&gt;%LET color_count = %sysfunc(countw(%quote(&amp;amp;colorlist), %str(,) )) ;&lt;BR /&gt;data DAttrs;&lt;BR /&gt;ID = "&amp;amp;VarName";&lt;BR /&gt;set Attrs(keep=Value);&lt;BR /&gt;length linecolor $11. linecolor $100. ;&lt;BR /&gt;do i = 1 to %eval(&amp;amp;color_count.) ;&lt;BR /&gt;linecolor = %scan(&amp;amp;colorlist., i ) ;&lt;BR /&gt;put linecolor ;&lt;BR /&gt;end ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-color-control-for-multiple-series-with-group/m-p/495359#M130721</guid>
      <dc:creator>CP2</dc:creator>
      <dc:date>2018-09-13T15:28:48Z</dc:date>
    </item>
  </channel>
</rss>

