Dashboards & Visualizations

Modifying pie chart colors in dashboard studio?

satish
Explorer

Hi Experts,

Im unable to find modify the pie chart colors using dashboard studio.  I have tried to add field colors under options in dashboard studio. Unable to edit for specific visualisation in the source code field.  

Have a field called "supp_type", I was looking for pie chart to be green for value "current", Amber for "previous" and red for "old". 

When I include the charting.fieldcolors it doesn't accept  or doesn't allow to save the panel code.

Can you help me in adding that custom colors into dashboard studio.  

Query:
-------------
index=lab host=hmclab 
| spath path=hmc_info{} output=LIST
| mvexpand LIST
| spath input=LIST
| where category == "hmc"
| search hmc_version=V* OR hmc_version=unknown
| dedup hmc_name
| eval supp_type=case(match(hmc_version,"^V10.*|^V9R2.*"), "current", match(hmc_version, "^V9R1.*"), "previous", match(hmc_version, "^V8.*|^V7.*"), "old")
| chart count by supp_type useother=false

Source Code from dashboard studio: 
------------------------------------------------------
{
"type": "viz.pie",
"dataSources": {
"primary": "ds_RxEsq1cK"
},
"title": "HMC Versions",
"options": {
"chart.showPercent": true,
"backgroundColor": "transparent",
"charting.fieldColors": {"current":0x008000, "previous":0xffff00, "old":0xff0000}
},
"context": {},
"showProgressBar": false,
"showLastUpdated": false
}
Labels (3)
Tags (2)
0 Karma
1 Solution

satish
Explorer

I have tried to add the below the option under the panel. It seems to have worked. 

 

"seriesColors": ["#61A84F","#FFBF00", "#FF0000"]

View solution in original post

0 Karma

satish
Explorer

I have tried to add the below the option under the panel. It seems to have worked. 

 

"seriesColors": ["#61A84F","#FFBF00", "#FF0000"]
0 Karma

archana1
New Member
Hi @satish ,
Even after providing the series colors as mentioned by you in the previous comment, i couldnot set/change the color in piechart . Could you please help on how to change the color of piechart. I want to provide 2 colors red for failed slice and green for pass slice.
 
        "viz_HoWEnZsV": {
            "type": "splunk.pie",
            "title": "Result",
            "dataSources": {
                "primary": "ds_PlnRHbXf"
            }
        },
 "ds_PlnRHbXf": {
            "type": "ds.search",
            "options": {
                "query": " index = _internal | chart avg(bytes) over source",
            },
            "seriesColors": ["#61A84F","#FFBF00", "#FF0000"],
            "name": "Search_1"
 
Thanks,
 
0 Karma

archana1
New Member

Hi @satish ,

 

I also tried giving "charting.fieldColors"as below . Still there is no change in the pie chart. Please guide

{
    "type": "splunk.pie",
    "title": " Result",
    "dataSources": {
        "primary": "ds_PlnRHbXf"
    },
    "options": {
        "charting.fieldColors": {
            "failed": "#FF0000",
            "passed": "#008000"
        }
    },
    "context": {},
    "showProgressBar": false,
    "showLastUpdated": false
0 Karma

adent
Explorer

The answer is in the planning dept basement behind a locked door with the sign "beware of the leper".

seriesColorsByFieldobjectn/aSpecify the colors used for specific pie slice labels. For example: {"April": "#008000", "May": "#FFA500


Much of the pie documentation does not have the current option. I found it once on the splunk documentation for dashboard studio pie chart but could not find it again. I then searched for "splunk pie chart options dashboard studio code" and found the following url: https://docs.splunk.com/Documentation/Splunk/9.1.1/DashStudio/objOptRef

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...