Desktop productivity for business analysts and programmers

Bubble Color Variation

Reply
Contributor
Posts: 73

Bubble Color Variation

Hello SAS/GRAPH and chart users,

I am using three variables to generate this bubble chart: year, month, price

bubble.jpg

Is it possible to control color of these bubbles depending on size? For instance have two categories - blue for big and pink for little ones?

Thankfully,

Dhanashree Gadkari

Contributor
Posts: 73

Re: Bubble Color Variation

I haven't used a bubble chart in SAS. Have you checked the SAS web site to see what options are available for this version of proc gplot?

It would be a different chart type, but you could use the 'tile chart'. EG will let you set multiple colors and it blends them together based on your values. I've attached an example I made when I was testing it out a few months ago.

A bonus feature of the tile chart is that in the html format you can drill down. so you could start with tiles by year, then drill into a year and see the months in greater detail.

tile chart sample.JPG

Contributor
Posts: 73

Re: Bubble Color Variation

I guess there is no way to control color variation in bubble statement. There is BFILL=gradient option for generating gradient-filled bubbles.

By default, the JAVA and ActiveX devices create solid bubbles.

  • BFILL=SOLID fills the bubbles with the color specified by the BCOLOR= option. If the BFILL option is not specified, then the color is specified by the current style. If you are using specific ODS style, the color comes from the contrast color attribute within the GraphData1 style element.

  • BFILL=GRADIENT starts with the current axis area color and gradually transitions to the color specified with the BCOLOR= option or the color of the current style. If you are using an ODS style, the colors are controlled by the startcolor and endcolor attributes of the TwoColorAltRamp style element.

Restriction:Not supported by Java and ActiveX

Note:The SAS/GRAPH ActiveX control displays negative values as empty circles.

However my setup is not displaying gradience. I am currently using Ocean ods html style with ActiveX for Graph as my Tools->Options settings. Changing this to JPEG or non-Java and non-ActiveX, gives me compile time errors.

I am looking for something similar to LEVELS option provided for chrono statement in maps.

Mr. Chris, can you share gplot step for tile chart you generated above; it might clear haze in deciding if this kind of chart can help out. Thank you so much.

Contributor
Posts: 73

Re: Bubble Color Variation

Sure. I'll copy in some screenshots to show what I did. The task is part of the 'graph' group (which uses PROC GTILE I believe).

The setup of the data is very important. The classification variables (the drill down groupings) must be set up so that you can follow that same hierarchy in the data. In my example, I start with 4 groups by month, then drill into two error types (preventable and non-preventable), and finally the information at its most granular level is in groups of error names. So there needs to be a record in your data set for each month/error type/error name grouping.

tilechart data setup.JPG

Then here are the ways I set up the task. I chose 3 colors, negative values in red transitioning to positive values in green with a white transition color in the middle (in this case, there are extreme values, most of the data is close to the midpoint, therefore much of my chart is white unfortunately.) Then I chose max and min values of the same absolute value so that the chart would have a symmetric range around zero (in reality, the positive and negative sides were unbalanced and by default SAS made the midpoint for the colors approx -100k).

task - data tab.JPGtask - appear1.JPGtask - appear2.JPG

Contributor
Posts: 73

Re: Bubble Color Variation

ok.. thank you. this was quite enlightening.

Ask a Question
Discussion stats
  • 4 replies
  • 452 views
  • 3 likes
  • 2 in conversation