Splunk Search

How do I visualize my sample data in a bubble chart?

ravitejaj
Explorer

I want to show the below data in Bubble chart:

Data1 $1000
Data2 $10000
Data3 $100000
Data4 $1000000

With this, I need 4 bubbles with a bigger bubble for Data4 showing the amount and Data4 inside the bubble, and others with the sizes based on the $ amount accordingly.

0 Karma

gokadroid
Motivator

If the data and values are already cumulative in fields data and value, where data represents Data1, Data2, Data3, Data4 and value represents $1000, $10000, $100000, $1000000 can you try this:

your query to return the data and value as they appear in example
| table data, value 
| eventstats sum(value) as totalcount
| chart max(value) as value, first(totalcount) as totalcount by data
| eval percentage=value*100/totalcount
| table data, value, percentage

Choose the bubblechart from visualization and it should work taking percentage as the size of the bubble.

0 Karma

ravitejaj
Explorer

Can I know the xml code for this view?

0 Karma

gokadroid
Motivator

Based on your data above it seemed you wanted a query which can give you data as such that you can plot the bubble chart. So I gave the query which will tabulate the data in a format on which you can choose "bubble chart" as a visualization option from "Visualzation" tab after running the search query.

If you require the xml code which comes after saving this search query as an xml panel, then here it is:

<panel>
  <chart>
    <title>bubbleChart</title>
    <search>
      <query>your query to return the data and value as they appear in example | table data, value | eventstats sum(value) as totalcount| chart max(value) as value,first(totalcount) as totalcount by data| eval percentage=value*100/totalcount| table data, value, percentage</query>
      <earliest></earliest>
      <latest></latest>
    </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.scale">linear</option>
    <option name="charting.axisY.scale">linear</option>
    <option name="charting.axisY2.enabled">0</option>
    <option name="charting.axisY2.scale">inherit</option>
    <option name="charting.chart">bubble</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">all</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.placement">right</option>
  </chart>
</panel>
0 Karma
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, ...