Splunk® Enterprise

Splunk Dashboard Studio

Splunk Enterprise version 9.0 will no longer be supported as of June 14, 2024. See the Splunk Software Support Policy for details. For information about upgrading to a supported version, see How to upgrade Splunk Enterprise.
This documentation does not apply to the most recent version of Splunk® Enterprise. For documentation on the most recent version, go to the latest release.

Part 4 Add a pie chart visualization

As a representative of Buttercup Games, you need to present a breakdown of the store's revenue comes. In Splunk Dashboard Studio, you can add a pie chart visualization and choose between a pie or donut appearance. To showcase the revenue breakdown, create a donut chart that divides the store's total revenue by game.

  1. Select the add chart icon (A bar graph as an icon.) in the editing toolbar, and then select Pie.
  2. In the New Data Source panel, name the source Revenue by Game.
  3. Add your search. For this tutorial, copy and paste the following search into the Search with SPL box:
    index=main sourcetype=access_* action=purchase status=200 
    | stats count values(price) as Price by productName productId 
    | table productName productId count Price
    | eval revenue=count*Price 
    | fields productName revenue
    | rename productName as "Game" revenue as "Revenue" 
    | sort -Revenue
    
  4. Expand the Code section and change the Data Source ID to ds_revenue_by_game.
  5. Select Apply & Close. At this point, you've created a new data source, given it a unique ID, and assigned it to a pie chart.
  6. Title your pie chart Revenue by Game and leave the description box empty.
  7. In the Appearance section of the Configuration panel, select Donut.
  8. In the Labels section, select Values & Percent.
    1. For Dashboard Studio in Splunk Enterprise versions 8.3.1 and earlier, in the Labels section, select Show Values. Showing percentages is currently unavailable for Dashboard Studio in Splunk Enterprise versions 8.3.1 and earlier.
  9. Expand the Code section and change the Visualization ID to viz_gameRevenue. At this point, you've given your chart a unique ID, changed its appearance to a donut, and labeled each game with a percentage.
  10. Move and resize your pie chart to center it on the bottom left gray rectangle.
  11. In the General section of the Configuration panel, change the Background to transparent.
    1. For Dashboard Studio in Splunk Enterprise versions 8.3.1 and earlier, you can change the background color by opening the source editor and adding the option "backgroundColor": "transparent".

After completing Part 4, your donut chart looks similar to the following:

A donut chart showing each game's percentage of total company revenue.

Next step

You've completed Part 4 of the Splunk Dashboard Studio tutorial.

Now your dashboard has a donut chart. Next, show purchases in relation to time by adding a column chart. Continue to Part 5: Add a column chart.

Last modified on 29 June, 2023
Part 3 Add a table with column formatting   Part 5 Add a column chart

This documentation applies to the following versions of Splunk® Enterprise: 9.0.3, 9.0.4, 9.0.5, 9.0.6, 9.0.7, 9.0.8, 9.0.9, 9.0.10


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters