Dashboards & Visualizations

Bubble Chart - X, Y, Bubble size and category name

niyaz006
Path Finder

I have created a bubble chart with X-axis value, Y-axis value and Bubble size. Each row is unique and they have a category name. Now I want to display the category name as the legend for each of the bubble.

Sample Data:
Region|ProductCount|Sales|Profit
North|10|1000|200
South|20|2000|250
East|15|1000|150
West|15|1000|300

X-axis = ProductCount
Y-axis = Sales
Bubble Size = Profit

I got until this. But I am not able to get Region as legend/color. The below code works without 'Region' in the table.

index=foo
| stats sum(ProductCount) as ProductCount, sum(Sales) as Sales, sum(Profit) as Profit by Region
| table Region, ProductCount, Sales, Profit
0 Karma

DavidHourani
Super Champion

Hi @niyaz006,

This is working for me :

| makeresults 
| eval A="North|10|1000|200###
South|20|2000|250###
East|15|1000|150###
West|15|1000|300###" 
| makemv delim="###" A 
| mvexpand A 
| rex field=A "^(?<Region>[^|]+)\|(?<ProductCount>[^|]+)\|(?<Sales>[^|]+)\|(?<Profit>[^|]+)"
| stats sum(ProductCount) as ProductCount, sum(Sales) as Sales, sum(Profit) as Profit by Region
| table Region, Sales, ProductCount, Profit

Could you try it and let me know if it works for you as well ?

Also you could replace stats with chart, still works the same way :

| makeresults 
| eval A="North|10|1000|200###
South|20|2000|250###
East|15|1000|150###
West|15|1000|300###" 
| makemv delim="###" A 
| mvexpand A 
| rex field=A "^(?<Region>[^|]+)\|(?<ProductCount>[^|]+)\|(?<Sales>[^|]+)\|(?<Profit>[^|]+)"
| chart sum(ProductCount) as ProductCount, sum(Sales) as Sales, sum(Profit) as Profit by Region
 | table Region, Sales, ProductCount, Profit

Cheers,
David

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...