Dashboards & Visualizations

how to give similar color code to both pie chart and trending chart ??

umsundar2015
Path Finder

I have a pie chart with 2 colors in pie chart like
Green is for reporting and red is for non-reporting .

I have a trending chart with same condition with green and red colors.
Please provide a solution to get same color code for both .

Need a quick action here friends..

Tags (1)
0 Karma
1 Solution

niketn
Legend

Use charting.fieldColors with hex color code to set the colors of two field values Green and Red. You should also define same colors in charting.seriesColors which uses one of the defined colors first before applying dynamic colors to the series in chart (provided number of series in chart are more than no of seriesColors defined). You can apply these to all types of charts.

With pie chart you have to ensure that both Green and Red fields are always present (i.e. they should be zero and not null). Otherwise the chart will pick dynamic colors instead of fieldColors defined.

Refer to Chart Configuration Splunk documentation on the above two fields: http://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

Use charting.fieldColors with hex color code to set the colors of two field values Green and Red. You should also define same colors in charting.seriesColors which uses one of the defined colors first before applying dynamic colors to the series in chart (provided number of series in chart are more than no of seriesColors defined). You can apply these to all types of charts.

With pie chart you have to ensure that both Green and Red fields are always present (i.e. they should be zero and not null). Otherwise the chart will pick dynamic colors instead of fieldColors defined.

Refer to Chart Configuration Splunk documentation on the above two fields: http://docs.splunk.com/Documentation/Splunk/latest/Viz/ChartConfigurationReference

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

umsundar2015
Path Finder

when i used the legend labels are duplicating twice ...

its show like reporting,not reporting,reporting% again not reporting %.

I need only reporting and not reporting with %

Please suggesst

0 Karma

niketn
Legend

While this is separate than the original issue posted. I think you are looking for
charting.chart.showLabels and not legends. Please check and confirm.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

umsundar2015
Path Finder

Hi,

my requirement is like both the pie chart and trending chart(timechart ) should have same colors .I have green and red in pie chart for reporting and not reporting . but getting blue and red for reporting and not reporting.

Please suggest a way..

0 Karma

niketn
Legend

Can you share the chart options code for both Line Chart and Pie Chart?

Also try changing from Red Green to some other colors like brown purple for both charting.fieldColors and charting.seriesColors for both the charts.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

niketn
Legend

Can you tell whether the Pie chart loads with first set of colors and then changes or not?

Refer to charting.legend.masterLegend property so that it disables legend color synchronization with other dashabord panels. That way pie chart colors might not get overridden from those defined in charting.fieldColors and charting.seriesColors.

Code snippet of all chart options would be useful to assist.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
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 ...