Dashboards & Visualizations

How to achieve color with negative values and positive values in dashboard studio?

anissabnk
Path Finder

Hello everyone, 

I have a question with dashboard studio, in JSON format.

I made this dashboard and I want a specific color for the "diff" field. 

When diff is <0 : red color

when diff is > 0 : green color 

anissabnk_0-1674227093677.png

My spl request is :

`easyVista` source="incidents_jour"
| dedup "N° d'Incident"
|rename "Statut de l'incident" as statut
|eval STATUT=case( match(statut,"Résolu"),"fermé",
match(statut,"Clôturé"),"fermé",
match(statut,"Annulé"),"fermé",
match(statut,"Archivé"),"fermé",
match(statut,"A prendre en compte"),"ouvert",
match(statut,"Suspendu"),"ouvert",
match(statut,"En cours"),"ouvert",
match(statut,"Escaladé"),"ouvert")
|timechart count by STATUT usenull=f | eval diff=fermé-ouvert

Can you help me please ?

Thanks

 

Labels (1)
0 Karma

fredclown
Communicator

Unfortunately, I don't see anything in the definition for column charts that allows you to dynamically change the color. You can set static colors in the source editor with this syntax ...

"my_chart": {
	"type": "splunk.column",
	"dataSources": {
		"primary": "my_ds"
	},
	"options": {
		"seriesColorsByField": {
			"diff": "#FF0000",
			"fermé": "#00FF00",
			"ouvert": "#0000FF"
		}
	}
}
0 Karma

anissabnk
Path Finder

Yes, that is the probleme. I want that the value change dynamically. 

I didn't find something to do this.

0 Karma

fredclown
Communicator

Yeah, unfortunately without getting into scripting it doesn't look like you can dynamically change the colors via configuration.

0 Karma
Get Updates on the Splunk Community!

Observability Highlights | January 2023 Newsletter

 January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...

Security Highlights | January 2023 Newsletter

January 2023 Splunk Security Essentials (SSE) 3.7.0 ReleaseThe free Splunk Security Essentials (SSE) 3.7.0 app ...

Platform Highlights | January 2023 Newsletter

 January 2023Peace on Earth and Peace of Mind With Business ResilienceAll organizations can start the new year ...