<?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: Stacked ,clustered and grouped bar chart with patterns in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644987#M19834</link>
    <description>&lt;P&gt;Sorry, The bar are NOT pre-calculated .&lt;/P&gt;&lt;P&gt;My code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgpanel data=ip pctlevel=group;&lt;BR /&gt;panelby avisit / layout=columnlattice onepanel novarname noborder colheaderpos=top headerattrs=(Size=8) ;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;vbar trt01p / group=avalc stat=percent ;&lt;/FONT&gt;&lt;BR /&gt;colaxis display=(nolabel) fitpolicy=split splitchar='-' valueattrs=(size=8);&lt;BR /&gt;rowaxis grid;&lt;BR /&gt;* colaxistable /classdisplay=cluster position=bottom valueattrs=(size=2 color=blue) stat=sum ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 May 2020 13:25:46 GMT</pubDate>
    <dc:creator>Manj</dc:creator>
    <dc:date>2020-05-04T13:25:46Z</dc:date>
    <item>
      <title>Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644980#M19832</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Below is the graph im intended to create. As tyou can see it is stacked and grouped and subgrouped with 100% bars.&lt;/P&gt;&lt;P&gt;Im using the following code, but not sure how to achieve the colours and the patterns. Also would like to present the N values at the bottom of each bars. I tried xaxis table ,but it gives all the bar values together at the bottom of each&amp;nbsp; bars. I pre-calulated the n-values&amp;nbsp; and tried giving the 'N='&amp;nbsp; along with the vbar variable by concatenating, but the result was same as that of xolaxistable.&lt;/P&gt;&lt;P&gt;my code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgpanel data=ip pctlevel=group;&lt;BR /&gt;panelby avisit / layout=columnlattice onepanel novarname noborder colheaderpos=top headerattrs=(Size=8) ;&lt;BR /&gt;vbar trt01p / group=avalc stat=percent ;&lt;BR /&gt;colaxis display=(nolabel) fitpolicy=split splitchar='-' valueattrs=(size=8);&lt;BR /&gt;rowaxis grid;&lt;BR /&gt;* colaxistable /classdisplay=cluster position=bottom valueattrs=(size=2 color=blue) stat=sum ;&lt;BR /&gt;run;&lt;BR /&gt;run;&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="Manj_0-1588597904419.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39028i114E6BF65E368720/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Manj_0-1588597904419.png" alt="Manj_0-1588597904419.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 14:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644980#M19832</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-04T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644985#M19833</link>
      <description>Is your data pre calculated for the bars? I don't see a vbar or vbarparm statement. Can you post your data? I think I can make this pretty quick.</description>
      <pubDate>Mon, 04 May 2020 13:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644985#M19833</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-05-04T13:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644987#M19834</link>
      <description>&lt;P&gt;Sorry, The bar are NOT pre-calculated .&lt;/P&gt;&lt;P&gt;My code is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgpanel data=ip pctlevel=group;&lt;BR /&gt;panelby avisit / layout=columnlattice onepanel novarname noborder colheaderpos=top headerattrs=(Size=8) ;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;vbar trt01p / group=avalc stat=percent ;&lt;/FONT&gt;&lt;BR /&gt;colaxis display=(nolabel) fitpolicy=split splitchar='-' valueattrs=(size=8);&lt;BR /&gt;rowaxis grid;&lt;BR /&gt;* colaxistable /classdisplay=cluster position=bottom valueattrs=(size=2 color=blue) stat=sum ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 13:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/644987#M19834</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-04T13:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645018#M19835</link>
      <description>&lt;P&gt;I did a generic example with the CARS data set since I don't have your data.&amp;nbsp; Let me know if this helps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.cars out=cars;
    by origin  drivetrain type;
run;
proc freq data=cars noprint;
    by origin drivetrain;
    table type / out=freq;
run;
proc sql;
    create table counts as
        select origin,drivetrain,catx('`',drivetrain, '(N='||strip(put(sum(count),12.0))||')') as n from freq
        group by origin,drivetrain;
quit;
data plot;
    merge freq counts;
    by origin drivetrain;
    label n = 'Drive Train';
run;

&lt;BR /&gt;proc sgpanel data=plot;&lt;BR /&gt;panelby origin /layout=columnlattice onepanel rows=1 novarname noheaderborder colheaderpos=bottom&lt;BR /&gt;headerattrs=(Size=8) uniscale=row ;&lt;BR /&gt;colaxis splitchar='`' display=(nolabel) ;&lt;BR /&gt;vbarparm category=n response=percent/ group=type fillpattern;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPanel12.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39040i31D5996832F6BB2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel12.png" alt="SGPanel12.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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 15:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645018#M19835</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-05-04T15:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645029#M19836</link>
      <description>&lt;P&gt;Thanks for the response, If you can see the sample graph has two colour schemes only-Red and blabk for each panel.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 16:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645029#M19836</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-04T16:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645033#M19837</link>
      <description>&lt;P&gt;Look up DATTRMAP in the documentation.&lt;/P&gt;
&lt;P&gt;That is an option that allows you to control the color/pattern/line/marker appearance for Group variables.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 16:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645033#M19837</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-04T16:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645036#M19838</link>
      <description>Attribute maps frustratingly can't control fill patterns and they only work on group variables I think. &lt;BR /&gt;I'm not sure how to control colors by category variable. I can check when I get back to my computer.</description>
      <pubDate>Mon, 04 May 2020 16:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645036#M19838</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-05-04T16:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645042#M19839</link>
      <description>&lt;P&gt;You can use the STYLEATTRS statement to set the sequence of patterns and matching colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or create a custom style template setting the desired fillpattern for each GraphData element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 17:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645042#M19839</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-04T17:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645057#M19840</link>
      <description>&lt;P&gt;Thanks . I tried the above code, seems like 'Fillpattern' doesnt work .It shows up&amp;nbsp;WARNING 1-322: Assuming the symbol FILL was misspelled as fillpattern in the log file. Also Are you calculating the 'percent' in the data?&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 17:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645057#M19840</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-04T17:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645065#M19841</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/115109"&gt;@Manj&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks . I tried the above code, seems like 'Fillpattern' doesnt work .It shows up&amp;nbsp;WARNING 1-322: Assuming the symbol FILL was misspelled as fillpattern in the log file. Also Are you calculating the 'percent' in the data?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please show the entire proc step along with the with errors. Otherwise we are guessing as to where an issue occurs. Copy the code ande errors from the log and paste into a code box opened on the forum with the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, which version of SAS are you running? Graphics options are one of the fastest changing bits in SAS and if you are running an older version, such as SAS 9.3 then some of these may not be available.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 17:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645065#M19841</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-04T17:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645066#M19842</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I use sas version 9.4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I use is (as you suggested)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sgpanel data=ip pctlevel=group;&lt;BR /&gt;panelby avisit /layout=columnlattice onepanel rows=1 novarname noheaderborder colheaderpos=bottom headerattrs=(Size=8) uniscale=row ;&lt;BR /&gt;colaxis display=(nolabel) fitpolicy=split splitchar='-' ;&lt;BR /&gt;vbarparm category=trt response=percent/ group=avalc fillpattern;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log gives the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;&amp;#12;13 The SAS System&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300"&gt;real time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;cpu time 0.01 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300"&gt;************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;* Macro name: CU_FIGSTYLE, Macro Version: 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;* CU_FIGSTYLE has been called with the following parameters:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;CU_FIGSTYLE MACROVERSION 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;This Macro does not use any Global Macro Variables&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;NOTE: STYLE 'Idsl' has been saved to: WORK.TEMPLAT&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;NOTE: PROCEDURE TEMPLATE used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;real time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;cpu time 0.01 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300"&gt;NOTE: Writing ODS PDF output to DISK destination "/arenv/arwork/gsk1278863/mid204837/internal_02/output/f_e_stacked_bar_iron1.PDF", &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;printer "PDF".&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;NOTE: This SAS session is using a registry in WORK. All changes will be lost at the end of this session.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;NOTE: Line generated by the invoked macro "SD_STACKED_BAR_IRON".&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;439 colheaderpos=bottom headerattrs=(Size=8) uniscale=row ; colaxis display=(nolabel) fitpolicy=split splitchar='-' ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;439 ! vbarparm category=trt response=percent/ group=avalc fillpattern; run; ods pdf close; ods listing;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;___________&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;ERROR: Variable PERCENT not found.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300"&gt;WARNING 1-322: Assuming the symbol FILL was misspelled as fillpattern.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;NOTE: PROCEDURE SGPANEL used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;real time 0.00 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;cpu time 0.01 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;ERROR: SAS ended due to errors.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;You specified: OPTIONS ERRORABEND;.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;ERROR: Errors printed on page 13.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333300"&gt;NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;NOTE: The SAS System used:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;real time 1.52 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333300"&gt;cpu time 1.28 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 18:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645066#M19842</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-04T18:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645078#M19843</link>
      <description>&lt;P&gt;My code (as per your suggestion )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgpanel data=ip ;&lt;BR /&gt;panelby avisit /layout=columnlattice onepanel rows=1 novarname noheaderborder colheaderpos=bottom headerattrs=(Size=8) uniscale=row ;&lt;BR /&gt;colaxis display=(nolabel) fitpolicy=split splitchar='-' ;&lt;BR /&gt;vbarparm category=trt response=percent/ group=avalc ffillpattern;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log looks as follows:&lt;/P&gt;&lt;P&gt;&amp;#12;13 The SAS System&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;************************************************************&lt;BR /&gt;* Macro name: CU_FIGSTYLE, Macro Version: 1&lt;BR /&gt;************************************************************&lt;BR /&gt;* CU_FIGSTYLE has been called with the following parameters:&lt;BR /&gt;*&lt;BR /&gt;CU_FIGSTYLE MACROVERSION 1&lt;BR /&gt;*&lt;BR /&gt;************************************************************&lt;BR /&gt;This Macro does not use any Global Macro Variables&lt;BR /&gt;*&lt;BR /&gt;************************************************************&lt;BR /&gt;NOTE: STYLE 'Idsl' has been saved to: WORK.TEMPLAT&lt;BR /&gt;NOTE: PROCEDURE TEMPLATE used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;NOTE: Writing ODS PDF output to DISK destination "/arenv/arwork/gsk1278863/mid204837/internal_02/output/f_e_stacked_bar_iron1.PDF",&lt;BR /&gt;printer "PDF".&lt;BR /&gt;NOTE: This SAS session is using a registry in WORK. All changes will be lost at the end of this session.&lt;BR /&gt;NOTE: Line generated by the invoked macro "SD_STACKED_BAR_IRON".&lt;BR /&gt;439 colheaderpos=bottom headerattrs=(Size=8) uniscale=row ; colaxis display=(nolabel) fitpolicy=split splitchar='-' ;&lt;BR /&gt;439 ! vbarparm category=trt response=percent/ group=avalc fillpattern; run; ods pdf close; ods listing;&lt;BR /&gt;___________&lt;BR /&gt;1&lt;BR /&gt;ERROR: Variable PERCENT not found.&lt;/P&gt;&lt;P&gt;WARNING 1-322: Assuming the symbol FILL was misspelled as fillpattern.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SGPANEL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 18:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645078#M19843</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-04T18:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645088#M19844</link>
      <description>&lt;P&gt;Again it helps to post the code using the code box opened with the forum's &amp;lt;/&amp;gt;.&lt;/P&gt;
&lt;P&gt;This bit of the code:&lt;/P&gt;
&lt;PRE&gt;! vbarparm category=trt response=percent/ group=avalc fillpattern; run; ods pdf close; ods listing;
___________
1
ERROR: Variable PERCENT not found.&lt;/PRE&gt;
&lt;P&gt;The Response &lt;STRONG&gt;variable&lt;/STRONG&gt; to use VBARPARM &lt;STRONG&gt;has&lt;/STRONG&gt; to be in the data. A Vbar or Vbarbasic plot can request a statistic but Vbarparm requires presummarized data and you provide the variable names with the values.&lt;/P&gt;
&lt;P&gt;From documentation:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV class="xis-refProc"&gt;
&lt;DIV class="xis-procStatement"&gt;
&lt;DIV class="xis-procStatementSyntax"&gt;
&lt;DIV class="xis-syntaxSimple"&gt;
&lt;DIV class="xis-syntaxLevel"&gt;&lt;SPAN class="xis-keyword"&gt;VBARPARM&lt;/SPAN&gt; &lt;SPAN class="xis-argRequired"&gt;CATEGORY=&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;category-variable&lt;/SPAN&gt; RESPONSE=&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;numeric-variable&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="xis-argOptional"&gt;&amp;lt;&lt;A title="Description of syntax: Optional Arguments" href="http://127.0.0.1:51339/help/grstatproc.hlp/n0anr8vhopccdan1pyccervx6aak.htm#n1geojoxrd4gj5n12m79hjd2jqjk" target="_blank"&gt;/&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;option(s)&lt;/SPAN&gt;&lt;/A&gt;&amp;gt;&lt;/SPAN&gt;;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;IF fillpattern was acceptable then you would have to provide a value, and in this position it would set the same pattern for all items. I would suggest removing that from the VBARPARM statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code says:&lt;/P&gt;
&lt;PRE&gt;NOTE: STYLE 'Idsl' has been saved to: WORK.TEMPLAT&lt;/PRE&gt;
&lt;P&gt;but does not show anything related to the style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 20:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645088#M19844</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-04T20:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645231#M19845</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;The syle IDSL is internal to the organisation. plz leave that aside. The methoeds I tried are below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method 1 :&lt;/P&gt;&lt;P&gt;========&lt;/P&gt;&lt;P&gt;pattern1 v=l1 c=black;&lt;BR /&gt;pattern2 v=x1 c=black;&lt;BR /&gt;pattern3 v=r1 c=black;&lt;BR /&gt;pattern4 v=l2 c=black;&lt;BR /&gt;pattern5 v=x2 c=black;&lt;BR /&gt;pattern6 v=r2 c=black;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;axis1 label=none order=('Baseline' 'Day 1 - &amp;lt; Week 12' 'Week 12 - &amp;lt; Week 24' 'Week 24 - &amp;lt; Week 36' 'Week 36 - &amp;lt; Week 48' 'Week 48 - &amp;lt; Week 52') offset=(2,2) ;&lt;BR /&gt;axis3 label=none minor=none style=0 offset=(0,0) ;&lt;/P&gt;&lt;P&gt;legend1 shape=bar(.15in,.15in) offset=(0,-3);&lt;BR /&gt;goptions device=PDF;&lt;/P&gt;&lt;P&gt;proc gchart data=ip2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;vbar trt / discrete subgroup=avalc group=avisit nozeros type=percent g100 noframe gaxis=axis1 r&amp;nbsp; &amp;nbsp;axis=axis3 patternid=subgroup gspace=4 space=.5 legend=legend1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The issue here is it doesnt give the 100% bars and gives only one colour (i would need two colours for group and&amp;nbsp; 6 pattern - for subgroup).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method 2:&lt;/P&gt;&lt;P&gt;========&lt;/P&gt;&lt;P&gt;proc sgpanel data=ip2 pctlevel=group;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;panelby avisit /layout=columnlattice onepanel rows=1 novarname noheaderborder noborder&amp;nbsp; &amp;nbsp; &amp;nbsp; colheaderpos=bottom headerattrs=(Size=8) uniscale=row ;&lt;BR /&gt;colaxis display=(nolabel) fitpolicy=split splitchar='-' ;&lt;BR /&gt;vbar trt / group=avalc stat=percent barwidth=.95 clusterwidth=1;&lt;BR /&gt;*vbarparm category=trt response=percent/group=avalc fill;&lt;BR /&gt;keylegend /title='' ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Vbarparm was not working fine. This above method gives everything other than the pattern(6 patterns for the subgroups) and the colours (two colurs for two different groups).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 10:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645231#M19845</guid>
      <dc:creator>Manj</dc:creator>
      <dc:date>2020-05-05T10:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked ,clustered and grouped bar chart with patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645730#M19848</link>
      <description>&lt;P&gt;In this answer the PANELBY is&amp;nbsp;&lt;STRONG&gt;TIMEFRAME&lt;/STRONG&gt;, VBAR is&amp;nbsp;&lt;STRONG&gt;TREATMENT&lt;/STRONG&gt;, and&amp;nbsp; / GROUP= is&amp;nbsp;&lt;STRONG&gt;THERAPY&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The core issue is that /GROUP&amp;nbsp;&lt;STRONG&gt;THERAPY&lt;/STRONG&gt;&amp;nbsp;values are driving the patterning.&amp;nbsp; These values and their patterns appear in the legend. The categorical data set has the fully expected situation that THERAPY values encountered in one TREATMENT will be the same as encountered in a different TREATMENT.&amp;nbsp; This means the THERAPY based patterning can not accommodate the TREATMENT it is under and thus can not drive color differentiation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's simulate some data so others can play along.&amp;nbsp; The therapy value is coded 0 to 7 and the timeframe is code 0 to 3:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;proc format; 
  value timeframe
  0 = 'Baseline iron use'
  1 = 'Day 1 : Week 12'
  2 = 'Week 12 : Week 24'
  3 = 'Week 24 : Week 36'
  ;

  value therapy
  0 = 'None'
  1 = 'Only IV' 
  2 = 'Only Oral'
  3 = 'Only Other'
  4 = 'Both IV + Oral'
  5 = 'Both IV + Other'
  6 = 'Both Oral + Other'
  7 = 'All IV + Oral + Other'
  ;
run;

data have(keep=patid--timeframe);
  top = 400;
  call streaminit(1234);
  length patid 8 treatment $8 therapy 8 timeframe 8 ;
  do treatment = 'Dapro', 'rhEPO';
    * 400 Dapro, 600 rhEPO;
    do i = 1 to top;
      patid + 1;

      p = rand('uniform', 100);
      select;
        when (p &amp;lt; 40.0) therapy = 0;
        when (p &amp;lt; 85.0) therapy = 1;
        when (p &amp;lt; 92.0) therapy = 2;
        when (p &amp;lt; 93.5) therapy = 3;
        when (p &amp;lt; 95.0) therapy = 4;
        when (p &amp;lt; 96.5) therapy = 5;
        when (p &amp;lt; 98.0) therapy = 6;
        otherwise therapy = 7;
      end;

      do timeframe = 0 to 3;
        * simulate a 3% patient drop out at any timeframe;
        if rand('uniform') &amp;lt; 0.03 then leave;

        * simulate an entire bar segment with no patients;
        if treatment = 'rhEPO' and timeframe = 3 and therapy = 1 then leave;
        output;
      end;
    end;
    top + 200;
  end;
  format 
    timeframe timeframe.
    therapy therapy.
  ;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look at the simplest first try that uses &lt;CODE&gt;STYLE=JOURNAL2&lt;/CODE&gt; for its grayscale theme:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ods html path='.' file='vbar.html' style=Journal2;

proc sgpanel data=have pctlevel=group;
  title 'Simple Starter Plot';
  panelby timeframe / 
    layout=columnlattice 
    onepanel 
  ;

  vbar treatment / 
    group=therapy
    stat=percent
  ;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&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-center" image-alt="VBAR Starter.png" style="width: 909px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39135i7F0BB385AA4BD674/image-size/large?v=v2&amp;amp;px=999" role="button" title="VBAR Starter.png" alt="VBAR Starter.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attached code shows the steps and some intermediate plots demonstrating the transition to a final plot with desired features.&amp;nbsp; The pre plot processing includes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creating a custom template named StackedVbarGroupCrossVar based on Journal2
&lt;UL&gt;
&lt;LI&gt;The first eight GraphData styles elements (for the 8 therapies) specify the cross hatch patterns to use&lt;/LI&gt;
&lt;LI&gt;Another eight GraphData style elements specify the same hatching with ContrastColor=LIGHTRED&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Creating a custom format THERAPY_CROSS_TREATMENT to deal with a transformed value of THERAPY that accounts for TREATMENT&lt;/LI&gt;
&lt;LI&gt;Computing the counts for each TREATMENT &amp;amp; TIMEFRAME combination&lt;/LI&gt;
&lt;LI&gt;Create a PLOT data set that has
&lt;UL&gt;
&lt;LI&gt;New column BAR_COUNT that contain the computed counts&lt;/LI&gt;
&lt;LI&gt;New column THERAPY_CROSS_TREATMENT that segregates therapy according to TREATMENT (Dapro nochange, rhEPO therapy code+10)&lt;/LI&gt;
&lt;LI&gt;New column TREATMENT_WITH_COUNT that has "/(N=&amp;lt;combination-count&amp;gt;)" concatenated to TREATMENT&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The tweaked data now has everything needed tricking out the plot into a final presentation created using the custom template&amp;nbsp;StackedVbarGroupCrossVar:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Compute a quoted list of the rhEPO specific&amp;nbsp;THERAPY_CROSS_TREATMENT formatted values so they can be EXCLUDEd from the KEYLEGEND&lt;/LI&gt;
&lt;LI&gt;Add PANELBY options:
&lt;UL&gt;
&lt;LI&gt;novarname&lt;BR /&gt;noborder&lt;BR /&gt;colheaderpos=bottom&lt;BR /&gt;headerbackcolor=white&lt;BR /&gt;noheaderborder&lt;BR /&gt;uniscale=row&amp;nbsp; (not having uniscale col will let proc remove 'nobar' ticks)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Change the VBAR statement to use tweaked values
&lt;UL&gt;
&lt;LI&gt;vbar &lt;STRONG&gt;treatment_with_count&lt;/STRONG&gt; / &lt;BR /&gt;&amp;nbsp; group=&lt;STRONG&gt;therapy_cross_treatment&lt;/STRONG&gt; ...&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Update the KEYLEGEND to exclude the segregating group values beyond the first eight
&lt;UL&gt;
&lt;LI&gt;keylegend / ...&amp;nbsp;exclude=(&amp;amp;keyexcludes)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Add a rowaxis to display 10% intervals
&lt;UL&gt;
&lt;LI&gt;rowaxis values = (0 to 1 by 0.1) ... ;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Add a colaxis with splitalways so the combination count (the bar total counts) appears below the TREATMENT&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;proc sgpanel data=plot pctlevel=group;
  title 'Presentation Plot Final';
  panelby timeframe / 
    layout=columnlattice 
    onepanel 
    novarname
    noborder
    colheaderpos=bottom
    headerbackcolor=white
    noheaderborder
    uniscale=row
  ;

  vbar treatment_with_count / 
    group=therapy_cross_treatment
    stat=percent
  ;

  label therapy_cross_treatment = 'Iron therapy';

  keylegend / 
    across=4 
    outerpad=14px 
    noborder
    exclude=(&amp;amp;keyexcludes)
  ;

  rowaxis 
    values = (0 to 1 by 0.1)
    display=(noline noticks)
    grid
  ;

  colaxis
    display=(nolabel)
    fitpolicy=splitalways
    splitchar='/'
    valueattrs=(size=8pt)
  ;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="VBAR Final.png" style="width: 910px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39139i60E44D179F44EEB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="VBAR Final.png" alt="VBAR Final.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 20:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Stacked-clustered-and-grouped-bar-chart-with-patterns/m-p/645730#M19848</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-06T20:14:48Z</dc:date>
    </item>
  </channel>
</rss>

