SliceGrouper

Type class

A plugin which automatically groups PercenSeries slices that are smaller than certain percent into one "Other" slice.

By pushing an instance of SliceGrouper into plugin list of any PercentSeries, it automatically applies the functionality.

Example:

let series = chart.series.push(new am4charts.PieSeries());
series.dataFields.valueY = "value";
series.dataFields.dateX = "date";

let grouper = series.plugins.push(new am4plugins_sliceGrouper.SliceGrouper());
var series = chart.series.push(new am4charts.PieSeries());
series.dataFields.valueY = "value";
series.dataFields.dateX = "date";

var grouper = series.plugins.push(new am4plugins_sliceGrouper.SliceGrouper());
{
  // ...
  "series": [{
    // ...
  }, {
    "type": "PieSeries",
    "dataFields": {
      "valueY": "value",
      "dateX": "date"
    },
    "plugins": [{
      "type": "SliceGrouper"
    }]
  }]
}

@since 4.3.11

Sources

This information about SliceGrouper is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

SliceGrouper extends Plugin.

SliceGrouper is not extended by any other symbol.

Properties

bigSlices
#

Type List < Sprite | Slice | FunnelSlice >

Default new List()

A list of big slices that do not satisfy threshold.

clickBehavior
#

Type "none" | "break" | "zoom"

What happens when "Other" slice is clicked/tapped:

  • "none": nothing (default)
  • "break": the slice is broken down into actual slices it consists of
  • "zoom": actual small slices are shown and the rest of the slices are hidden

groupName
#

Type string

Default "Other"

A name to use for the "Other" slice.

groupProperties
#

Type IFunnelSliceProperties

Custom properties to apply to the "Other" slice.

@since 4.5.3

groupSlice
#

Type Sprite

A reference to "Other" slice.

limit
#

Type number

Default undefined

Maximum number of ungrouped slices to show. Any slice beyond limit will go into the "Other" group.

NOTE: if limit is set, threshold setting will be ignored.

@since 4.9.14

smallSlices
#

Type List < Sprite | Slice | FunnelSlice >

Default new List()

A list of small slices that do not satisfy threshold.

syncLegend
#

Type boolean

Default false

If set to true the legend will be synced to show currently visible slices only.

@defaylt false

target
#

Type Optional < PercentSeries >

A series object that will need its slices grouped.

threshold
#

Type number

Default 5

Percent threshold which slices to group. If a slice is less than threshold percent, it will be moved into "Other" group.

zoomOutButton
#

Type ZoomOutButton

An instance of ZoomOutButton that is shown when "Other" slice is broken down, to get back to grouped state.

Methods

constructor()

#

Returns SliceGrouper

Constructor

dispose()

#

Returns void

Disposes the element

init()

#

Returns void

isDisposed()

#

Returns boolean

Inherited from Plugin

Returns if this element is already disposed.

There is 1 inherited item currently hidden from this list.

Events

SliceGrouper does not have any events.

Adapters

SliceGrouper does not have any adapters.