<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pie Chart Problem in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347584#M41765</link>
    <description>&lt;P&gt;Sorry, It's not about the colouring.  How do I decode the zeros and non-zero values so that it forms the 100% of Pie.  I.e. for each component I will need to assign 1/6 weightage.   &lt;/P&gt;

&lt;P&gt;If I simply plot the graph for the below listed values, then Splunk ignores all Components in the Pie and only Comp5 as it has a non-zero values&lt;/P&gt;

&lt;P&gt;Comp1 0&lt;BR /&gt;
Comp2 0&lt;BR /&gt;
Comp3 0&lt;BR /&gt;
Comp4 0&lt;BR /&gt;
Comp5 18 &lt;BR /&gt;
Comp6 0&lt;/P&gt;</description>
    <pubDate>Wed, 18 Apr 2018 07:01:40 GMT</pubDate>
    <dc:creator>sarvan7777</dc:creator>
    <dc:date>2018-04-18T07:01:40Z</dc:date>
    <item>
      <title>Pie Chart Problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347582#M41763</link>
      <description>&lt;P&gt;I'm new to Splunk and initially, this requirement appears easy to me, but doesn't seem to be.  I have some 6 application components.  Each component is running tens of Adapters.&lt;/P&gt;

&lt;P&gt;Component   Failed Adapter Count&lt;BR /&gt;
=========   ================&lt;BR /&gt;
Comp1       0&lt;BR /&gt;
Comp2       0&lt;BR /&gt;
Comp3       0&lt;BR /&gt;
Comp4       0&lt;BR /&gt;
Comp5       18  (I don't care about this number.  Any value greater than 0 means its a Failed Component.)&lt;BR /&gt;
Comp6       0&lt;/P&gt;

&lt;P&gt;I just wanted to create a Pie Chart showing 1 of the 6 Component is down (May be 5 parts of the Pie in Green Colour and 1 Part in Red).  with the data I have mentioned above&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347582#M41763</guid>
      <dc:creator>sarvan7777</dc:creator>
      <dc:date>2018-04-18T06:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347583#M41764</link>
      <description>&lt;P&gt;Try to seriesColors like this for pie in xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;option name="charting.seriesColors"&amp;gt;[0x00FF00,0x999999]&amp;lt;/option&amp;gt;  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347583#M41764</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T06:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347584#M41765</link>
      <description>&lt;P&gt;Sorry, It's not about the colouring.  How do I decode the zeros and non-zero values so that it forms the 100% of Pie.  I.e. for each component I will need to assign 1/6 weightage.   &lt;/P&gt;

&lt;P&gt;If I simply plot the graph for the below listed values, then Splunk ignores all Components in the Pie and only Comp5 as it has a non-zero values&lt;/P&gt;

&lt;P&gt;Comp1 0&lt;BR /&gt;
Comp2 0&lt;BR /&gt;
Comp3 0&lt;BR /&gt;
Comp4 0&lt;BR /&gt;
Comp5 18 &lt;BR /&gt;
Comp6 0&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 07:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347584#M41765</guid>
      <dc:creator>sarvan7777</dc:creator>
      <dc:date>2018-04-18T07:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347585#M41766</link>
      <description>&lt;P&gt;ohh!! Can you share the search query you are using? Try something below to display all component even if its value is zero.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;yourindex&amp;gt; | stats values(adaptor) as "Adapter Count" by Component
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 07:08:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347585#M41766</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T07:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347586#M41767</link>
      <description>&lt;P&gt;[UPDATED ANSWER]&lt;/P&gt;

&lt;P&gt;If your objective is to create a Slice of equal size for each component irrespective of the count you can try the following run anywhere search. The query from &lt;CODE&gt;| makeresults&lt;/CODE&gt; till &lt;CODE&gt;| fields - _time data&lt;/CODE&gt;cook up sample data. You can use your base search instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval data="Comp1=0;Comp2=0;Comp3=0;Comp4=0;Comp5=18;Comp6=0"
| makemv data  delim=";"
| mvexpand data
| eval data=split(data,"=")
| eval component=mvindex(data,0),count=mvindex(data,1)
| fields - _time data
| stats sum(count) as count by component
| streamstats count as sliceCount by component
| eval status=if(count=0,"Success","Fail")
| eval component=component."(".status."- ".count.")"
| table component sliceCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;@sarvan7777 pie chart will not show Slices with count 0. It will show only slices which do not have count 0. Which means you will have to color Slice Label based on value (which would require CSS and possibly jQuery also).&lt;/P&gt;

&lt;P&gt;Instead if you are on Splunk 6.6 or higher, you can use Trellis Layout with Single Value (built in visualization) or Status Indicator Custom Visualization provided your final query is statistical query by split &lt;CODE&gt;by component&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Following is a run anywhere dashboard example based on sample data provided in the question. (There are several examples of Single Value and Status Indicator with Trellis that you can check out on Splunk Answers).&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4796i20CF20AB1643C87F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Following is run anywhere dashboard simple xml code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Single Value Trellis Color by value&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults
| eval data="Comp1=0;Comp2=0;Comp3=0;Comp4=0;Comp5=18;Comp6=0"
| makemv data  delim=";"
| mvexpand data
| eval data=split(data,"=")
| eval component=mvindex(data,0),count=mvindex(data,1)
| fields - _time data
| stats sum(count) as count by component&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="colorBy"&amp;gt;value&amp;lt;/option&amp;gt;
        &amp;lt;option name="colorMode"&amp;gt;block&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="height"&amp;gt;120&amp;lt;/option&amp;gt;
        &amp;lt;option name="numberPrecision"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0x65a637","0xd93f3c"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[0]&amp;lt;/option&amp;gt;
        &amp;lt;option name="showSparkline"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="showTrendIndicator"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;small&amp;lt;/option&amp;gt;
        &amp;lt;option name="trendColorInterpretation"&amp;gt;standard&amp;lt;/option&amp;gt;
        &amp;lt;option name="trendDisplayMode"&amp;gt;absolute&amp;lt;/option&amp;gt;
        &amp;lt;option name="unitPosition"&amp;gt;after&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="useThousandSeparators"&amp;gt;1&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: Adjust height of the Panel based on your need ( using Simple XML configuration &lt;CODE&gt;&amp;lt;option name="height"&amp;gt;120&amp;lt;/option&amp;gt;&lt;/CODE&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Pie-Chart-Problem/m-p/347586#M41767</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-18T08:04:11Z</dc:date>
    </item>
  </channel>
</rss>

