export function getLabelLeaderLineEndingPoint()

in src/label/dataLabelPointPositioner.ts [153:188]


export function getLabelLeaderLineEndingPoint(boundingBox: IRect, position: NewPointLabelPosition, parentShape: LabelParentPoint): number[][] {
    let x = boundingBox.left;
    let y = boundingBox.top;
    switch (position) {
        case NewPointLabelPosition.Above:
            x += (boundingBox.width / 2);
            y += boundingBox.height;
            break;
        case NewPointLabelPosition.Below:
            x += (boundingBox.width / 2);
            break;
        case NewPointLabelPosition.Left:
            x += boundingBox.width;
            y += ((boundingBox.height * 2) / 3);
            break;
        case NewPointLabelPosition.Right:
            y += ((boundingBox.height * 2) / 3);
            break;
        case NewPointLabelPosition.BelowLeft:
            x += boundingBox.width;
            y += (boundingBox.height / 2);
            break;
        case NewPointLabelPosition.BelowRight:
            y += (boundingBox.height / 2);
            break;
        case NewPointLabelPosition.AboveLeft:
            x += boundingBox.width;
            y += boundingBox.height;
            break;
        case NewPointLabelPosition.AboveRight:
            y += boundingBox.height;
            break;
    }

    return [[parentShape.point.x, parentShape.point.y], [x, y]];
}