MAIDR JavaScript API
    Preparing search index...
    • The bounding box of one wedge, computed from what a Slice reports.

      A pie's Slice is not measured — the percent theme turns its isMeasured off — so globalBounds() answers a degenerate box at the wedge's own centre: left === right, top === bottom, and width()/height() both zero (amcharts5 5.20.1, after datavalidated and after a resize alike). Every highlight derived from it collapsed and the overlay drew nothing at all (#774).

      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. The centre is found by wedgeCentre.

      Parameters

      • slice: AmSprite

        The Slice sprite behind one pie, polar or sunburst data item

      Returns AmBounds | null

      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).