Splunk Search
Highlighted

Change color of value text in chart

Communicator

I have a bar chart created in the which I am showing data values above the bars. However, the tallest bar has the text inside of it, and the colors blend too much. In simple XML, can I change the color of the text to darken it?

0 Karma
Highlighted

Re: Change color of value text in chart

Legend

EDITED

Since you want to make changes to column data labels which are highchart-data-labels elements not exposed by charting properties like charting.fontColor you can try one of the following options:

1) Option 1 - charting.backgroundColor
Without CSS make column chart Data Labels prominent by changing chart color to contrast
cyan
Pros - No need to modify through css.
Cons - Panel might look ugly. (White or Black background colors usually suits dashboards)

2) Option 2 - Through CSS

(i) Override the highcharts-data-label text color to the color of your choice using following css custom_highcharts.css.

/* SVG Highcharts Data Labels color overridden to blue*/
g.highcharts-data-labels text {
    fill: blue !important;
}

(ii) Place the CSS under your Splunk App folder -

$SPLUNK_HOME\etc\apps\<yourAppName>\appserver\static

PS:
- If you have not put any static files for your Splunk App you would need to create appserver\static folder yourself
- If you do not have access to manually place the CSS file to specific Splunk folder, you can load the same through Manage App Edit Properties using Upload asset feature.

(iii) Include the CSS file in your dashboard/form

<form stylesheet="custom_highcharts.css">

(iv) Restart Splunk (splunkd) and clear browser cache for the changes to take place.




| eval message="Happy Splunking!!!"


View solution in original post

0 Karma
Highlighted

Re: Change color of value text in chart

Legend

@feickertmd Can you please check and confirm whether the following solution worked for you or not?




| eval message="Happy Splunking!!!"


0 Karma
Highlighted

Re: Change color of value text in chart

Communicator

I am certain that CSS will work, but was looking for other solutions due to admin limitations. Thanks!

0 Karma
Highlighted

Re: Change color of value text in chart

Communicator

If CSS is my only viable option, so be it!

0 Karma
Highlighted

Re: Change color of value text in chart

Communicator

alt text

This is the text I want to change. The options you mention only change the colors of the bars.

0 Karma
Highlighted

Re: Change color of value text in chart

Communicator

Actually did this well before your comment. Changed axis labels and legend labels, but not values

0 Karma
Highlighted

Re: Change color of value text in chart

Communicator

no luck for this!

0 Karma
Highlighted

Re: Change color of value text in chart

Communicator

i want to change the value of the data label can any one helm me on this

0 Karma
Highlighted

Re: Change color of value text in chart

Motivator

Can you please try this option and see if it works out for your version of Splunk:

<!-- Set font color (axis labels, legends) -->
        <option name="charting.fontColor">#FFDDCC</option>

Use the hex code of your choice in it.