Create a Lens Using a Polar Gauge Chart with Chart Icons
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 login.salesforce.com.
First, set up the exploration:
- In the Dataset list, click the worldwide_sales_with_flags dataset to explore it.
Under Bar Length, click Count of Rows, and select
Value to change the chart to
display Sum of Value.
Under Bars, click , then select
Country to group your chart
Click to open Chart formatting properties, and then enter a
title: WORLDWIDE ACCOUNT VALUES for a
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).
- Click to go to SAQL mode.
- Add ,first('flag_img_url') as 'flag_img_url' to the foreach statement.
Click Run Query.
You should see a new column (flag_img_url) with the URLs for each flag.
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.
Next we’ll add a cool type of gauge called a polar gauge:
- Click to open the chart menu.
- From the Gauges category, select Polar Gauge.
then Range Values and enter (or copy
and paste) the following values:
- Min: 0
- Max: 100000000
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.
Click Trellis to open that panel, then set the following values:
- Type: Wrap
- Number of charts per line: 6
Click Polar Gauge and select Use Icons.
Click and confirm the following values:
- Title: worldwide_sales_with_flags
- 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.