All Apps and Add-ons

Charting types in JS chart

ncbshiva
Communicator

This is my code,i want the pie chart to be displayed first and then the table to be displayed below.
I am getting first table and then the pie chart.

<module name="SimpleResultsHeader">
  <param name="entityName">results</param>
  <param name="headerFormat">Corresponding Revenue Loss(in CEDI)</param>
</module> <!-- SimpleResultsHeader -->

<module name="HiddenChartFormatter">
  <param name="charting.chart">pie</param>
  <param name="charting.legend.placement">none</param>
  <module name="SimpleResultsTable">
    <param name="entityName">results</param>
  </module>

  <module name="JobProgressIndicator"/>

  <!-- The JSChart containing drilldowns -->
  <module name="JSChart">
    <param name="width">100%</param>
    <param name="height">300px</param>
  </module>
</module>
1 Solution

sideview
SplunkTrust
SplunkTrust

Your view will have layoutPanel attributes on some of the modules. When a module doesn't have one of these, it will inherit whatever value is set upstream on a higher level module in the xml hierarchy. So all of these modules are going into the same layoutPanel, and when that happens they simply come out in the same order they're in in the XML file. Therefore you just reorder the modules in the XML.

I have omitted the SimpleResultsHeader cause it wasn't a part of the problem, but you'll see that you now have JobProgressIndicator, then the chart, then the table. And HiddenChartFormatter is of course hidden.

<module name="JobProgressIndicator"/>
<module name="HiddenChartFormatter">
  <param name="charting.chart">pie</param>
  <param name="charting.legend.placement">none</param>
  <module name="JSChart">
    <param name="width">100%</param>
    <param name="height">300px</param>
  </module>
  <module name="SimpleResultsTable">
    <param name="entityName">results</param>
  </module>
</module>

If you want a good primer for how the Advanced XML works, download a recent copy of Sideview Utils ( http://sideviewapps.com/apps/sideview-utils ) and carefully read the page at "Key Techniques > Overview of the Advanced XML"

View solution in original post

sideview
SplunkTrust
SplunkTrust

Your view will have layoutPanel attributes on some of the modules. When a module doesn't have one of these, it will inherit whatever value is set upstream on a higher level module in the xml hierarchy. So all of these modules are going into the same layoutPanel, and when that happens they simply come out in the same order they're in in the XML file. Therefore you just reorder the modules in the XML.

I have omitted the SimpleResultsHeader cause it wasn't a part of the problem, but you'll see that you now have JobProgressIndicator, then the chart, then the table. And HiddenChartFormatter is of course hidden.

<module name="JobProgressIndicator"/>
<module name="HiddenChartFormatter">
  <param name="charting.chart">pie</param>
  <param name="charting.legend.placement">none</param>
  <module name="JSChart">
    <param name="width">100%</param>
    <param name="height">300px</param>
  </module>
  <module name="SimpleResultsTable">
    <param name="entityName">results</param>
  </module>
</module>

If you want a good primer for how the Advanced XML works, download a recent copy of Sideview Utils ( http://sideviewapps.com/apps/sideview-utils ) and carefully read the page at "Key Techniques > Overview of the Advanced XML"

Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...