Skip to content

SliceGrouper

Type classSince 4.3.11

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"
    }]
  }]
}

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 stringDefault "Other"

A name to use for the "Other" slice.

groupProperties

Type IFunnelSlicePropertiesSince 4.5.3

Custom properties to apply to the "Other" slice.

groupSlice

Type Sprite

A reference to "Other" slice.

limit

Type numberDefault undefinedSince 4.9.14

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.

smallSlices

Type List <Sprite | Slice | FunnelSlice>Default new List()

A list of small slices that do not satisfy threshold.

syncLegend

Type booleanDefault false

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

target

Type Optional <PercentSeries>

A series object that will need its slices grouped.

threshold

Type numberDefault 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

1 inherited item
isDisposed()

Returns booleanInherited from Plugin

Returns if this element is already disposed.

Events

SliceGrouper does not have any events.