Dashboards & Visualizations

How to get two pie charts in one panel?

Baldeep
Loves-to-Learn Lots

Hi,

I need some help.

I've two panels side by side, how to get them both in one panel.

Baldeep_0-1597953566468.png

Chart Model

| transaction host startswith="\[Changer\_Montrols\_CR]" endswith="PROFILE=HKEY_LOCAL_MACHINE*******Montrols_CR"
| dedup host
| rex "\[(?<DeviceType>\w+)"
| chart count over FIRMWARE

Chart Firmware

| transaction host startswith="\[Changer\_Montrols\_CR]" endswith="PROFILE=HKEY_LOCAL_MACHINE*******Montrols_CR"
| dedup host
| rex "\[(?<DeviceType>\w+)"
| chart count over FIRMWARE


I've tried appendcols it doesn't get me anywhere.

Labels (2)
Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If this is in a dashboard then you should be able to combine the charts into a single panel by editing the source to look like this.

<row>
  <panel>
    <chart>
      code for pie chart 1
    </chart>
    <chart>
      code for pie chart 2
    </chart>
  </panel>
</row>
---
If this reply helps you, Karma would be appreciated.
0 Karma

Baldeep
Loves-to-Learn Lots

Thanks @richgalloway!

Yes, they both are part of the same dashboard. I think, i've mixed it up by creating a test dashboard. Can you please review this for me?

<dashboard>

  <label>Test_Dash_Improvements</label>

  <row>

    <panel>

      <title>Test_CR_Panels</title>

      <chart>

        <search>

          <query>index = prod

sourcetype = time

| transaction host startswith="\[Changer\_Montrols\_CR]" endswith="PROFILE=HKEY_LOCAL_MACHINE*******Montrols_CR"

| dedup host

| rex "\[(?&lt;DeviceType&gt;\w+)"

| chart count over MAIN_FIRMWARE</query>

          <earliest>-7d@h</earliest>

          <latest>now</latest>

          <sampleRatio>1</sampleRatio>

        </search>

        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>

        <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>

        <option name="charting.axisTitleX.visibility">visible</option>

        <option name="charting.axisTitleY.visibility">visible</option>

        <option name="charting.axisTitleY2.visibility">visible</option>

        <option name="charting.axisX.abbreviation">none</option>

        <option name="charting.axisX.scale">linear</option>

        <option name="charting.axisY.abbreviation">none</option>

        <option name="charting.axisY.scale">linear</option>

        <option name="charting.axisY2.abbreviation">none</option>

        <option name="charting.axisY2.enabled">0</option>

        <option name="charting.axisY2.scale">inherit</option>

        <option name="charting.chart">pie</option>

        <option name="charting.chart.bubbleMaximumSize">50</option>

        <option name="charting.chart.bubbleMinimumSize">10</option>

        <option name="charting.chart.bubbleSizeBy">area</option>

        <option name="charting.chart.nullValueMode">gaps</option>

        <option name="charting.chart.showDataLabels">none</option>

        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>

        <option name="charting.chart.stackMode">default</option>

        <option name="charting.chart.style">shiny</option>

        <option name="charting.drilldown">none</option>

        <option name="charting.layout.splitSeries">0</option>

        <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>

        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>

        <option name="charting.legend.mode">standard</option>

        <option name="charting.legend.placement">right</option>

        <option name="charting.lineWidth">2</option>

        <option name="trellis.enabled">0</option>

        <option name="trellis.scales.shared">1</option>

        <option name="trellis.size">medium</option>

      </chart>

    </panel>

  </row>

  <row>

    <panel>

      <title>Firmware</title>

      <chart>

        <search>

          <query>index = prod

sourcetype = time

| transaction host startswith="\[Changer\_MoneyControls\_BCR]" endswith="PROFILE=HKEY_LOCAL_MACHINE*******Montrols_CR"

| dedup host

| rex "\[(?&lt;DeviceType&gt;\w+)"

| chart count over ACCEPT_MODEL</query>

          <earliest>-7d@h</earliest>

          <latest>now</latest>

          <sampleRatio>1</sampleRatio>

        </search>

        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>

        <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>

        <option name="charting.axisTitleX.visibility">visible</option>

        <option name="charting.axisTitleY.visibility">visible</option>

        <option name="charting.axisTitleY2.visibility">visible</option>

        <option name="charting.axisX.abbreviation">none</option>

        <option name="charting.axisX.scale">linear</option>

        <option name="charting.axisY.abbreviation">none</option>

        <option name="charting.axisY.scale">linear</option>

        <option name="charting.axisY2.abbreviation">none</option>

        <option name="charting.axisY2.enabled">0</option>

        <option name="charting.axisY2.scale">inherit</option>

        <option name="charting.chart">pie</option>

        <option name="charting.chart.bubbleMaximumSize">50</option>

        <option name="charting.chart.bubbleMinimumSize">10</option>

        <option name="charting.chart.bubbleSizeBy">area</option>

        <option name="charting.chart.nullValueMode">gaps</option>

        <option name="charting.chart.showDataLabels">none</option>

        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>

        <option name="charting.chart.stackMode">default</option>

        <option name="charting.chart.style">shiny</option>

        <option name="charting.drilldown">none</option>

        <option name="charting.layout.splitSeries">0</option>

        <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>

        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>

        <option name="charting.legend.mode">standard</option>

        <option name="charting.legend.placement">right</option>

        <option name="charting.lineWidth">2</option>

        <option name="trellis.enabled">0</option>

        <option name="trellis.scales.shared">1</option>

        <option name="trellis.size">medium</option>

      </chart>

    </panel>

  </row>

</dashboard>

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Delete these lines and it should work.

    </panel>
  </row>
  <row>
    <panel>
      <title>Firmware</title>
---
If this reply helps you, Karma would be appreciated.
0 Karma

Baldeep
Loves-to-Learn Lots

Thanks @richgalloway,

It looks like one panel as we've removed title 

 

<title>Firmware</title>

 

the second panel doesn't have a title but still in different panels, as you see the progress bar 😞

I want to merge them in one panel, so that it reduces the load on the page and loads swiftly, when launched or refreshed.

Baldeep_2-1598026394475.png

0 Karma

richgalloway
SplunkTrust
SplunkTrust
The second chart doesn't have a title because panels can have only one title and that's above the first chart.
I'm not convinced putting two searches/charts in a single panel has any effect on performance. To improve performance, consider using a base search and post-processing.
For a more flexible layout, check out the Splunk Dashboards App (beta) at https://splunkbase.splunk.com/app/4710/
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Optimize Cloud Monitoring

  TECH TALKS Optimize Cloud Monitoring Tuesday, August 13, 2024  |  11:00AM–12:00PM PST   Register to ...

What's New in Splunk Cloud Platform 9.2.2403?

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

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...