<?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: Is there a better way to show events in a time series? in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867735#M17101</link>
    <description>&lt;P&gt;One way to do this in Visual Analytics is to place both of your graphs in a Precision Container, then you can put them on top of each other and end up with something like this (using dummy data I had):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HunterT_SAS_0-1680523349972.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82268i58029059A2C205C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HunterT_SAS_0-1680523349972.png" alt="HunterT_SAS_0-1680523349972.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Some tips here:&lt;/P&gt;
&lt;P&gt;- Use the Layout section of the Options for each graph to place these charts&lt;/P&gt;
&lt;P&gt;- You may need to adjust Transparency options. I did not have to in my example but fyi anyway.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- In the above example in order to get both charts to line up better, I set both Titles to "Events" and I turned off the gridlines for the time series plot.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2023 12:04:46 GMT</pubDate>
    <dc:creator>HunterT_SAS</dc:creator>
    <dc:date>2023-04-03T12:04:46Z</dc:date>
    <item>
      <title>Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867588#M17096</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better way to show events as a backdrop in a timeseries graph?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to make it easier for the reader to see what events were the backdrop to any possible fluctuations in sales.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the current visual coming from 2 separate datasets and 2 separate graphs stacked.&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="illmatic_0-1680301028595.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82247iFFB3F1DD09A93B36/image-size/large?v=v2&amp;amp;px=999" role="button" title="illmatic_0-1680301028595.png" alt="illmatic_0-1680301028595.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 22:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867588#M17096</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2023-03-31T22:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867608#M17097</link>
      <description>You could try BLOCK statement of PROC SGPLOT.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2014/04/14/the-block-plot/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2014/04/14/the-block-plot/&lt;/A&gt;</description>
      <pubDate>Sat, 01 Apr 2023 09:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867608#M17097</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-04-01T09:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867735#M17101</link>
      <description>&lt;P&gt;One way to do this in Visual Analytics is to place both of your graphs in a Precision Container, then you can put them on top of each other and end up with something like this (using dummy data I had):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HunterT_SAS_0-1680523349972.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82268i58029059A2C205C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HunterT_SAS_0-1680523349972.png" alt="HunterT_SAS_0-1680523349972.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Some tips here:&lt;/P&gt;
&lt;P&gt;- Use the Layout section of the Options for each graph to place these charts&lt;/P&gt;
&lt;P&gt;- You may need to adjust Transparency options. I did not have to in my example but fyi anyway.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- In the above example in order to get both charts to line up better, I set both Titles to "Events" and I turned off the gridlines for the time series plot.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 12:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867735#M17101</guid>
      <dc:creator>HunterT_SAS</dc:creator>
      <dc:date>2023-04-03T12:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867809#M17106</link>
      <description>&lt;P&gt;Hi Hunter,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I started off this way, but the layout would constantly mess up on other people's monitors. I also need the gridlines since I am showing a forecast for many years across many channels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can try it again sometime, but the floating graphs were a pain to upkeep, so I gave up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was hoping there was some way to utilize the&amp;nbsp;&lt;STRONG&gt;Rules&lt;/STRONG&gt; section where I can have the background of the graph highlighted indicating an event...but even if that's possible, there is likely no way to have it show all the information I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help! I'm assuming this is the only alternate solution that this point.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 16:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867809#M17106</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2023-04-03T16:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867810#M17107</link>
      <description>&lt;P&gt;I don't think I can do this in VA...?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 16:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867810#M17107</guid>
      <dc:creator>illmatic</dc:creator>
      <dc:date>2023-04-03T16:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867819#M17108</link>
      <description>&lt;P&gt;Oh yes, precision containers can be a pain when your users have varying screen resolutions and browser zoom levels, so you have a great point there.&lt;/P&gt;
&lt;P&gt;I'm afraid there is no better alternative within Visual Analytics. Rules *might* be an option but the data would have to be in the same datasource. You also might be able to utilize custom graph builder to put two graphs together that make sense here (time series and schedule charts are incompatible unfortunately), but this approach also depends on all of the data being in the same datasource.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 17:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/867819#M17108</guid>
      <dc:creator>HunterT_SAS</dc:creator>
      <dc:date>2023-04-03T17:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to show events in a time series?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/868441#M17115</link>
      <description>&lt;P&gt;You did not mention the version of Visual Analytics you are using. Using 2023.03 (I guess earlier 20xx will work as well) I created a custom graph combining a schedule chart with a series plot. The end result looks like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bruno_SAS_0-1680780439109.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82383iA5FCBA3106FB196D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bruno_SAS_0-1680780439109.png" alt="Bruno_SAS_0-1680780439109.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To build the custom graph:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;add a schedule chart&lt;/LI&gt;
&lt;LI&gt;if you want to have different colors for the different events, the schedule chart needs a group role&lt;/LI&gt;
&lt;LI&gt;then add the series plot (so it is on top of the schedule chart)&lt;/LI&gt;
&lt;LI&gt;check all the roles for the correct type&lt;/LI&gt;
&lt;LI&gt;save it&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To use it, you need to import it into the objects pane.&lt;/P&gt;
&lt;P&gt;Please note, if you make changes to the custom graph do the following: delete the object in the report, delete the custom graph from the objects pane, then import again&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As this is now only one object the data for schedule chart and series plot has to come from the same data source.&lt;/P&gt;
&lt;P&gt;Find below an example on how to create such a CAS table. Essentially you have like two separate tables using mostly different variable names which are then "concatenated". The final table&amp;nbsp;(casuser.ts_combined)&amp;nbsp;is then used in the object created by the custom graph builder and the appropriate data items are assigned to the roles.&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas sugus sessopts=(caslib="casuser");
libname casuser cas caslib="casuser";
proc datasets lib=casuser nolist;
  delete ts_complete;
  delete ts_series;
  delete ts_combined;
run;
quit;

/* create event data */
data casuser.ts_complete(promote=yes);
   format activity $12. sdate date9. fdate date9.;
   input activity &amp;amp; sdate &amp;amp; date9. fdate &amp;amp; date9.;
   datalines;
Event01  01dec2015  05dec2015
Event01  06dec2015  16dec2015
Event01  07dec2015  12dec2015
Event01  17dec2015  03jan2016
Event02  10dec2015  19dec2015
Event02  01jan2016  13jan2016
Event02  13jan2016  21jan2016
Event02  22jan2016  01feb2016
Event03  05feb2016  11feb2016
Event03  12feb2016  12feb2016
Event03  26jan2016  26jan2016
;

/* create series data */
data casuser.ts_series(promote=yes);
  length activity $ 12;
  /* avoid a missing category for events */
  activity = "Event01";
  do seriesDate = "01dec2015"d to "15feb2016"d;
    seriesValue = rand("integer", 50, 100);
    output;
  end;
  format seriesDate date9.;
run;

/* combine event and series */
data casuser.ts_combined(promote=yes);
  set casuser.ts_complete casuser.ts_series;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 11:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Is-there-a-better-way-to-show-events-in-a-time-series/m-p/868441#M17115</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2023-04-06T11:43:18Z</dc:date>
    </item>
  </channel>
</rss>

