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

SliceGrouper can be used (imported) via one of the following packages.

// SliceGrouper is available in all of the following modules.
// You only need to import one of them.


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.

@default "Other"

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

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.

@default undefined
@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

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

@default 5

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.