<?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 Display Color Based On Status (String Value) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338341#M160814</link>
    <description>&lt;P&gt;@arielpconsolacion&lt;/P&gt;

&lt;P&gt;In this case we have to use some tric in search and pie logic.&lt;BR /&gt;
Below is search make crack pie chart and pass numeric value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;&amp;lt;YOUR SEARCH&amp;gt;&amp;gt;| table Group Status | eval count=1 | append [| stats count | eval Group="C",Status="Not Started"] | append [| stats count | eval Group="A",Status="In Progress" | append [| stats count | eval Group="B",Status="Completed" ]] | sort Status | table Group count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this search I'm sorting status and arranging resuls. If any status missing in results, then sorting won't work so I have appended messing status with 0 count. &lt;/P&gt;

&lt;P&gt;In pie chart color option I have added below option only.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.seriesColors"&amp;gt;[0x008000,0xffff00,0xff0000]&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try it?&lt;/P&gt;

&lt;P&gt;I hope it works for you.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kamlesh&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2017 13:25:25 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2017-06-14T13:25:25Z</dc:date>
    <item>
      <title>Pie Chart Display Color Based On Status (String Value)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338338#M160811</link>
      <description>&lt;P&gt;I have the below data and I am trying to display it in a Pie chart that will display the group in a corresponding color based on their status.&lt;BR /&gt;
Orange - In Progress&lt;BR /&gt;
Green - Completed&lt;BR /&gt;
Red - Not Started&lt;/P&gt;

&lt;P&gt;I can't achieve it using stats/chart as I understood that the count is only based on one category (e.g. Status).&lt;BR /&gt;
I was able to achieve it using xyseries but in a column chart. Anyone who can advise to display in a pie chart? &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/3042iE99701CFB052D6F2/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;Group       Status&lt;BR /&gt;
  A           In Progress&lt;BR /&gt;
  B           Completed&lt;BR /&gt;
  C           Not Started&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 01:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338338#M160811</guid>
      <dc:creator>arielpconsolaci</dc:creator>
      <dc:date>2017-06-07T01:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Display Color Based On Status (String Value)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338339#M160812</link>
      <description>&lt;P&gt;@arielpconsolacion,&lt;/P&gt;

&lt;P&gt;You can either use &lt;STRONG&gt;fieldColors&lt;/STRONG&gt; or &lt;STRONG&gt;seriesColors&lt;/STRONG&gt; SimpleXML chart configuration option depending on whether you know the field names or if all fields are always present respectively. Refer to Simple  XML Chart Configuration reference documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference#General_chart_properties"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference#General_chart_properties&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;option name="charting.fieldColors"&amp;gt;{"Completed":0x008000,"In Progress":0xffff00,"Not Started":0xff0000}&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With seriesColors you need not provide field names but since the colors are applied in sequence, you have to make sure that all fields/series are always present (or zero if absent) and in the same sequence (in your case you might have to label field names as "1.Completed", "2.In Progress" and "3.Not Started"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;option name="charting.seriesColors"&amp;gt;[0x008000,0xffff00,0xff0000]&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 07:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338339#M160812</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-06-07T07:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Display Color Based On Status (String Value)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338340#M160813</link>
      <description>&lt;P&gt;Hi @niketnilay,&lt;/P&gt;

&lt;P&gt;Thank you for your suggestions above. Chart needs a numerical field in that case mine does not have. Or if I can, i can only count per 1 field ( Group or Status in my example). Any advise on this matter?&lt;/P&gt;

&lt;P&gt;Group           Status&lt;BR /&gt;
   A            In Progress&lt;BR /&gt;
   B            Completed&lt;BR /&gt;
   C            Not Started&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 03:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338340#M160813</guid>
      <dc:creator>arielpconsolaci</dc:creator>
      <dc:date>2017-06-14T03:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Display Color Based On Status (String Value)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338341#M160814</link>
      <description>&lt;P&gt;@arielpconsolacion&lt;/P&gt;

&lt;P&gt;In this case we have to use some tric in search and pie logic.&lt;BR /&gt;
Below is search make crack pie chart and pass numeric value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;&amp;lt;YOUR SEARCH&amp;gt;&amp;gt;| table Group Status | eval count=1 | append [| stats count | eval Group="C",Status="Not Started"] | append [| stats count | eval Group="A",Status="In Progress" | append [| stats count | eval Group="B",Status="Completed" ]] | sort Status | table Group count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this search I'm sorting status and arranging resuls. If any status missing in results, then sorting won't work so I have appended messing status with 0 count. &lt;/P&gt;

&lt;P&gt;In pie chart color option I have added below option only.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.seriesColors"&amp;gt;[0x008000,0xffff00,0xff0000]&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try it?&lt;/P&gt;

&lt;P&gt;I hope it works for you.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Kamlesh&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338341#M160814</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-06-14T13:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pie Chart Display Color Based On Status (String Value)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338342#M160815</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;in my case label is dinamically because contain also the %, for example:&lt;/P&gt;

&lt;P&gt;30,1% Completed&lt;BR /&gt;
23% InProgress&lt;/P&gt;

&lt;P&gt;But these values are dinamic so change everytime, how we can manage this scenario?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 17:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pie-Chart-Display-Color-Based-On-Status-String-Value/m-p/338342#M160815</guid>
      <dc:creator>aniello_cerrato</dc:creator>
      <dc:date>2019-03-18T17:11:37Z</dc:date>
    </item>
  </channel>
</rss>

