Splunk Search

Change color of charts (JavaScript)

newatsplunk
Explorer

Hi,

Is there a way to change the color of a series being returned in the search results? For example, I run a search with an eval where I'm grouping the results into 'red', 'yellow', and 'green' and I'd like the resulting pie chart to correspond with that.

Edit: Sorry about that, using version 6.0.1 and the javascript sdk for splunk, basically integrating the splunk chart into an external website

0 Karma

newatsplunk
Explorer

Found the solution.

I was working off of the UI demos examples:

 // Update the chart
function(results, job, callback)
{
    splunkjs.UI.ready(chartToken, function(){
        chart.setData(results, {
            "chart.stackMode": "stacked",
            "seriesColors": "[FFFFFF, FFFFFF, FFFFFF]" //added this line for color configuration
        })
    });
}
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Splunk version? Splunk dashboards or SDK?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...