Dashboards & Visualizations

How to control the width of a panel

responsys_cm
Builder

I'm trying to figure out how to modify the width of a panel and I'm not quite sure where to start. I've looked at some of my dashboards in Firebug and I can see what a particular panel is named, so modifying it using CSS should be pretty straightforward. What I don't get though is how to make it such that the modification is only applied on one particular dashboard rather than all panels with that particular name.

I'm not a web developer and have only a rudimentary knowledge of CSS...

Thx.

Craig

Tags (1)
0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

If you have a view called "my_view", there is a classname put on a container in the page that always looks like "splView-my_view". This means you can then use contextual CSS to apply styles only in that page.

However, the dashboard template unfortunately doesn't label the panel divs themselves in a particularly useful way, so your hand can be a little limited.

here's an example where you can change things without much trouble:

Say you had some modules in panel_row1_col1 and panel_row1_col2. By default those panels will then each get 50% width. If you wanted them to be 66% and 33% width respectively, you would add the following:

.splView-my_view .panel_row1_col .layoutCell {
    width:33%
}
.splView-my_view .panel_row1_col .firstCell {
    width:66%;
}

What the first rule is saying is - "in the my_view view, within the first row, make all of the layoutCells be 33% width"

then the second rule is saying "in the my_view view, within the first row, find the first cell in particular and make that one 66% width"

However, because our only toehold here is "firstCell" and "layoutCell", if you are trying to set the width of more complicated scenarios, then you'll have to put jquery statements into application.js rather than putting CSS into application.css, and that's a bit more advanced.

View solution in original post

sideview
SplunkTrust
SplunkTrust

If you have a view called "my_view", there is a classname put on a container in the page that always looks like "splView-my_view". This means you can then use contextual CSS to apply styles only in that page.

However, the dashboard template unfortunately doesn't label the panel divs themselves in a particularly useful way, so your hand can be a little limited.

here's an example where you can change things without much trouble:

Say you had some modules in panel_row1_col1 and panel_row1_col2. By default those panels will then each get 50% width. If you wanted them to be 66% and 33% width respectively, you would add the following:

.splView-my_view .panel_row1_col .layoutCell {
    width:33%
}
.splView-my_view .panel_row1_col .firstCell {
    width:66%;
}

What the first rule is saying is - "in the my_view view, within the first row, make all of the layoutCells be 33% width"

then the second rule is saying "in the my_view view, within the first row, find the first cell in particular and make that one 66% width"

However, because our only toehold here is "firstCell" and "layoutCell", if you are trying to set the width of more complicated scenarios, then you'll have to put jquery statements into application.js rather than putting CSS into application.css, and that's a bit more advanced.

responsys_cm
Builder

Thanks, Nick!

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!

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 ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...