Creating variable-sized Bubble Plots

The default marker is a blue bubble that is 15 pixels in diameter. If you need to vary the size the bubble based upon a measurement, you can follow the directions in the template that is shown by default in the expression editor for the “Size” field in the “Marker Properties” section (as detailed here).

There are several options for sizing the markers/bubbles, but two common scenarios are explained below.

Based on a Percent-to-Total contribution

If your marker is defined by a field called “Venue” and you wanted it sized by the “Sales” field varying from 5 to 25 pixels based upon the Venue’s contribution to the total, you can follow the directions in the template to create an expression that looks similar to this:

  =( sum(Sales) / (Max(TOTAL aggr(sum(Sales),Venue))) * 25 ) + 5

Based on a quantile/fractile

Using a quantile/fractile strategy may sometimes be a better option to size your markers than percent-to-total contribution. The two most common reasons for using a quantile/fractile strategy are:

  • You have a large number of points, so the percent-to-total contribution will be very low for each point. Using the percent-to-total contribution will render all of the markers the same size.
  • All of the points have similar sales, so the percent-to-total contribution will be almost identical. Using  will render all of the markers the same size.

NOTE: A detailed definition of quantiles can be found here: http://quantile.askdefine.com. The most common quantiles/fractiles are: percentiles, deciles, and quintiles.

For example, If your marker is defined by a field called “Venue” and you wanted it sized by the “Sales” field varying from 5 to 23 pixels based upon , you can follow the directions in the template to create an expression that looks similar to this:

=if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.1),  5,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.15), 6,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.2),  7,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.25), 8,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.3),  9,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.35), 10,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.4),  11,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.45), 12,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.5),  13,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.55), 14,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.6),  15,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.65), 16,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.7),  17,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.75), 18,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.8),  19,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.85), 20,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.9),  21,
   if(aggr(sum([Sales]),Venue) <= fractile(total aggr(sum([Sales]),Venue), 0.95), 22, 23
	))))))))))))))))))