score:1

Accepted answer

This is possible using the render function API Link

    chart: {
        events: {
            render: function() {
                try {
                    this.series[0].data.forEach(point => {
                        if (point.Entry_type === "B") {
                            point.dataLabel.attr({y: point.plotLow});
                        } else if (point.Entry_type === "S") {
                            point.dataLabel.attr({y: point.plotHigh - 20});
                        }
                    });
                } catch (error) {
                    // continue
                }
            }
        }
    },
...
    series: [{
        dataLabels: {
            enabled: true,
            backgroundColor: "#fdfc59",
            shape: "circle",
            formatter: function () {
                return this.point.Entry_type;
            }
...

Edited Fiddle

Edit 3 full example

Full Codepen


Related Articles