如何通过脚本为标记线下方的点更改 Birt 折线图的数据点颜色

How to change data point color of Birt line chart for those points which are below marker line through script

我正在使用 Birt 折线图,我想实现这样的效果 How to format series labels of a BIRT chart by script 我想用红色显示标记线下方的点,就像 link 提到的那样。

修改 markerfillColor。 代码片段:

beforeGeneration: function(options)
{
    var throughTargetPercent = this.getReportVariable("through_target_percent"); 

    for(var i = 0 ; i < options.series.length ; i++){
        var data = options.series[i].data;
        var len = data.length;
        for (var j=0; j < len; j++){
             if(data[j].y < throughTargetPercent) {
                data[j]= {
                    y: data[j].y,
                    marker: {
                        fillColor: "yellow" 
                    }
                }
            }
        } 
    }
},

希望对您有所帮助!