<?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: Partially color the backround of a chart in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899267#M17577</link>
    <description>&lt;P&gt;I don't use Viya or Visual Analytics so this is guess of something that &lt;STRONG&gt;might&lt;/STRONG&gt; be possible. If you can create a Polygon, either as a plot or annotate data you could provide a definition that corresponds to coordinates in you graph for that area. This would require you to set specific coordinates for each corner of the area manually so "last 3 years" is going to require you to calculate the first year, the last year to provide those values a x coordinate and the corresponding y value (zeros are usually easy ).&lt;/P&gt;
&lt;P&gt;Overlay the series graph(s) over the polygon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe as I said.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 14:40:08 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-10-19T14:40:08Z</dc:date>
    <item>
      <title>Partially color the backround of a chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/898104#M17557</link>
      <description>&lt;P&gt;I would like to color the backround in the line chart of the last three years.&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="chart.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88762iD78BAA066B889C9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chart.png" alt="chart.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Any idea how this could be done?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 11:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/898104#M17557</guid>
      <dc:creator>MWAG</dc:creator>
      <dc:date>2023-10-11T11:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Partially color the backround of a chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899177#M17575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/440880"&gt;@MWAG&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked with the development team. Unfortunately, there isn't a way to do this with display rules in the current or previous releases of SAS Visual Analytics.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Joy&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 21:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899177#M17575</guid>
      <dc:creator>Joy_SAS</dc:creator>
      <dc:date>2023-10-18T21:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Partially color the backround of a chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899267#M17577</link>
      <description>&lt;P&gt;I don't use Viya or Visual Analytics so this is guess of something that &lt;STRONG&gt;might&lt;/STRONG&gt; be possible. If you can create a Polygon, either as a plot or annotate data you could provide a definition that corresponds to coordinates in you graph for that area. This would require you to set specific coordinates for each corner of the area manually so "last 3 years" is going to require you to calculate the first year, the last year to provide those values a x coordinate and the corresponding y value (zeros are usually easy ).&lt;/P&gt;
&lt;P&gt;Overlay the series graph(s) over the polygon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe as I said.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 14:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899267#M17577</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-19T14:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Partially color the backround of a chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899693#M17581</link>
      <description>&lt;P&gt;You can achieve this using the custom graph builder. The end result will look like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrunoMueller_0-1698095111727.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89042iB603B137F9F68544/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrunoMueller_0-1698095111727.png" alt="BrunoMueller_0-1698095111727.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Basic steps for creating the custom graph&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;create a new custom graph&lt;/LI&gt;
&lt;LI&gt;add a band plot to the graph&lt;/LI&gt;
&lt;LI&gt;assign the right y axis to the band plot&lt;/LI&gt;
&lt;LI&gt;uncheck all the right y axis elements (line, label, values, tick marks)&lt;/LI&gt;
&lt;LI&gt;do no display any grid lines for this axis&lt;/LI&gt;
&lt;LI&gt;add either a timeseries or a series plot&lt;/LI&gt;
&lt;LI&gt;both plots will share the x axis&lt;/LI&gt;
&lt;LI&gt;save the custom graph&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In your report, go to the objects pane and use the 3 vertical dots icon to import the new custom graph and add the custom graph to your report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create two calculated data items for the band plot part of the custom graph, based on what timeframe should be colored assign 0 to the band plot lower limit and a 1 to the band plot upper limit. For these two calculated items assign an aggregation of either min or max.&lt;/P&gt;
&lt;P&gt;A sample expression for the lower limit might look like this:&lt;/P&gt;
&lt;PRE&gt;if someDateYear &amp;gt;= todayYear -1
return 0
else .&lt;/PRE&gt;
&lt;P&gt;someDateYear is the year of the date used for the x axis and todayYear is the year of "today", both are calculated data items.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give it a try.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 21:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899693#M17581</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2023-10-23T21:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Partially color the backround of a chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899714#M17582</link>
      <description>&lt;P&gt;Thank you very much. That seems like a working solution. Unfortunately I do not have the rights for the graph builder. But in theory and as I can se within your example the solution works.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 05:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899714#M17582</guid>
      <dc:creator>MWAG</dc:creator>
      <dc:date>2023-10-24T05:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Partially color the backround of a chart</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899718#M17583</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you already have an answer but here is a "polygon" approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  do x = 1 to 10;
    Y = 0.5 * X + 1 + RANNOR(123);
    output;
  end;
run;

data polydata; /* create polygon data */
   input IDp :$ Xp Yp;
datalines;
1 6 0
1 10 0
1 10 10
1 6 10
;
run;

data toPlot; /* combine plot data and polygon data*/
  set have polydata;
run;


PROC SGPLOT data = toPlot;
  polygon X=xp Y=yp id=idp / 
    fill 
    nooutline 
    fillattrs=(color=green transparency=0.6) /* set polygon's transparency and colour */
  ;
  series x=x y=y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1698130431738.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89046i7DAF27227F2EAE5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1698130431738.png" alt="yabwon_0-1698130431738.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;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 06:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Partially-color-the-backround-of-a-chart/m-p/899718#M17583</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-10-24T06:53:59Z</dc:date>
    </item>
  </channel>
</rss>

