Create a Lens Using a Polar Gauge Chart with Chart Icons

Explore the Data

Gauge charts are a great way to track your company’s progress toward meeting specific goals. You’ve just put together summary numbers for a high-level presentation on total account value in the countries or regions where your company operates. You’d like to highlight how close (or how far!) the company is from reaching its goal on this important metric.

To log in to the Analytics-enabled developer org when you take the challenge at the end of this page, select Log into a Developer Edition from the connection menu. To log in and play any time, go to

First, set up the exploration:

  1. In the Dataset list, click the worldwide_sales_with_flags dataset to explore it.
  2. Under Bar Length, click Count of Rows, and select Sum, then Value to change the chart to display Sum of Value.
    analytics explorer add sum-of-value measure
  3. Under Bars, click add grouping icon, then select Country to group your chart by country.
    analytics explorer group by country
  4. Click Chart                                          properties icon to open Chart formatting properties, and then enter a title: WORLDWIDE ACCOUNT VALUES for a title.
    analytics explorer bar chart title property

Add the Image URLs to Your Exploration

Remember back to the step where we worked with the CSV dataset? In that step we included the image URLs, but to make them available in your lens, you need to bring them in with a little SAQL (Salesforce Analytics Query Language).

  1. Click SAQL mode icon to go to SAQL mode.
  2. Add ,first('flag_img_url') as 'flag_img_url' to the foreach statement.
  3. Click Run Query.
    You should see a new column (flag_img_url) with the URLs for each flag.
    analytics saql mode query showing results table

You could use any non-grouping SAQL function that preserves the URLs as strings, not just first(). For more information about SAQL, see the Analytics SAQL Reference.

Create the Polar Gauge Chart and Add Flags

Next we’ll add a cool type of gauge called a polar gauge:

  1. Click Chart menu icon to open the chart menu.
  2. From the Gauges category, select Polar Gauge.
  3. Click Chart properties icon and then Range Values and enter (or copy and paste) the following values:
    1. Min: 0
    2. Max:  100000000
    analytics explorer polar gauge chart
  4. Click Conditional Formatting and and select Sum of Value as the column for setting the conditional formats.
    Add 3 bins as follows < than 10000000, 10000000 to 30000000, and >30000000. Select distinct colors for each bin.
    analytics gauge chart color coded bins
  5. Click Trellis to open that panel, then set the following values:
    1. Type: Wrap
    2. Number of charts per line: 6
    analytics gauge chart trellis property
  6. Click Polar Gauge and select Use Icons.
    analytics gauge chart use icons property
  7. Click Save icon and confirm the following values:
    1. Title: worldwide_sales_with_flags
    2. App: My Private App

You’ve got some awesome looking gauges there! Now let’s give this visualization a little more class with a dark theme.