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!

Event Series: Splunk Observability Metrics Cost Optimization

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...