Dashboards & Visualizations

How can I change the color for the entire column graph and not by each value?

johnward4
Communicator

I'm trying to see if there's a way to change the color for the entire column graph and the examples I've seen/tried so far are for specifying a color by value. This is purely for aesthetic reasons, trying to create a consistent theme to my dashboard.

Thanks in advance

0 Karma
1 Solution

493669
Super Champion

I don't think you can override chart colors either using css .
but you can do a trick: use charting.fieldColors give the column name and hex color code which will give a consistent theme to your dashboard.
Try this run anywhere search:

<dashboard>
  <label>ColorColumn Chart</label>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal|stats count by source</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
          <option name="charting.fieldColors">{"count": 0xFF0000}</option>
          <option name="charting.chart">column</option>
          <option name="charting.legend.placement">right</option>
       </chart>
    </panel>
  </row>
</dashboard>

if you want you can change font color and background color as well using <option name="charting.fontColor"> and <option name="charting.backgroundColor">
alt text

View solution in original post

0 Karma

mayurr98
Super Champion

hey I think you should use <option name="charting.seriesColors">[0xFF0000]</option> as in charting.fieldColors you will have to specify all the field name with hex color codes.
So if you have multiple fields then you should use only <option name="charting.seriesColors">[0xFF0000]</option> and this will do for all the fields.

Try this run anywhere XML

<dashboard>
  <label>ColorColumn Chart</label>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal|stats count values(bytes) as s by source</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">column</option>
        <option name="charting.seriesColors">[0xFF0000]</option>
        <option name="charting.legend.placement">right</option>
        <option name="refresh.display">progressbar</option>
      </chart>
    </panel>
  </row>
</dashboard>

let me know if this helps!

0 Karma

493669
Super Champion

I don't think you can override chart colors either using css .
but you can do a trick: use charting.fieldColors give the column name and hex color code which will give a consistent theme to your dashboard.
Try this run anywhere search:

<dashboard>
  <label>ColorColumn Chart</label>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal|stats count by source</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
          <option name="charting.fieldColors">{"count": 0xFF0000}</option>
          <option name="charting.chart">column</option>
          <option name="charting.legend.placement">right</option>
       </chart>
    </panel>
  </row>
</dashboard>

if you want you can change font color and background color as well using <option name="charting.fontColor"> and <option name="charting.backgroundColor">
alt text

0 Karma

johnward4
Communicator

Thank You!!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...