<?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: Adding dynamic label to bar in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509288#M17331</link>
    <description>&lt;P&gt;Some macro variables in your program are not resolved.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: Apparent symbolic reference DCPS_ID not resolved.&lt;BR /&gt;ERROR: Variable dcps_student_id is not on file&lt;BR /&gt; WORK.ELEMENTARY_PROMO_GRAPHS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Try a simpler case like this that works.&amp;nbsp; Maybe you can build from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data foo;
  input cat $ Value Label $;
  datalines;
A  10  X
B  15  Y
;
run;

proc print;run;

proc sgplot data=foo;
  vbar cat / response=value group=cat datalabel=label groupdisplay=cluster
          datalabelattrs=(size=12);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 31 Oct 2018 19:36:04 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2018-10-31T19:36:04Z</dc:date>
    <item>
      <title>Adding dynamic label to bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509235#M17328</link>
      <description>&lt;P&gt;l am trying to draw a barchart that has a label on the top of each bar that is derived from a data set.&lt;/P&gt;&lt;P&gt;proc sgplot data=work.cohort_graph_FSA_read dattrmap=cohort_graph_FSA_read_attr noautolegend subpixel;&lt;BR /&gt;title "FSA/FSAA Reading" ;&lt;BR /&gt;vbar test_year / response=AL group=graph_test_score&lt;BR /&gt;attrid=AL_color&lt;BR /&gt;dataskin=pressed&lt;BR /&gt;datalabelpos=top&lt;BR /&gt;datalabel=graph_test_score&lt;BR /&gt;datalabelattrs=(color=white weight=bold size=12);&lt;BR /&gt;xaxis display=(noticks noline nolabel);&lt;BR /&gt;yaxis display=(noline noticks nolabel) grid max=5 min=0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where "graph_test_score" is some text derived from the data set "work.&lt;SPAN&gt;cohort_graph_FSA_read" such as "AL=3 (SS=320)" for one year(bar) and "AL=4 (SS=350)" for a different year(bar)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;picture added to file&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 18:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509235#M17328</guid>
      <dc:creator>cuevasj</dc:creator>
      <dc:date>2018-10-31T18:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dynamic label to bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509247#M17329</link>
      <description>&lt;P&gt;Can't run your program without some sample data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it not working?&amp;nbsp; Try using GROUPDISPLAY=Cluster and remove DataLabelPos option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 18:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509247#M17329</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-10-31T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dynamic label to bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509278#M17330</link>
      <description>&lt;P&gt;I have attached a sample file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;removing datalabelpos and adding groupdisplay=cluster, did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the full code. ( I do not have rights on my computer to load a dataset, so I took one student's data and moved it into an excel file.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import out=work.elementary_promo_graphs&lt;BR /&gt;datafile= "xxx\elmentary FSA graph label.xlsx"&lt;BR /&gt;dbms=xlsx replace;&lt;BR /&gt;sheet="Sheet1";&lt;BR /&gt;getnames=yes;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*** FSA\FSAA:read Graph ***/&lt;BR /&gt;data cohort_graph_FSA_read;&lt;BR /&gt;set work.elementary_promo_graphs;&lt;BR /&gt;where dcps_student_id="&amp;amp;DCPS_ID" and test_component_code in ('RO','UB') and school_number ne '9999';&lt;BR /&gt;graph_test_score=cat('AL=',strip(test_level),' (SS=',strip(put(test_score,4.)),')');&lt;BR /&gt;AL=input(test_level,4.);&lt;BR /&gt;test_name=strip(test_code)||' Read';&lt;BR /&gt;run;&lt;BR /&gt;data cohort_graph_FSA_read_attr;&lt;BR /&gt;set cohort_graph_FSA_read;&lt;BR /&gt;value=AL;&lt;BR /&gt;length fillcolor $8.;&lt;BR /&gt;id='AL_color';&lt;BR /&gt;if AL=1 then fillcolor='Red'; else&lt;BR /&gt;if AL=2 then fillcolor='Yellow'; else&lt;BR /&gt;if AL=3 then fillcolor='Green'; else&lt;BR /&gt;if AL=4 then fillcolor='Blue'; else&lt;BR /&gt;if AL=5 then fillcolor='Black'; else&lt;BR /&gt;fillcolor='White';&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=work.cohort_graph_FSA_read; by test_year test_period_seq; run;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select distinct&lt;BR /&gt;coalesce(count(test_score),1)&lt;BR /&gt;into&lt;BR /&gt;:RO_count&lt;BR /&gt;from&lt;BR /&gt;work.cohort_graph_FSA_read&lt;BR /&gt;where&lt;BR /&gt;test_score not in (.,0);&lt;BR /&gt;quit;&lt;BR /&gt;%let RO_count=&amp;amp;RO_count;&lt;BR /&gt;%put &amp;amp;RO_count;&lt;/P&gt;&lt;P&gt;/* Test History Section - FSA/FSAA:Read */&lt;BR /&gt;**ods region x=7.7cm y=8.0cm width=5.0cm height=5.0cm;&lt;BR /&gt;proc sgplot data=work.cohort_graph_FSA_read dattrmap=cohort_graph_FSA_read_attr noautolegend subpixel;&lt;BR /&gt;title "FSA/FSAA Reading" ;&lt;BR /&gt;vbar test_year / response=AL group=graph_test_score&lt;BR /&gt;attrid=AL_color&lt;BR /&gt;dataskin=pressed&lt;BR /&gt;groupdisplay=cluster&lt;BR /&gt;datalabel=graph_test_score&lt;BR /&gt;datalabelattrs=(color=white weight=bold size=12);&lt;BR /&gt;xaxis display=(noticks noline nolabel);&lt;BR /&gt;yaxis display=(noline noticks nolabel) grid max=5 min=0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 19:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509278#M17330</guid>
      <dc:creator>cuevasj</dc:creator>
      <dc:date>2018-10-31T19:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding dynamic label to bar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509288#M17331</link>
      <description>&lt;P&gt;Some macro variables in your program are not resolved.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: Apparent symbolic reference DCPS_ID not resolved.&lt;BR /&gt;ERROR: Variable dcps_student_id is not on file&lt;BR /&gt; WORK.ELEMENTARY_PROMO_GRAPHS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Try a simpler case like this that works.&amp;nbsp; Maybe you can build from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data foo;
  input cat $ Value Label $;
  datalines;
A  10  X
B  15  Y
;
run;

proc print;run;

proc sgplot data=foo;
  vbar cat / response=value group=cat datalabel=label groupdisplay=cluster
          datalabelattrs=(size=12);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Oct 2018 19:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-dynamic-label-to-bar/m-p/509288#M17331</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-10-31T19:36:04Z</dc:date>
    </item>
  </channel>
</rss>

