<?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: SplunkJS code check in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480648#M31523</link>
    <description>&lt;P&gt;@ChrisCLewis &lt;/P&gt;

&lt;P&gt;Do you want to create Custom Splunk view in  Splunk? If so then please check below link.&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/webframework-tutorials/SP-CAAAEQ8"&gt;http://dev.splunk.com/view/webframework-tutorials/SP-CAAAEQ8&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2019 10:38:03 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-09-13T10:38:03Z</dc:date>
    <item>
      <title>SplunkJS code check</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480647#M31522</link>
      <description>&lt;P&gt;I am new to JS in general and shiny new to SplunkJS.&lt;/P&gt;

&lt;P&gt;I've been looking for ways to change labels on a chart graph and came across this JS suggestion here ( &lt;A href="https://jsfiddle.net/BlackLabel/nqb7fxd3"&gt;https://jsfiddle.net/BlackLabel/nqb7fxd3&lt;/A&gt; ).&lt;/P&gt;

&lt;P&gt;From what I can see Splunk needs a 'wrapper' to go around the JS to work properly, so my question to the great and wise is the code below going to work?&lt;/P&gt;

&lt;P&gt;require([&lt;BR /&gt;
 "splunkjs/mvc",&lt;BR /&gt;
 "splunkjs/mvc/simplexml/ready!"&lt;BR /&gt;
          ],var labels = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth']&lt;BR /&gt;
Highcharts.chart('container', {&lt;BR /&gt;
  yAxis: {&lt;BR /&gt;
    labels: {&lt;BR /&gt;
      formatter: function() {&lt;BR /&gt;
        return labels[this.pos - 1]&lt;BR /&gt;
      }&lt;BR /&gt;
    }&lt;BR /&gt;
  },&lt;BR /&gt;
  series: [{&lt;BR /&gt;
    data: [3, 2, 4, 5]&lt;BR /&gt;
  }]&lt;BR /&gt;
});&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 09:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480647#M31522</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-09-13T09:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS code check</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480648#M31523</link>
      <description>&lt;P&gt;@ChrisCLewis &lt;/P&gt;

&lt;P&gt;Do you want to create Custom Splunk view in  Splunk? If so then please check below link.&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/webframework-tutorials/SP-CAAAEQ8"&gt;http://dev.splunk.com/view/webframework-tutorials/SP-CAAAEQ8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 10:38:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480648#M31523</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-09-13T10:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS code check</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480649#M31524</link>
      <description>&lt;P&gt;Hi, Thanks for the link, I am working my way through it.&lt;/P&gt;

&lt;P&gt;I'm not going for a whole view, just change labels on graphs from numeric to a string.&lt;BR /&gt;
using |chart sum(X) over Y by Z means you have to have numeric scales on the Y axis but need a description rather than numbers.&lt;BR /&gt;
Using a script appears to be the only way&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 11:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480649#M31524</guid>
      <dc:creator>ChrisCLewis</dc:creator>
      <dc:date>2019-09-13T11:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS code check</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480650#M31525</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;

&lt;P&gt;in general the question is: why would you change your data, when it gets visualized? &lt;BR /&gt;
I would shape the data in the Splunk-search and try to get away with it.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If you really want to the JS-path I would check out this Tutorial:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/AdvancedDev/CustomVizTutorial"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/AdvancedDev/CustomVizTutorial&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It will also tell you how to import JS-modules (like Highcharts used in your fiddle) and in the examples visualization_source.js you can aswell see how data is processed before it gets fed to the visual. So for which ever transformation on the data you need, it could be done in the &lt;EM&gt;formatData&lt;/EM&gt;. In the &lt;EM&gt;updateView&lt;/EM&gt; function, you could then feed the data to a Highcharts.chart().&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 08:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/SplunkJS-code-check/m-p/480650#M31525</guid>
      <dc:creator>RngFox</dc:creator>
      <dc:date>2019-11-07T08:27:00Z</dc:date>
    </item>
  </channel>
</rss>

