A Cone Funnel Series illustrates how a value changes during a process, with a line representing the value at each stage and filled areas denoting the change between them.
Simple Cone Funnel Copy Link
import {
AgChartOptions,
AgCharts,
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
ContextMenuModule,
CrosshairModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-enterprise";
import { getData } from "./data";
ModuleRegistry.registerModules([
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
CrosshairModule,
LegendModule,
NumberAxisModule,
ContextMenuModule,
]);
const options: AgChartOptions = {
data: getData(),
title: {
text: "Conversion Drop Off",
},
series: [
{
type: "cone-funnel",
stageKey: "group",
valueKey: "value",
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export function getData() {
return [
{ group: "Page Visit", value: 490 },
{ group: "Enquiry", value: 340 },
{ group: "Quote", value: 300 },
{ group: "Sale", value: 290 },
];
}
To create a Cone Funnel Series, use the cone-funnel series type.
{
series: [
{
type: 'cone-funnel',
stageKey: 'group',
valueKey: 'value',
},
],
}In this configuration:
stageKeydefines the stages which are used for the lines of the cone funnel.valueKeyprovides the numerical values which determine the width of line.
Horizontal Cone Funnel Copy Link
import {
AgChartOptions,
AgCharts,
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
ContextMenuModule,
CrosshairModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-enterprise";
import { getData } from "./data";
ModuleRegistry.registerModules([
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
CrosshairModule,
LegendModule,
NumberAxisModule,
ContextMenuModule,
]);
const options: AgChartOptions = {
data: getData(),
title: {
text: "Conversion Drop Off",
},
seriesArea: {
padding: {
left: 20,
right: 20,
},
},
series: [
{
type: "cone-funnel",
stageKey: "group",
valueKey: "value",
direction: "horizontal",
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export function getData() {
return [
{ group: "Page Visit", value: 490 },
{ group: "Enquiry", value: 340 },
{ group: "Quote", value: 300 },
{ group: "Sale", value: 290 },
];
}
To create a horizontal Cone Funnel Series, set the direction to horizontal.
{
direction: 'horizontal',
} Customisation Copy Link
import {
AgChartOptions,
AgCharts,
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
ContextMenuModule,
CrosshairModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-enterprise";
import { getData } from "./data";
ModuleRegistry.registerModules([
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
CrosshairModule,
LegendModule,
NumberAxisModule,
ContextMenuModule,
]);
const options: AgChartOptions = {
data: getData(),
title: {
text: "Revenue Open by Sales Stage",
},
seriesArea: {
padding: {
left: 20,
right: 20,
},
},
series: [
{
type: "cone-funnel",
stageKey: "group",
valueKey: "value",
fills: ["#5090DC", "#FFA03A", "#459D55"],
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export function getData() {
return [
{ group: "Close", value: 4460 },
{ group: "Propose", value: 7260 },
{ group: "Develop", value: 7910 },
{ group: "Qualify", value: 8170 },
];
}
{
fills: ['#5090DC', '#FFA03A', '#459D55'],
}In this configuration:
- The fills for each drop off area are defined in the
fillsarray. - The Cone Funnel series is reversed by providing the data items in the reverse order.
Labels Copy Link
The values can be displayed along the dividing line using the label option, and the stage names can be shown with the stageLabel option.
import {
AgCartesianChartOptions,
AgCharts,
AgConeFunnelSeriesLabelPlacement,
AgConeFunnelSeriesOptions,
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
ContextMenuModule,
CrosshairModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-enterprise";
import { DataType, getData } from "./data";
const initialPlacement: AgConeFunnelSeriesLabelPlacement = "start-center";
ModuleRegistry.registerModules([
AnimationModule,
CategoryAxisModule,
ConeFunnelSeriesModule,
CrosshairModule,
LegendModule,
NumberAxisModule,
ContextMenuModule,
]);
const options: AgCartesianChartOptions<DataType> = {
data: getData(),
title: {
text: "Conversion Drop Off",
},
subtitle: {
text: initialPlacement,
},
animation: {
enabled: false,
},
seriesArea: {
padding: {
left: 20,
right: 20,
},
},
series: [
{
type: "cone-funnel",
stageKey: "group",
valueKey: "value",
direction: "vertical",
label: {
enabled: true,
placement: initialPlacement,
},
stageLabel: {
placement: "before",
},
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
function setPlacement(value: string) {
(options.series![0] as AgConeFunnelSeriesOptions<DataType>).label!.placement =
value as AgConeFunnelSeriesLabelPlacement;
options.subtitle!.text = value;
chart.update(options);
}
function setDirection(event: Event) {
const direction = (event.target as HTMLInputElement).value as
| "vertical"
| "horizontal";
options.series = [
{
...(options.series![0] as AgConeFunnelSeriesOptions<DataType>),
direction,
},
];
chart.update(options);
}
function setStageLabelPlacement(event: Event) {
const placement = (event.target as HTMLInputElement).value as
| "before"
| "after";
options.series = [
{
...(options.series![0] as AgConeFunnelSeriesOptions<DataType>),
stageLabel: { placement },
},
];
chart.update(options);
}
if (typeof window !== "undefined") {
// Attach external event handlers to window so they can be called from index.html
(<any>window).setPlacement = setPlacement;
(<any>window).setDirection = setDirection;
(<any>window).setStageLabelPlacement = setStageLabelPlacement;
}
export interface DataType {
group: string;
value: number;
}
export function getData(): DataType[] {
return [
{ group: "Page Visit", value: 490 },
{ group: "Enquiry", value: 340 },
{ group: "Quote", value: 300 },
{ group: "Sale", value: 290 },
];
}
{
label: {
enabled: true,
placement: 'middle-center',
},
stageLabel: {
placement: 'before',
},
}In this configuration:
- The label defaults to
start-center. Use the dropdown to see all available placements.startandendare the two sides of the dividing line withmiddlesitting exactly on it.before,centerandafterposition the label along the length of the line.
stageLabel.placementpositions the stage names on either side of the chart.- On a vertical cone funnel,
beforeandafterare mirrored when RTL Layout is enabled.
See Series Labels for the full set of label placement and collision avoidance options, and the API Reference for additional customisation options.
Cone Funnel Chart Examples Copy Link
See more Cone Funnel Chart examples in the AG Charts Gallery.
API Reference Copy Link
Properties available on the AgConeFunnelSeriesOptions interface.
- type required
'cone-funnel' - Configuration for the Cone 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
stringdefault: 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.
- 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 drop-offs. 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 drop-offs.
- fillOpacity
Opacity - The opacity of the fill for the drop-offs.
- strokeOpacity
Opacity - The opacity of the stroke for the drop-offs.
- strokeWidth
PixelSize - The width in pixels of the stroke for the drop-offs.
- direction
'horizontal' | 'vertical' - Bar rendering direction.
- label
AgConeFunnelSeriesLabelOptions - Configuration for the labels shown on between drop-offs.
- stageLabel
AgConeFunnelSeriesStageLabelOptions - Configuration for the stage labels.
- tooltip
AgSeriesTooltip - Series-specific tooltip configuration.
- highlight
AgHighlightOptions - Configuration for highlighting when a series or legend item is hovered over.
- 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.
Properties available on the AgConeFunnelSeriesOptions interface.
- type required
'cone-funnel' - Configuration for the Cone 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
stringdefault: 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.
- 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 drop-offs. 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 drop-offs.
- fillOpacity
Opacity - The opacity of the fill for the drop-offs.
- strokeOpacity
Opacity - The opacity of the stroke for the drop-offs.
- strokeWidth
PixelSize - The width in pixels of the stroke for the drop-offs.
- direction
'horizontal' | 'vertical' - Bar rendering direction.
- label
AgConeFunnelSeriesLabelOptions - Configuration for the labels shown on between drop-offs.
- stageLabel
AgConeFunnelSeriesStageLabelOptions - Configuration for the stage labels.
- tooltip
AgSeriesTooltip - Series-specific tooltip configuration.
- highlight
AgHighlightOptions - Configuration for highlighting when a series or legend item is hovered over.
- 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.