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 Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...