Dashboards & Visualizations

Table cell font colour (color) changing depending on cell background colour

mscomms
Path Finder

Hi All,

I have a stats table which I have set up to use as an alarm display where each line is coloured to donate the severity.

This is working fine except that when the table row colour is red or blue the text in the cells is white which my users don't like they want the text to stay black for all background colours.

This seems to be a default behaviour, I have looked round the documentation and asked my friend google but cant fins a way to suppress it.

Can anyone point me towards a solution.

Cheers Mike

Labels (1)
0 Karma

mscomms
Path Finder

I think I have foungd it you need the !important after the color: black

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Yes, that's what I showed as I thought you may have forgotten it 😀

0 Karma

mscomms
Path Finder

On my live dashboard the css is in the simplexml 

0 Karma

mscomms
Path Finder

This is an example dashboard showing the issue

<dashboard>
  <label>Text Colour</label>
  <row>
    <panel>
      <table>
        <title>Colour vs text</title>
        <search>
          <query>| makeresults | eval whiteBg="White Background", redBg="Red Background" | table whiteBg redBg</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <format type="color" field="redBg">
          <colorPalette type="map">{"Red Background":#FF0000}</colorPalette>
        </format>
      </table>
    </panel>
  </row>
</dashboard>

 

You can see the whiteBG has black text and the redBG has white text, I have raised a case on this as well

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
<dashboard>
  <label>Text Colour</label>
  <row>
    <panel>
      <html>
        <style>
          #table td {
            color: black !important;
          }
        </style>
      </html>
      <table id="table">
        <title>Colour vs text</title>
        <search>
          <query>| makeresults | eval whiteBg="White Background", redBg="Red Background" | table whiteBg redBg</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <format type="color" field="redBg">
          <colorPalette type="map">{"Red Background":#FF0000}</colorPalette>
        </format>
      </table>
    </panel>
  </row>
</dashboard>

ITWhisperer_0-1623160005105.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Have you tried using CSS to set the colour to black for the table data cells?

0 Karma

mscomms
Path Finder

@ITWhisperer Yes I have tried that, the colour seems to change as the colour saturation increases

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Can you share your SimpleXML for this? Do you have the CSS in the SimpleXML or separately in a .css file?

0 Karma

mscomms
Path Finder

Example of font colour attached 

Image showing change in font colourImage showing change in font colour

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...