Dashboards & Visualizations

How to add color to table rows in Dashboard Studio?

bamartinez
Engager

Hello!

I am looking to add color to a table I have in Dashboard Studio. I notice in the UI there are no coloring options when you select Column Formatting for a string type - the color formats only show for number types. So I tried to replicate the color formatting onto a string type via the source code but am not getting anywhere.

Is there something I am missing? Is this possible to color strings in tables with the current release of dashboard studio?

TIA!

Labels (1)
Tags (2)

RedPooch
Engager

As you see adding to colors to number columns in Dashboard Studio is straightforward via GUI editor for numbered fields.   To add colors to a column based on a value you need to do it in the source .json of the dashboard.

In my example, I created a table with a column name of "Status", which has the values of Success, Warning, Failed or Running.  I wanted to change the color of the cell based on the value.

Here is what I did in the Dashboard source under "Visualizations" (skip down the section "Column Format:) 

    "visualizations": {
        "viz_table_1": {
            "type""splunk.table",
            "options": {
.......(many option fields).....
 
                "columnFormat": {
                    "Status": {
                        "rowBackgroundColors""> table | seriesByName('Status') | matchValue(matchConfig)"
                    },
 
            "dataSources": {
                "primary""ds_search_1"
            },
            "context": {
                "tableRowBackgroundColors": [
                    "#2C3033",
                    "#32373D"
                ],
                "tableRowColor": [
                    "#A870EF"
                ],
                "matchConfig": [
                    {
                        "match""Success",
                        "value""#53A051"
                    },
                    {
                        "match""Warning",
                        "value""#B6C75A"
                    },
                    {
                        "match""Failed",
                        "value""#DC4E41"
                    },
                    {
                        "match""Running",
                        "value""#006D9C"
                    }
                ]
 
 
I'd recommend looking at the Example Hub  under Search>Dashboards>Examples for Dashboard Studio" in the Splunk UI.  Hope it points you down the right path.

nayagan
Engager

It is more helpful but we need to highlight entire row based on the column values success, warning, failed and running. 

In your code only highlight particular cell not entire row. More appreciated if you are providing the json code for the same. 

Tags (1)
0 Karma

Augus123
New Member

Hi,

I am looking to edit my dashboard (Studio) - to color code a column based on certain values (non-numeric)

Same here...I am just looking for the JS code to add it to visualization part of the source code

Field name is "Game Status". The values in this columns and their respective color codes:
"Completed" to be in Blue, "on-line" to be in "Green" and "Not available" to be in "Red"

0 Karma

SteveM-905
Loves-to-Learn

Me too

0 Karma
Get Updates on the Splunk Community!

Don't wait! Accept the Mission Possible: Splunk Adoption Challenge Now and Win ...

Attention everyone! We have exciting news to share! We are recruiting new members for the Mission Possible: ...

Unify Your SecOps with Splunk Mission Control

In today’s post, I'm excited to share some recent Splunk Mission Control innovations. With Splunk Mission ...

Data Preparation Made Easy: SPL2 for Edge Processor

By now, you may have heard the exciting news that Edge Processor, the easy-to-use Splunk data preparation tool ...