MAIDR Documentation - v4.4.0
    Preparing search index...
    • 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 centreleft === 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.

      Parameters

      • slice: AmSprite

        The Slice sprite behind one pie 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).