<?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: generating a graphic in dashboard xml code in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685233#M56112</link>
    <description>&lt;P&gt;And if you then want to make that a bar chart, replace the fields - c at the end with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields myFIELD
| mvexpand myFIELD
| eval count=tonumber(myFIELD)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_0-1713925545827.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30538i2B3047A28ACDC5B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_0-1713925545827.png" alt="bowesmana_0-1713925545827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 02:25:54 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-04-24T02:25:54Z</dc:date>
    <item>
      <title>generating a graphic in dashboard xml code</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685187#M56107</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to do a chart overlay using a normal distribution graphic based upon the mean and standard deviation acquired from the fieldsummary command. I can generate the values in perl (below) for a bell curve. Can you tell me how to do this in the Splunk Dashboard xml? Thanks.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#!/usr/bin/perl

# min, max, count, mean, stdev all come from the fieldsummary command.

$min = 0.442;
$max = 0.507;
$mean = 0.4835625;
$stdev = 0.014440074377630105;
$count = 128;
$pi = 3.141592653589793238462;

# The numbers above do not indicate a Gaussian distribution.
# Create an artificial normal distribution (for the plot overlay)
# based on 6-sigma.

$min = sprintf("%.3f", $mean - 3.0*$stdev);       # use sprintf as a rounding function
$max = sprintf("%.3f", $mean + 3.0*$stdev);

$interval = ($max - $min)/($count - 1);
$x = $min;
for ($i=0; $i&amp;lt;$count; $i++)
  {
   $y = (1.0/($stdev*sqrt(2.0*$pi))) * exp(-0.5*((($x-$mean)/$stdev)**2));
   $myFIELD[$i] = sprintf(%.3f",$y);
   printf("myFIELD[$i]\n");
   $x = $x + $interval;
  }

exit;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Apr 2024 20:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685187#M56107</guid>
      <dc:creator>riley_lewis</dc:creator>
      <dc:date>2024-04-23T20:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: generating a graphic in dashboard xml code</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685231#M56111</link>
      <description>&lt;P&gt;Quite literally&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| fields - _time
| eval min = 0.442
| eval max = 0.507
| eval mean = 0.4835625
| eval stdev = 0.014440074377630105
| eval count = 128
| eval pi = 3.141592653589793238462
| eval min = printf("%.3f", mean - 3.0 *stdev)```;       # use sprintf as a rounding function```
| eval max = printf("%.3f", mean + 3.0 * stdev)
| eval x=min
| eval interval = (max - min)/(count - 1)
| eval c=mvrange(0, count, 1)
| foreach c mode=multivalue [ | eval y= (1.0/(stdev * sqrt(2.0 * pi))) * exp(-0.5*(pow(((x - mean) / stdev), 2))), myFIELD=mvappend(myFIELD, printf("%.3d", y)), x = x + interval ]
| fields - c&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 02:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685231#M56111</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-24T02:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: generating a graphic in dashboard xml code</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685233#M56112</link>
      <description>&lt;P&gt;And if you then want to make that a bar chart, replace the fields - c at the end with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields myFIELD
| mvexpand myFIELD
| eval count=tonumber(myFIELD)&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bowesmana_0-1713925545827.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30538i2B3047A28ACDC5B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bowesmana_0-1713925545827.png" alt="bowesmana_0-1713925545827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 02:25:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/generating-a-graphic-in-dashboard-xml-code/m-p/685233#M56112</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-24T02:25:54Z</dc:date>
    </item>
  </channel>
</rss>

