<?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 SGPLOT- How to change the seglabel color on a stacked bar chart and change the font for axis values? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906237#M24221</link>
    <description>&lt;P&gt;Hi, I'm a SAS novice but a long timer lurker of the board! I'm trying to create a stacked butterfly plot with 5 bar colors. In order for the data labels to stand out, I'd like to use black text on the VLIGB background and white on the remaining backgrounds. I'd also like to change the font throughout the plot to Arial.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Data:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Diagnosis&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;_2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;_1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;grade&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ALL&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;70&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-70&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ALL&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-13&lt;/P&gt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;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Breast Cancer&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;41&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-24&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Breast Cancer&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;13&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-13&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Code:&lt;/P&gt;&lt;P&gt;proc sgplot data = work.diagnosis noborder nowall;&lt;BR /&gt;styleattrs datacontrastcolors=(black) datacolors=(VLIGB BIGB blue midnightblue&amp;nbsp; maroon);&lt;BR /&gt;format _1 positive.;&lt;BR /&gt;hbar aedecod / response = _1 group = grade groupdisplay = stack barwidth=0.7 grouporder=ascending&amp;nbsp;&lt;BR /&gt;seglabel&lt;BR /&gt;seglabelfitpolicy = thin&lt;BR /&gt;seglabelattrs =(size = 9 weight = bold)&lt;BR /&gt;name = "c1";&lt;/P&gt;&lt;P&gt;hbar aedecod / response = _2 group = grade groupdisplay = stack barwidth=0.7 grouporder=ascending&lt;BR /&gt;seglabel&lt;BR /&gt;seglabelfitpolicy = thin&lt;BR /&gt;seglabelattrs = (size = 9 color = white weight = bold);&lt;BR /&gt;xaxis grid gridattrs = (pattern = solid) valueattrs = (size=10 weight = bold)&lt;BR /&gt;labelattrs = (weight = bold) display=(noticks)&lt;BR /&gt;label = "Records (%)" values = (-80 to 80 by 20);&lt;BR /&gt;yaxis display = (noline nolabel noticks) discreteorder = data&lt;BR /&gt;valueattrs = (weight = bold) label="Patients" labelattrs=(size=10);&lt;BR /&gt;keylegend "c1"/ across = 10 noborder title = '' valueattrs=(size=11) sortorder=ascending;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2023 14:21:57 GMT</pubDate>
    <dc:creator>Stilllearning</dc:creator>
    <dc:date>2023-12-05T14:21:57Z</dc:date>
    <item>
      <title>SGPLOT- How to change the seglabel color on a stacked bar chart and change the font for axis values?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906237#M24221</link>
      <description>&lt;P&gt;Hi, I'm a SAS novice but a long timer lurker of the board! I'm trying to create a stacked butterfly plot with 5 bar colors. In order for the data labels to stand out, I'd like to use black text on the VLIGB background and white on the remaining backgrounds. I'd also like to change the font throughout the plot to Arial.&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Data:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Diagnosis&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;_2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;_1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;grade&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ALL&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;70&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-70&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ALL&lt;/P&gt;&lt;/TD&gt;&lt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&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Breast Cancer&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;41&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-24&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Breast Cancer&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;13&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;-13&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Group 5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Code:&lt;/P&gt;&lt;P&gt;proc sgplot data = work.diagnosis noborder nowall;&lt;BR /&gt;styleattrs datacontrastcolors=(black) datacolors=(VLIGB BIGB blue midnightblue&amp;nbsp; maroon);&lt;BR /&gt;format _1 positive.;&lt;BR /&gt;hbar aedecod / response = _1 group = grade groupdisplay = stack barwidth=0.7 grouporder=ascending&amp;nbsp;&lt;BR /&gt;seglabel&lt;BR /&gt;seglabelfitpolicy = thin&lt;BR /&gt;seglabelattrs =(size = 9 weight = bold)&lt;BR /&gt;name = "c1";&lt;/P&gt;&lt;P&gt;hbar aedecod / response = _2 group = grade groupdisplay = stack barwidth=0.7 grouporder=ascending&lt;BR /&gt;seglabel&lt;BR /&gt;seglabelfitpolicy = thin&lt;BR /&gt;seglabelattrs = (size = 9 color = white weight = bold);&lt;BR /&gt;xaxis grid gridattrs = (pattern = solid) valueattrs = (size=10 weight = bold)&lt;BR /&gt;labelattrs = (weight = bold) display=(noticks)&lt;BR /&gt;label = "Records (%)" values = (-80 to 80 by 20);&lt;BR /&gt;yaxis display = (noline nolabel noticks) discreteorder = data&lt;BR /&gt;valueattrs = (weight = bold) label="Patients" labelattrs=(size=10);&lt;BR /&gt;keylegend "c1"/ across = 10 noborder title = '' valueattrs=(size=11) sortorder=ascending;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 14:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906237#M24221</guid>
      <dc:creator>Stilllearning</dc:creator>
      <dc:date>2023-12-05T14:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT- How to change the seglabel color on a stacked bar chart and change the font for axis val</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906265#M24222</link>
      <description>&lt;P&gt;Example data is best provided as a working data step. That way we don't have to make guesses as to things like variable types. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that isn't possible for you then at least paste the "data" as plain text into a text box opened with the &amp;lt;/&amp;gt; icon. That particular "table" appearance is not making a nice set of text to copy/paste into the editor and write code with and I am too lazy to fix whatever not obvious characters make that not nice in the editor manually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also should provide other info so that we can attempt to run your code. For example you have a custom format named Positive without any definition. Since it is applied to a variable that in your small example data shows apparently negative numeric values the purpose of that format is not at all obvious.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 16:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906265#M24222</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-12-05T16:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT- How to change the seglabel color on a stacked bar chart and change the font for axis val</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906301#M24224</link>
      <description>&lt;P&gt;Thank you so much for your response! I will try to reformat and update.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 18:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906301#M24224</guid>
      <dc:creator>Stilllearning</dc:creator>
      <dc:date>2023-12-05T18:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT- How to change the seglabel color on a stacked bar chart and change the font for axis val</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906898#M24230</link>
      <description>&lt;P&gt;Thank you again for you comment! I've created a new topic with the correct format.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 01:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-How-to-change-the-seglabel-color-on-a-stacked-bar-chart/m-p/906898#M24230</guid>
      <dc:creator>Stilllearning</dc:creator>
      <dc:date>2023-12-08T01:13:25Z</dc:date>
    </item>
  </channel>
</rss>

