Dashboards & Visualizations

Dashboard studio Table Colors

Federico92
Path Finder

Hi all,

I want to create a table in which row colours change based on row value. In attachment source code

{
    "type": "splunk.table",
    "options": {
        "fontWeight": "bold",
        "headerVisibility": "none",
        "rowColors": {
            "mode": "categorical",
            "categoricalColors": {
                "ce": "#4E79A7",
                "edit": "#F28E2B",
                "service_overview": "#E15759",
                "e2e_ritm": "#76B7B2",
                "e2e_task": "#59A14F",
                "monitor": "#EDC948",
                "sla__time_to_first_response": "#B07AA1",
                "sla__time_to_resolution": "#FF9DA7"
            },
            "field": "file"
        },
        "columnFormat": {
            "placeholder": {
                "data": "> table | seriesByName(\"placeholder\") | formatByType(placeholderColumnFormatEditorConfig)"
            },
            "file": {
                "data": "> table | seriesByName(\"file\") | formatByType(fileColumnFormatEditorConfig)"
            }
        }
    },
    "dataSources": {
        "primary": "ds_b4QqXqtO"
    },
    "title": "Legend",
    "context": {
        "placeholderColumnFormatEditorConfig": {
            "string": {
                "unitPosition": "after"
            }
        },
        "fileColumnFormatEditorConfig": {
            "string": {
                "unitPosition": "after"
            }
        }
    },
    "containerOptions": {},
    "showProgressBar": false,
    "showLastUpdated": false
}

The code seems to be correct but it doesn't work. I want to know what is wrong and especially if the function i want is supported. 

Thanks in advance
Labels (1)
0 Karma

livehybrid
SplunkTrust
SplunkTrust

following my last post, I think this should hopefully work for you.

{
    "type": "splunk.table",
    "dataSources": {
        "primary": "ds_b4QqXqtO"
    },
    "options": {
        "tableFormat": {
            "rowBackgroundColors": "> table | seriesByName(\"file\") | matchValue(tableRowBackgroundColor)"
        }
    },
    "context": {
        "tableRowBackgroundColor": [
            {
                "match": "ce",
                "value": "#4E79A7"
            },
            {
                "match": "edit",
                "value": "#F28E2B"
            },
            {
                "match": "service_overview",
                "value": "#E15759"
            },
            {
                "match": "e2e_ritm",
                "value": "#76B7B2"
            },
            {
                "match": "e2e_task",
                "value": "#59A14F"
            },
            {
                "match": "monitor",
                "value": "#EDC948"
            },
            {
                "match": "sla__time_to_first_response",
                "value": "#B07AA1"
            },
            {
                "match": "sla__time_to_resolution",
                "value": "#FF9DA7"
            },
            {
                "match": "*",
                "value": "#FFFFFF"
            }
        ]
    },
    "containerOptions": {},
    "showProgressBar": false,
    "showLastUpdated": false
}

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Federico92 

Here is an example we should hopefully help:

livehybrid_0-1751668540871.pnglivehybrid_0-1751668540871.png

{
    "type": "splunk.table",
    "dataSources": {
        "primary": "ds_aOEeGNWG"
    },
    "options": {
        "tableFormat": {
            "rowBackgroundColors": "> table | seriesByName(\"host\") | matchValue(tableRowBackgroundColor)"
        }
    },
    "context": {
        "tableRowBackgroundColor": [
            {
                "match": "macdev",
                "value": "#FF0000"
            },
            {
                "match": "cultivar",
                "value": "#00FF00"
            },
            {
                "match": "*",
                "value": "#FFFFFF"
            }
        ]
    },
    "containerOptions": {},
    "showProgressBar": false,
    "showLastUpdated": false
}

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

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!

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...

Defend at Machine Speed: Your Guide to Security Sessions at .conf26

Splunk .conf26   With threats moving at machine speed and attack surfaces expanding across hybrid ...

Where Innovation Takes Flight: The Splunk4Aviation Flight Sim Lands at .conf26

If you hear someone at .conf26 shouting "gear down, GEAR DOWN" across the show floor, you have found us.  The ...