Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

How to customize color in bar charts?

Neville
Level 1
How to customize color in bar charts?

I have a dataset with 5 names and their ages. I want to generate a bar chart with one bar which the length of bar represents the avg age. I want to show the color of bar as red if avg age>=35 and green if avg age<35.

How can I fulfil that?

dataset sample as follows:

name age

John 40

Abby 32

Lewis 55

Morgan 23

Joyce 40

 

0 Kudos
3 Replies
SarinaS
Dataiker

Hi @Neville,

I'm not sure exactly what you want to graph in your chart, and if you are looking for a bar per name. However, I think that you can probably use custom aggregations to accomplish this. 

For example, I created the following two custom aggregations:

if(avg(age) > 35, avg(age), 0)
if(avg(age) <= 35, avg(age), 0)

 
I then plotted both of my custom aggregations on my chart, allowing for two separate colors for each metric:

Screenshot 2024-04-30 at 3.49.29 PM.png

In this example, I also wonder if you want to add a reference line to the chart, to clearly identify your two groups.

If you are looking for a different type of chart, please provide a screenshot of what you are looking for so that we can assist!

Thank you,
Sarina 

Neville
Level 1
Author

Thanks very much Sarina.

It seems that 'Custom aggregations' is a new feature for DSS12, just double checked my edition is DSS11.😥

0 Kudos
SarinaS
Dataiker

Hi @Neville,

We would certainly suggest upgrading to DSS 12 to take advantage of all of the new features in DSS 12! 

Thank you,
Sarina 

0 Kudos