The bounding box of one pie wedge, computed from what a Slice reports.
A Slice paints through a draw callback rather than through primitives that
feed amCharts' bounds accumulator, so globalBounds() answers a degenerate
box at the wedge's own centre — left === right, top === bottom, and
width()/height() both zero. Verified against amcharts5 5.20.1: measured
after datavalidated, again after a resize, always a point. Every highlight
derived from it collapsed and the overlay drew nothing at all (#774).
The centre it reports is correct, though, and the wedge's extent is in its
settings, so the box is recoverable: walk the wedge's corners — both arc
ends at each radius — and add every cardinal angle the sweep crosses, which
is where the arc, not its endpoints, reaches furthest out. A wedge with no
inner radius includes its centre, which the inner-radius corners supply at
radius zero.
Its box in root-relative CSS px, or null when the sprite reports
no usable centre or radius (an XY chart's sprites, or a pie asked before
its first layout).
The bounding box of one pie wedge, computed from what a
Slicereports.A
Slicepaints through a draw callback rather than through primitives that feed amCharts' bounds accumulator, soglobalBounds()answers a degenerate box at the wedge's own centre —left === right,top === bottom, andwidth()/height()both zero. Verified against amcharts5 5.20.1: measured afterdatavalidated, again after a resize, always a point. Every highlight derived from it collapsed and the overlay drew nothing at all (#774).The centre it reports is correct, though, and the wedge's extent is in its settings, so the box is recoverable: walk the wedge's corners — both arc ends at each radius — and add every cardinal angle the sweep crosses, which is where the arc, not its endpoints, reaches furthest out. A wedge with no inner radius includes its centre, which the inner-radius corners supply at radius zero.