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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...