<?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: Can we change the shape of the Bubble in Bubble Chart. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/881804#M23907</link>
    <description>&lt;P&gt;Instead of using a BUBBLEPLOT, use a SCATTERPLOT with the SIZERESPONSE option to have the marker size vary by data value. the SIZEMIN and SIZEMAX options can be used to change the min and max size range of the markers. Then, just use MARKERATTRS=(symbol=&amp;lt;some symbol&amp;gt;) to set the shape you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 20:32:24 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2023-06-21T20:32:24Z</dc:date>
    <item>
      <title>Can we change the shape of the Bubble in Bubble Chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/881802#M23906</link>
      <description>&lt;P&gt;Please tell me if it's a stupid question.&amp;nbsp; I am looking to create a bubble graph. But I want to change the shape of the bubble. Is that possible? (this may be a stupid question sorry!); if it's not possible, is there any other alternative way. Thanks&lt;/P&gt;
&lt;P&gt;Code&amp;nbsp; Credits&amp;nbsp; :&lt;A title="Posts by Sanjay Matange" href="https://blogs.sas.com/content/author/sanjaymatange/" target="_blank" rel="author noopener"&gt;Sanjay Matange&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;reference:&amp;nbsp;&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/files/2015/06/Bubble.txt" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/graphicallyspeaking/files/2015/06/Bubble.txt&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let gpath='.';
%let dpi=200;

ods html close;
ods listing gpath=&amp;amp;gpath image_dpi=&amp;amp;dpi;

/*--Create Bubble Data--*/
/*--Areas of min and max bubble size is computed--*/
data bubble;
  format Area  4.1 size 2.0;
  format LinArea PropArea 4.0;
  pi=constant("pi");
  input X Y Size Type $ Cat $;
  /*--Area of bubble with Size as redius--*/
  Area=size*size*pi/4;

  /*--Min and max size of bubbles on screen and areas--*/
  maxR=3*7; minR=7;
  MaxArea=maxR*maxR*pi; 
  MinArea=minR*minR*pi;
  Max=15; Min=13;

  /*--Area of bubble using linear scaling--*/
  LinArea= MinArea+(Size-Min)*(maxArea-minArea)/(Max-Min); 

  /*--Area of bubble using Proportional scaling--*/
  PropArea= Size*maxArea/max;

  LinLbl='ValueArea=' || put (area, 4.0) || '-PixelArea=' || put(LinArea, 4.1);
  PropLbl='ValueArea=' || put (area, 4.0) || '-PixelArea=' || put(PropArea, 4.1);
 
  datalines;
 20   20   14  A  X
 50   10   13  B  Y
 80   60   15  A  Z
;
run;
ods html;
proc print;run;
ods html close;
ods path(prepend) work.templat(update);
/*--Bubble Chart with Linear scaling--*/
ods graphics / reset attrpriority=color width=4in height=2.8in imagename='Bubble_Linear_SG';
/*--Bubble Chart with Proportional scaling--*/
proc template;
  define statgraph Bubble;
    begingraph;
      entrytitle 'Proportional Bubble Size - GTL'; ;
      layout overlay /   aspectratio=0.7 xaxisopts=(display=(ticks tickvalues line) griddisplay=on 
                                    linearopts=(viewmin=0 viewmax=100) offsetmin=0 offsetmax=0.1)
                             yaxisopts=(display=(ticks tickvalues line) griddisplay=on
                                    linearopts=(viewmin=0 viewmax=70) offsetmin=0 offsetmax=0.1);
            bubbleplot x=x y=y size=size/ group=type datalabel=PropLbl relativescaletype=proportional 
                   datalabelsplit=true datalabelsplitchar='-' name='a' dataskin=sheen
                   display=(fill);
            textplot x=x y=y text=size / position=center;

      endlayout;
        endgraph;
  end;
run;

/*--Bubble Chart with Proportional scaling--*/
ods graphics / reset width=4in height=2.8in imagename='Bubble_Prop_GTL';
proc sgrender data=bubble template=bubble;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jun 2023 20:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/881802#M23906</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-06-21T20:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can we change the shape of the Bubble in Bubble Chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/881804#M23907</link>
      <description>&lt;P&gt;Instead of using a BUBBLEPLOT, use a SCATTERPLOT with the SIZERESPONSE option to have the marker size vary by data value. the SIZEMIN and SIZEMAX options can be used to change the min and max size range of the markers. Then, just use MARKERATTRS=(symbol=&amp;lt;some symbol&amp;gt;) to set the shape you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 20:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/881804#M23907</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-06-21T20:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can we change the shape of the Bubble in Bubble Chart.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/882282#M23911</link>
      <description>&lt;P&gt;Thank you it worked.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 18:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Can-we-change-the-shape-of-the-Bubble-in-Bubble-Chart/m-p/882282#M23911</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2023-06-24T18:30:32Z</dc:date>
    </item>
  </channel>
</rss>

