Dashboards & Visualizations

Adding different colours to each panel in a dashboard- Splunk Cloud

dkgs
Communicator

Hello,

I wanted to add colours to the dashboard panel. Please find below the dashboard code and screenshot. There are hyperlinks in each panel and I need to add colors to the background of each panel. Any help would be appreciated. Adding the dashboard code also below. @niketn 

dkgs_0-1600685727461.png

<dashboard stylesheet="layout.css" theme="light">

<label>Test-Landing dashboard </label>
<description>Links to all other dashboards</description>
<row>
<panel depends="$alwaysHideHTMLStyle$">

<html>
<style>

body{margin-bottom: 150px;background: #FFDAB9!important;}

.dashboard-body{background-color:#FFDAB9!important; font-weight:bold!important}


</style>
<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/30min_block" style="color:black;" alignment="central">30 MIN BLOCK</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/high_disk_" style="color:black;">High Disk %</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/cpu_utilization_ae6hg218" style="color:black;">CPU Utilization AE6HG218</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/30min_block" style="color:black;">Server - Dashboard</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/sql_agent_not_running_in_Server_servers" style="color:black;">SQL Agent Not Running in Server Servers</a></center>
</p>
</html>
</panel>
</row>
<row>
<panel>
<html>

<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/high_cpu" style="color:black;">High CPU</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/sql_serv_not_running" style="color:black;">SQL Serv Not Running</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/sql_server_cpu_usage" style="color:black;">SQL Server CPU UsageK</a></center>
</p>
</html>
</panel>
<panel>
<html>


<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/job_fail" style="color:black;">JOB FAIL</a></center>
</p>
</html>
</panel>
<panel>
<html>

<p>
<center><a href="https://abc.splunkcloud.com/en-GB/app/project_base-Server/long_tran" style="color:black;">LONG TRAN</a></center>
</p>
</html>
</panel>
</row>
</dashboard>

 

Labels (4)
0 Karma
1 Solution

niketn
Legend

@dkgs , whatever @ITWhisperer said.

Since all panels that you want to apply CSS to are html panels, you would need following CSS selector div#yourPanelID .panel-body.html

Following is a sample CSS (I have grouped 2 panels for same background color, you can change as per your needs).

Screen Shot 2020-09-21 at 6.31.38 PM.png

 

                  div#panel1 .panel-body.html,
                  div#panel6 .panel-body.html{
                    background: #003D5E !important;
                  }
                  div#panel2 .panel-body.html,
                  div#panel7 .panel-body.html{
                    background: #005684 !important;
                  }
                  div#panel3 .panel-body.html,
                  div#panel8 .panel-body.html{
                    background: #006EAA !important;
                  }
                  div#panel4 .panel-body.html,
                  div#panel9 .panel-body.html{
                    background: #00A4FD !important;
                  }
                  div#panel5 .panel-body.html,
                  div#panel10 .panel-body.html{
                    background: #7ED2FF !important;
                  }
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

niketn
Legend

@dkgs , whatever @ITWhisperer said.

Since all panels that you want to apply CSS to are html panels, you would need following CSS selector div#yourPanelID .panel-body.html

Following is a sample CSS (I have grouped 2 panels for same background color, you can change as per your needs).

Screen Shot 2020-09-21 at 6.31.38 PM.png

 

                  div#panel1 .panel-body.html,
                  div#panel6 .panel-body.html{
                    background: #003D5E !important;
                  }
                  div#panel2 .panel-body.html,
                  div#panel7 .panel-body.html{
                    background: #005684 !important;
                  }
                  div#panel3 .panel-body.html,
                  div#panel8 .panel-body.html{
                    background: #006EAA !important;
                  }
                  div#panel4 .panel-body.html,
                  div#panel9 .panel-body.html{
                    background: #00A4FD !important;
                  }
                  div#panel5 .panel-body.html,
                  div#panel10 .panel-body.html{
                    background: #7ED2FF !important;
                  }
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

ITWhisperer
SplunkTrust
SplunkTrust

This sort of thing has been answered many times. Essentially, you give your panels an id and then add a css style associated with that id.

0 Karma
Get Updates on the Splunk Community!

Cultivate Your Career Growth with Fresh Splunk Training

Growth doesn’t just happen—it’s nurtured. Like tending a garden, developing your Splunk skills takes the right ...

Introducing a Smarter Way to Discover Apps on Splunkbase

We’re excited to announce the launch of a foundational enhancement to Splunkbase: App Tiering.  Because we’ve ...

How to Send Splunk Observability Alerts to Webex teams in Minutes

As a Developer Evangelist at Splunk, my team and I are constantly tinkering with technology to explore its ...