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
Answers
-
Sarina Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 317 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: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 Qi Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 3 ✭✭
Thanks very much Sarina.
It seems that 'Custom aggregations' is a new feature for DSS12, just double checked my edition is DSS11.