How to customize color in bar charts?

Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 4 ✭✭✭

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

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 319 Dataiker
    edited July 2024

    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 

  • Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 4 ✭✭✭

    Thanks very much Sarina.

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

  • Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 319 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

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.