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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...