Insights 12: Pie Charts

PT 8.62
Randall Groncki

Pie Charts

Pie charts compare values to show portions of a total amount. 

Generally, percentages of a whole.

In many cases, that “whole” may not be the absolute total whole.   But the whole based upon the current security and filters applied to the visualization.

In other words, two people looking at the same chart may see different data based on their security and applied filters.  The visualization will always show a whole pie.  But that “whole” only represents current selections.

Example used in this guide

All the examples in this guide use our X_PT3_TRAINING data set for illustration.   This is the TRAINING table with a few extra fields from the PeopleSoft HCM PUM 54.  See prior blogs and video on how to create a dataset and load data into OpenSearch for use in our Insights.

Create a new Pie Visualization

Navigate: Home > Reporting Tools > Insights.

From the Insights Menu, select “Visualize”, then click the “+ Create visualization” button at the top-right of the page.

Then choose your Index Pattern.  In this series, we’ve been using the “x_pt3_training” source with our PeopleSoft Training data.

The Pie visualization displays showing all the data in the Index Pattern.

The default Pie visualization is the “Donut”.  This is simply a pie chart with the center left blank.  … Like a Donut.

Hovering over any part of the pie pops up the label with the stats.   We see that all 242 data items are in this visualization

Visualization Level Filter

In the upper left corner, there is a “+ Add filter” link.  This is where we add a visualization-based filter.   For example, I only want to show active employees in my visualization.  Add a filter to only show Active Employees.

In my example here, I only want data for Current Active Employees to show on the Pie.

Hovering your cursor over any part of the chart again now shows only 224 data items in the chart.

Configuring the Pie

Aggregation

On the configuration section on the right side of the page, ensure that the “Data” tab is active. 

Then in the “Metrics” box, we can choose the type of Aggregation.  Usually this is either “Count” or Sum” depending on the type of data.  This visualization will show the number of classes in our slices, so choose the “Count” aggregation.

If you choose “Sum”, only numeric fields will display as options for the aggregation. 

You can then add a short custom label in the box below.

Click the “Update” button at the bottom of the page after any change to show that change in the visualization.

Save Early and Often

Save your Visualization by clicking the “Save” button in the Upper-Right corner.

I name my visualizations after the Index Pattern, the chart type and something help find this later like the filters.

Session timeouts and cache errors are not uncommon.  Don’t make too many changes before saving again or you may have to redo all those changes after relogging in and clearing your browser cache.

Buckets

Buckets are variable or memory locations.  

For Pie Charts, buckets are the pie slices you want to display.   Insights has a finite number of buckets per Visualization – only a few thousand. 

For each field values we want to show on our pie, we must define the maximum number of slices we want to display on our pie.  This is not Excel where we can throw any number of slices on the pie.   Insights requires forethought and planning.  

There is an advantage to this.  If you want to show five slices, define 5 buckets.

Our pie is going to show the training classes taken by Company.  Looking into our data, I know that there 14 unique companies in our data.

In the “Buckets” section, click the “+ Add” control and choose “Split Slices”

Aggregation: Terms

Field: Company

Custom Label: Company

Click the “Update” button

The chart updates the pie with five pie slices.   They are the largest class counts by company in our data set.

There are five slices because the “Size” field in our bucket configuration is 5.   Change this to a larger number and that many slices will appear.

Insights fills those buckets in your chosen order.   We left the default “descending” value in the order field, so it started with the company with the most classes (GBI) and progressed until it filled all 5 buckets with the next 4 largest companies by class count.

The chart will only show slices for the buckets with data.   If you defined this field with 100 buckets, only the first 14 buckets would appear since those would be the only buckets with data.   Think of the bucket size value as an “Up To” these many slices value.

There are other options to order than just the slice count.   Other options are Alphabetical or a custom metric.   I would use Alphabetical, if I wanted to show the slices in alphabetical order rather than count order.

Increase the bucket size to 8 and click Update.

Your pie displays the 8 slices.

What about the “Other” Companies

Check the control labeled “Group other values in separate bucket” and click “Update”

You now see a ninth slice labeled “Other”.  This slice holds the sum of the classes for all the other companies not shown on the pie because they’re ranking was larger than the 8 slices we defined.

Click the “Other” slices and then next 8 slices by rank appear on the pie.

At the top of the visualization, you also see a new filter applied to remove the top 8 companies.

Click the “X” on the far right of that filter and the original 8 companies appear with the “Other” slice.

Every Slice is a Filter

Every slice on the pie is a filter.  Click it and it zooms the pie into that slice value.   At the top of the visualization, you can see the current filters.

When the visualization is used on a dashboard, all visualizations on the dashboard are also filtered by the pie slice selection.

Multi-Dimensional Pies

… or “Stacked Pies”

We can add another field to the pie to show the relationships between those two fields.   Generally, you show the larger data idea first, such as company.  Then the smaller field.

*Note – for clarity, I changed the Company buckets back to 5.

Below your current Company Bucket Section, click the “+ Add” control and choose “Split Slices”

Aggregation: Terms

Field: Course Title

Order by: Metric Classes

Order: Descending

Size: 5

Show Others: Yes

Custom Label: Department

Click the “Update” button

We now see the top 5 courses for each company with the “other” course grouped into a 6th slice.

Each slice on both levels is a filter.

Options

Change to the “Options” tab on the configuration section

Donut or Pie?

This control defines whether the visualization is a “Donut” or “Pie”.  The difference is if the center is filled in.

Uncheck the default “Donut”. Update and we see a true pie.

Legend

The “Legend Position” drop down defines which side (top, bottom, right, left) the legend is displayed.  

Click the small “hamburger” control in the bottom left corner to turn off the legend.

Show Tooltip

The Show Tooltip checkbox enables the “popup” when you hover your mouse cursor over a pie slice.  Turn this checkbox off if you do not want the popup box.

Label Settings

This controls the Pie Labels.

ControlEffect
Show LabelsTurns labels on or  off
Show Top Level OnlyIn a multi-dimensional pie, show labels for just the top field or all fields
Show valuesShould the percentage value be shown as part of the label

More Information from other sources

PeopleBooksSearch Technology: Creatin a Visualization for Application Data
OpenSearch.OrgBuilding Data Visualizations

Randall Groncki

Oracle ACE ♠ PeopleTools Developer since 1996 Lives in Northern Virginia, USA

View all posts by Randall Groncki →

Leave a Reply

Your email address will not be published. Required fields are marked *