Angular ChartsFunnel Series

Version 14.2.0

A Funnel Series illustrates how a value changes during a process, with bar widths representing the value at each stage and drop-offs denoting the change between them.

Simple Funnel Copy Link

To create a Funnel Series, use the funnel series type.

{
    series: [
        {
            type: 'funnel',
            stageKey: 'group',
            valueKey: 'value',
        },
    ],
}

In this configuration:

  • stageKey defines the stages which are used for the bars of the funnel.
  • valueKey provides the numerical values which determine the width of each bar.

Horizontal Funnel Copy Link

To create a horizontal Funnel Series, set the direction to horizontal.

{
    direction: 'horizontal',
}

Segmented Funnel Copy Link

A segmented funnel does not draw the drop offs between the stages.

To disable the drop offs, set enabled to false in the dropOff configuration.

{
    dropOff: {
        enabled: false,
    },
}

Customisation Copy Link

{
    fills: ['#5090DC', '#FFA03A', '#459D55', '#34BFE1'],
}

In this configuration:

  • The fills for each stage are defined in the fills array.
  • The drop offs use an opacity of the same fills. This can be changed in the drop off options.
  • The Funnel Series is reversed by providing the data items in the reverse order.

Labels Copy Link

The values can be displayed inside or outside each stage using the label option, and the stage name can be shown with the stageLabel option.

{
    label: {
        enabled: true,
        placement: 'inside-center',
    },
    stageLabel: {
        placement: 'before',
    },
}

In this configuration:

  • The label is positioned as inside-center. Use the dropdown to see all available placements.
    • start and end are above and below the bar when vertical, left and right of it when horizontal.
    • before and after are the other two sides, matching stageLabel.placement.
  • stageLabel.placement positions the stage names on either side of the chart.
  • On a vertical funnel, before and after are mirrored when RTL Layout is enabled.
  • Providing placement as an ordered array (e.g. ['inside-center', 'outside-end']) lets a label that does not fit inside its stage fall back to an outside position.

See Series Labels for the full set of label placement and collision avoidance options, and the API Reference for additional customisation options.

Funnel Chart Examples Copy Link

See more Funnel Chart examples in the AG Charts Gallery.

API Reference Copy Link

Properties available on the AgFunnelSeriesOptions interface.

type required 'funnel'
Configuration for the Funnel Series.
stageKey required DatumKey
The key to use to retrieve stage values from the data.
valueKey required DatumKey
The key to use to retrieve values from the data.
id string default: auto-generated value
Primary identifier for the series. This is provided as `seriesId` in user callbacks to differentiate multiple series. Auto-generated ids are subject to future change without warning, if your callbacks need to vary behaviour by series please supply your own unique `id` value.
context ContextDefault
Context object to use in callbacks.
data DatumDefault[]
The data to use when rendering the series. If this is not supplied, data must be set on the chart instead.
visible boolean
Whether to display the series.
cursor string
The cursor to use for hovered markers. This config is identical to the CSS `cursor` property.
highlight AgHighlightOptions
Configuration for highlighting when a series or legend item is hovered over.
nodeClickRange InteractionRange
Range from a node that a click triggers the listener.
listeners AgSeriesListeners
A map of event names to event listeners.
fills AgColorType[]
The colours to cycle through for the fills of the bars. An array of colour strings, or fill objects for gradients, patterns, or images.
strokes CssColor[]
The colours to cycle through for the strokes of the bars.
fillOpacity Opacity
The opacity of the fill for the bars.
strokeOpacity Opacity
The opacity of the stroke for the bars.
strokeWidth PixelSize
The width in pixels of the stroke for the bars.
spacingRatio Ratio
The size of the gap between the categories as a proportion, between 0 and 1. This value is a fraction of the “step”, which is the interval between the start of a bar and the start of the next bar.
cornerRadius PixelSize default: 0
The corner radius applied to every bar. The chart background shows through the area cut away by the rounded corners.
dropOff AgFunnelSeriesDropOff
Configuration for drop-offs between adjacent bars.
direction 'horizontal' | 'vertical'
Bar rendering direction.
crisp boolean
Align bars to whole pixel values to remove anti-aliasing.
label AgFunnelSeriesLabelOptions
Configuration for the labels shown on bars.
stageLabel AgFunnelSeriesStageLabelOptions
Configuration for the stage labels.
shadow AgDropShadowOptions
Configuration for the shadow used behind the series items.
tooltip AgSeriesTooltip
Series-specific tooltip configuration.
itemStyler Styler
Function used to return formatting for individual bars, based on the given parameters.
lineDash PixelSize[]
An array specifying the length in pixels of alternating dashes and gaps.
lineDashOffset PixelSize
The initial offset of the dashed line in pixels.