<?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 VBAR with &amp;quot;broken&amp;quot; midpoint axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684360#M20479</link>
    <description>&lt;P&gt;You would need a split-character format. There is some repetition, so try using a macro like this:&lt;BR /&gt;%macro cookie; *makes a split-character format;&lt;BR /&gt;proc format;&lt;BR /&gt;value $split&lt;BR /&gt;%do i = 10 %to 230 %by 10;&lt;BR /&gt;i = break into characters and fuse using ~ symbol, so 10 becomes '1~0';&lt;BR /&gt;...&lt;BR /&gt;last bit of value statement would be &lt;BR /&gt;230 = '2~3~0'&lt;BR /&gt;;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%cookie;&lt;BR /&gt;&lt;BR /&gt;axis2 split = "~";&lt;BR /&gt;xaxis = axis2;&lt;BR /&gt;format value $split;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This is based on Solution # 3 from "Charting the Basics with PROC GCHART" by Perry Watts. It will apply to sgplot, because axis statement is outside of procedure.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2020 20:01:39 GMT</pubDate>
    <dc:creator>pink_poodle</dc:creator>
    <dc:date>2020-09-16T20:01:39Z</dc:date>
    <item>
      <title>SGPLOT VBAR with "broken" midpoint axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/683069#M20462</link>
      <description>&lt;P&gt;Attached file is a VBAR created with good old PROC GCHART. It depicts response times to requests in days. The first 4 weeks on a daily basis and beyond that on a weekly basis. Note the clear gap at the junction between the daily and weekly bars.&lt;/P&gt;
&lt;P&gt;The PROC GCHART coding is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc gchart data=selection annotate=anno;
vbar workdays/midpoints=0 to 28 by 1 28 to 308 by 7 raxis=axis1 maxis=axis2;
axis1 order=0 to 130 by 10 label=(a=90 'Aantal gevallen');
axis2 label=('Doorlooptijd in werkdagen');
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reference lines and text are added with the Annotate facility.&lt;/P&gt;
&lt;P&gt;I tried to reconstruct this chart with PROC SGPLOT. I used following code for it (I did not yet include the annotates):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=selection;
vbar days/fillattrs = (color=cyan);
xaxis values=(0 to 28 by 1 28 to 308 by 7) ranges=(1-28 28-308) valuesrotate=vertical ;
STYLEATTRS axisbreak=bracket ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I ran into two problems with this:&lt;/P&gt;
&lt;P&gt;1. The midpoint axis contained the values as given in the Xaxis statement, but the graph did not show the gap between the two range definitions&lt;/P&gt;
&lt;P&gt;2. I wanted the tick-marks formatted as in GCHART (so stacked digits), but I was only able to rotate the labels.&lt;/P&gt;
&lt;P&gt;Has anybody suggestions how to proceed?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 20:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/683069#M20462</guid>
      <dc:creator>ErikT</dc:creator>
      <dc:date>2020-09-10T20:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR with "broken" midpoint axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684324#M20474</link>
      <description>About point 1, Sample 55683 from graph gallery has a broken y-axis. You can adapt it for your x-axis:&lt;BR /&gt;&lt;A href="https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html" target="_blank"&gt;https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html&lt;/A&gt;&lt;BR /&gt;About point 2, Sample 48432 has the rotated axis values.</description>
      <pubDate>Wed, 16 Sep 2020 17:29:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684324#M20474</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-09-16T17:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR with "broken" midpoint axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684350#M20478</link>
      <description>&lt;P&gt;Thank you for the suggestions. It learned me something new at one point. If you define ranges they should include some gap: This is the code of sample 55683:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
   input Type $1 Value;
   datalines;
A 10
B 15
C 12
D 17
E 205
F 225
;
run;

proc sgplot data=new;
   vbar type / response=value;
   yaxis ranges=(0-20 200-230);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Changing the range definition to adjacent ranges [yaxis ranges=(0-20 20-230);] makes the break disappear. But even a minimal gap is sufficient: [yaxis ranges=(0-20 20.01-230);] to see it again.&lt;/P&gt;
&lt;P&gt;What the example does not do is use a different scale for the two halves of the axis as GCHART does.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample 48432 rotates the values, but that is not what I want. I want them stacked as in the GCHART output. So:&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; 1&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;So the questions are still open and a challenge for all readers.&lt;/P&gt;
&lt;P&gt;In the mean time I will look into SGPANEL to see whether I can solve my first question with that procedure or I will dig into PROC TEMPLATE to try to define it myself.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 19:26:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684350#M20478</guid>
      <dc:creator>ErikT</dc:creator>
      <dc:date>2020-09-16T19:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR with "broken" midpoint axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684360#M20479</link>
      <description>&lt;P&gt;You would need a split-character format. There is some repetition, so try using a macro like this:&lt;BR /&gt;%macro cookie; *makes a split-character format;&lt;BR /&gt;proc format;&lt;BR /&gt;value $split&lt;BR /&gt;%do i = 10 %to 230 %by 10;&lt;BR /&gt;i = break into characters and fuse using ~ symbol, so 10 becomes '1~0';&lt;BR /&gt;...&lt;BR /&gt;last bit of value statement would be &lt;BR /&gt;230 = '2~3~0'&lt;BR /&gt;;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%cookie;&lt;BR /&gt;&lt;BR /&gt;axis2 split = "~";&lt;BR /&gt;xaxis = axis2;&lt;BR /&gt;format value $split;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This is based on Solution # 3 from "Charting the Basics with PROC GCHART" by Perry Watts. It will apply to sgplot, because axis statement is outside of procedure.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 20:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-with-quot-broken-quot-midpoint-axis/m-p/684360#M20479</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-09-16T20:01:39Z</dc:date>
    </item>
  </channel>
</rss>

