Echarts scatter chart how scatter renders the color of each dot according to the data requested by the background

The data returned by

is shown below. How do you define the color of each point based on the status value of each data?
such as status=0 red

status=1   
data=[{
    time:"2018-06-21",
    status:0,
    value:77
},
{
    time:"2018-06-21",
    status:1,
    value:77
},{
    time:"2018-06-21",
    status:2,
    value:77
}]
Mar.29,2021

 series: [{
        symbolSize: 20,
        data: [{
            time:"2018-06-21",
            status:0,
            value:76
        },
        {
            time:"2018-06-21",
            status:1,
            value:47
        },{
            time:"2018-06-21",
            status:2,
            value:17
        }],
        type: 'scatter',
        itemStyle:{
            normal:{
                color:params=>{
                    switch(params.data.status){
                        case 0:
                            return 'red';
                        case 1:
                            return 'green';
                        case 2:
                            return 'yellow';
                    }
                }
            }
        }
    }]

setting itemStyle, generally involves the style of graphics. This field is used to find the color of color. The color of most graphics can be customized, that is, the callback function

is provided.
Menu