Skip to content

Pie charts data label positioning doesn't ignore hidden slices #2510

@dejongch

Description

@dejongch

If you have a Pie chart with hidden slices, the positioning of the data labels is very messy because it is positioning them around the hidden slices data labels.

http://jsfiddle.net/z9NN9/

I found that this issue is caused here:

// arrange points for detection collision
each(data, function (point) {
    if (point.dataLabel) { // it may have been cancelled in the base method (#407)
        halves[point.half].push(point);
    }
});

if this is replaces with:

// arrange points for detection collision
each(data, function (point) {
    if (point.dataLabel && point.visible) { // it may have been cancelled in the base method (#407)
        halves[point.half].push(point);
    }
});

the issue no longer occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions