<?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: How to round the decimal percentage in a piechart with XML? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357408#M23272</link>
    <description>&lt;P&gt;As of now, there is no property to add precision in XML for a pie chart.&lt;BR /&gt;
you can look for doc here &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.0/Viz/ChartConfigurationReference#Pie_charts"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.0/Viz/ChartConfigurationReference#Pie_charts&lt;/A&gt;&lt;BR /&gt;
One way to do this using query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index | stats query | eventstats sum(count) as total_Count | eval total_Count=round((count/total_Count)*100,2) | eval field=field + " , " + total_Count + "%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here the name of the &lt;STRONG&gt;field&lt;/STRONG&gt; will be the name which is given after by clause in stats command.&lt;/P&gt;

&lt;P&gt;Let me know if it works.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Nov 2017 05:52:48 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2017-11-09T05:52:48Z</dc:date>
    <item>
      <title>How to round the decimal percentage in a piechart with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357406#M23270</link>
      <description>&lt;P&gt;I had a pie-chart and I have added the following line on the source to display the percentage on the piechart But the percentage is displaying as xx.xyz. Now, how can I round it to single digit likle xx.y&lt;/P&gt;

&lt;P&gt;option name="charting.chart.showPercent" as true&lt;/P&gt;

&lt;P&gt;Is there any way to round the percentage from the xml?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 20:28:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357406#M23270</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-11-08T20:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the decimal percentage in a piechart with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357407#M23271</link>
      <description>&lt;P&gt;try the number formatting options:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Viz/TableFormatsXML#Number_format_rules"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Viz/TableFormatsXML#Number_format_rules&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;format type="number" field="count"&amp;gt;
        &amp;lt;option name="precision"&amp;gt;1&amp;lt;/option&amp;gt;
&amp;lt;/format&amp;gt;   
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Nov 2017 21:15:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357407#M23271</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-11-08T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the decimal percentage in a piechart with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357408#M23272</link>
      <description>&lt;P&gt;As of now, there is no property to add precision in XML for a pie chart.&lt;BR /&gt;
you can look for doc here &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.0/Viz/ChartConfigurationReference#Pie_charts"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.0/Viz/ChartConfigurationReference#Pie_charts&lt;/A&gt;&lt;BR /&gt;
One way to do this using query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index | stats query | eventstats sum(count) as total_Count | eval total_Count=round((count/total_Count)*100,2) | eval field=field + " , " + total_Count + "%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here the name of the &lt;STRONG&gt;field&lt;/STRONG&gt; will be the name which is given after by clause in stats command.&lt;/P&gt;

&lt;P&gt;Let me know if it works.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 05:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357408#M23272</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-11-09T05:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the decimal percentage in a piechart with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357409#M23273</link>
      <description>&lt;P&gt;Thanks for the response @mayurr98. It worked great.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 19:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357409#M23273</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-11-09T19:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to round the decimal percentage in a piechart with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357410#M23274</link>
      <description>&lt;P&gt;Thanks for the response @cmerriman. &lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 19:32:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-round-the-decimal-percentage-in-a-piechart-with-XML/m-p/357410#M23274</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-11-09T19:32:41Z</dc:date>
    </item>
  </channel>
</rss>

