Dashboards & Visualizations

Make Legend Visible in Pie Chart

watsm10
Communicator

Hi,
I'm having trouble getting the legend for my pie chart to show up permanently in my dashboard. Any ideas why this isn't happening?

Here's my code:

<?xml version='1.0' encoding='utf-8'?>
<view template="dashboard.html">
  <label>InsureCom Daily</label>
  <module name="AccountBar" layoutPanel="appHeader"/>
  <module name="AppBar" layoutPanel="navigationHeader"/>
  <module name="Message" layoutPanel="messaging">
    <param name="filter">*</param>
    <param name="clearOnJobDispatch">False</param>
    <param name="maxSize">1</param>
  </module>

  <module name="HiddenSavedSearch" layoutPanel="panel_row1_col1" group="InsureCom Total Transactions" autoRun="True">
    <param name="savedSearch">InsureCom Daily Transactions</param>
    <param name="useHistory">True</param>
    <module name="SingleValue">
      <module name="JobProgressIndicator"/>
    </module>
  </module>

  <module name="HiddenSavedSearch" layoutPanel="panel_row2_col1" group="InsureCom Internal Status" autoRun="True">
    <param name="savedSearch">InsureCom Daily Internal Status</param>
    <param name="useHistory">False</param>
    <module name="HiddenChartFormatter">
      <param name="chart">pie</param>
      <param name="charting.legend.masterLegend"/>
      <param name="charting.legend.placement">right</param>
      <param name="charting.chart.showPercent">true</param>
      <param name="charting.seriesColors">[0x00FF00,0xFF0000]</param>
      <module name="FlashChart">
        <param name="width">100%</param>
        <param name="height">300px</param>
      </module>
      <module name="JobProgressIndicator"/>
    </module>
  </module>
</view>

Thanks.

0 Karma

bruceascot
Explorer

The trick is to concatenate the data series values into your pie slice label, as follows:

Example 1 for count

| stats count by op_eTOM
| eval op_eTOM_Slice=op_eTOM+ ": " + count + " Transactions"
| fields op_eTOM_Slice, count

Example 2 for total durations

| stats sum(Duration) as sum_Duration_Seconds by op_eTOM
| eval total_Minutes=round(sum_Duration_Seconds/60)
| eval op_eTOM_Slice=op_eTOM+ ": " + total_Minutes + " Minutes"
| fields op_eTOM_Slice, sum_Duration_Seconds

0 Karma

theertpr
Explorer

I am looking for answer to this question for a while now, some one relied that it cant be done at all..Appreciate any response on the above question...

0 Karma

madanashok
Path Finder

Me too looking for the same thing.

And also In the above xml we are able to show the percent count using showPercent.Likewise cant we show the count also.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...