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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...