Changing color of specific chartjs point

前端 未结 1 1675
忘掉有多难
忘掉有多难 2021-01-18 18:35

Is it possible to change specific point color with dx chartjs? I know how to change point colors for the whole series, but I can\'t find anything on changing specific points

1条回答
  •  广开言路
    2021-01-18 19:03

    You can use

    customizePoint 
    

    callback.

    $("#container").dxChart({
        dataSource: dataSource,
        ...
        customizePoint: function() {
            if(this.value > highAverage) {
                return { color: '#ff4500', hoverStyle: { color: '#ff4500' } };
            } else if(this.value < lowAverage) {
                return { color: '#00ced1', hoverStyle: { color: '#00ced1' } };
            }
        },
        ....
    }
    

    });

    You can find find documentation and demo

    0 讨论(0)
提交回复
热议问题