This section explains how to listen and respond to various chart and series events. Most are either clicks or state changes, and listeners live in a listeners option, either on the chart or on individual elements.
Click Events Copy Link
Each clickable part of the chart has its own click event, these are detailed below. Listen on the chart for every occurrence, or on an individual element for just that one.
Every click event has a double-click form which carries the same payload. A double-click fires the single-click event on both clicks, then the double-click event on the second.
Some clicks can also be stopped from applying their built-in behaviour - see Prevent Default.
click and doubleClick Copy Link
These are fired on click or double-click on any empty part of the chart.
These events contain:
coordinates- for cartesian series types, the coordinates of the click point as plotted against each axis.- These are keyed by axis, with each axis providing
direction, thevalueat the clicked position and itsindexwithin the axisdomain. - The
contextobject, if set.
import {
AgChartClickEvent,
AgChartDoubleClickEvent,
AgChartOptions,
AgCharts,
BarSeriesModule,
CategoryAxisModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
ModuleRegistry.registerModules([
BarSeriesModule,
CategoryAxisModule,
LegendModule,
NumberAxisModule,
]);
const options: AgChartOptions = {
title: {
text: "Number of Cars Sold",
},
subtitle: {
text: "(single or double click empty space outside bars)",
},
data: [
{ month: "March", units: 25, brands: { BMW: 10, Toyota: 15 } },
{ month: "April", units: 27, brands: { Ford: 17, BMW: 10 } },
{ month: "May", units: 42, brands: { Nissan: 20, Toyota: 22 } },
],
series: [
{
type: "bar",
xKey: "month",
yKey: "units",
},
],
listeners: {
click: (event: AgChartClickEvent) => {
console.log("[click]", event);
},
doubleClick: (event: AgChartDoubleClickEvent) => {
console.log("[double click]", event);
},
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
{
listeners: {
click: (event) => {
console.log('[click]', event);
},
doubleClick: (event) => {
console.log('[double click]', event);
},
},
}In this example:
- When a blank area on a chart is clicked, a message is shown in the console along with the event details.
- When a blank area on a chart is double-clicked, a different message is shown along with the event details. The single-click event is also fired on both clicks.
seriesNodeClick and seriesNodeDoubleClick Copy Link
These are fired on click or double-click of a series node such as a bar or marker and are defined on the series or chart options.
The parameters of these events differ depending on the series type, but always include:
- The
seriesIdthe node belongs to and theitemIdof the clicked node. - The data object being visualised, usually
datum. - The specific keys in that
datumthat were used to fetch the values represented by the clicked node. allMatchedParams- every other node matched at the click point. See allMatchedParams.coordinates- the coordinates of the click point, in the same form as the chart click events.- The
contextobject, if set.
import {
AgChartOptions,
AgCharts,
BarSeriesModule,
CategoryAxisModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
import { DataType, getData } from "./data";
ModuleRegistry.registerModules([
BarSeriesModule,
CategoryAxisModule,
LineSeriesModule,
NumberAxisModule,
]);
const options: AgChartOptions<DataType> = {
title: {
text: "Average low/high temperatures in London",
},
subtitle: {
text: "(click a data point for details)",
},
data: getData(),
legend: {
enabled: false,
},
series: [
{
type: "line",
xKey: "month",
yKey: "high",
listeners: {
seriesNodeClick: (event) => console.log("[line click]", event),
seriesNodeDoubleClick: (event) =>
console.log("[line double click]", event),
},
},
{
type: "bar",
xKey: "month",
yKey: "low",
listeners: {
seriesNodeClick: (event) => console.log("[bar click]", event),
seriesNodeDoubleClick: (event) =>
console.log("[bar double click]", event),
},
},
],
listeners: {
seriesNodeClick: (event) => console.log("[chart click]", event),
seriesNodeDoubleClick: (event) =>
console.log("[chart double click]", event),
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export interface DataType {
month: string;
low: number;
high: number;
}
export function getData(): DataType[] {
return [
{ month: "March", low: 3.9, high: 11.3 },
{ month: "April", low: 5.5, high: 14.2 },
{ month: "May", low: 8.7, high: 17.9 },
];
}
{
series: [
{
type: 'line',
listeners: {
seriesNodeClick: (event) => console.log('[line click]', event),
seriesNodeDoubleClick: (event) => console.log('[line double click]', event),
},
// ...
},
{
type: 'bar',
listeners: {
seriesNodeClick: (event) => console.log('[bar click]', event),
seriesNodeDoubleClick: (event) => console.log('[bar double click]', event),
},
// ...
},
],
listeners: {
seriesNodeClick: (event) => console.log('[chart click]', event),
seriesNodeDoubleClick: (event) => console.log('[chart double click]', event),
},
}In this example:
- Whenever any series node (bar or marker) is clicked or double-clicked, the Chart listener prints a message to the console with the event details.
- Whenever a bar is clicked or double-clicked, the Bar Series listener prints a message to the console with the event details.
- Whenever a marker is clicked or double-clicked, the Line Series listener prints a message to the console with the event details.
Interaction Ranges Copy Link
By default, the seriesNodeClick event is only triggered when the user clicks exactly on a node.
Use the nodeClickRange option to instead define a range at which the event is triggered.
import {
AgCartesianChartOptions,
AgCharts,
CategoryAxisModule,
LegendModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
import { DataType, getData } from "./data";
ModuleRegistry.registerModules([
CategoryAxisModule,
LegendModule,
LineSeriesModule,
NumberAxisModule,
]);
const options: AgCartesianChartOptions<DataType> = {
data: getData(),
series: [
{
type: "line",
xKey: "quarter",
yKey: "petrol",
nodeClickRange: "exact",
listeners: {
seriesNodeClick: ({ datum }) => console.log(`petrol - ${datum.petrol}`),
},
},
{
type: "line",
xKey: "quarter",
yKey: "diesel",
nodeClickRange: "exact",
listeners: {
seriesNodeClick: ({ datum }) => console.log(`diesel - ${datum.diesel}`),
},
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
function nodeClickRangeChange(event: Event) {
const value = (event.target as HTMLInputElement).value;
const nodeClickRange =
value === "distance" ? 10 : (value as "exact" | "nearest");
options.series = options.series!.map((series) => ({
...series,
nodeClickRange,
}));
chart.update(options);
}
if (typeof window !== "undefined") {
// Attach external event handlers to window so they can be called from index.html
(<any>window).nodeClickRangeChange = nodeClickRangeChange;
}
export interface DataType {
quarter: string;
petrol: number;
diesel: number;
}
export function getData(): DataType[] {
return [
{
quarter: "Q1",
petrol: 200,
diesel: 100,
},
{
quarter: "Q2",
petrol: 300,
diesel: 130,
},
{
quarter: "Q3",
petrol: 350,
diesel: 160,
},
{
quarter: "Q4",
petrol: 400,
diesel: 200,
},
];
}
{
series: [
{
type: 'line',
nodeClickRange: 'exact',
listeners: {
seriesNodeClick: ({ datum }) => console.log(`petrol - ${datum.petrol}`),
},
// ...
},
],
}In this example:
'exact'(default) will trigger the event if the user clicks exactly on a node.'nearest'will trigger the event for whichever node is nearest to the click.- Given a number it will trigger the event when the click is made within that many pixels of a node.
- Area Series also supports
'area'as a value fornodeClickRange. This triggers the event when the click is made anywhere within the filled area of the series.
axisClick and axisDoubleClick (e) Copy Link
These are fired on click or double-click of an axis area or any of its elements and are defined on the axes or chart options.
These events contain:
- The
axisIdof the axis, as specified on the axis or automatically generated. - The
directionof the axis. - The
valueon the axis at the clicked point, matching the axis type, along with itsindexin the axisdomain. - The
boundSerieslisting all series that are using the axis. - The
contextobject, if set.
import {
AgCartesianChartOptions,
AgCharts,
LegendModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
UnitTimeAxisModule,
} from "ag-charts-enterprise";
import { DataType, getData } from "./data";
ModuleRegistry.registerModules([
LegendModule,
LineSeriesModule,
NumberAxisModule,
UnitTimeAxisModule,
]);
const options: AgCartesianChartOptions<DataType> = {
title: {
text: "Wedding Dress Orders, Sales and Profit",
},
subtitle: {
text: "Monthly performance of a wedding dress collection",
},
data: getData(),
axes: {
x: {
type: "unit-time",
position: "bottom",
listeners: {
click: (event) => console.log("[x axis click]", event),
doubleClick: (event) => console.log("[x axis double click]", event),
},
},
yProfit: {
type: "number",
position: "left",
title: {
text: "Profit",
},
listeners: {
click: (event) => console.log("[profit axis click]", event),
doubleClick: (event) =>
console.log("[profit axis double click]", event),
},
},
ySales: {
type: "number",
position: "right",
title: {
text: "Sales",
},
},
yOrders: {
type: "number",
position: "right",
title: {
text: "Orders",
},
},
},
series: [
{
type: "line",
xKey: "month",
yKey: "profit",
yName: "Profit",
yKeyAxis: "yProfit",
},
{
type: "line",
xKey: "month",
yKey: "orders",
yName: "Orders",
yKeyAxis: "yOrders",
},
{
type: "line",
xKey: "month",
yKey: "sales",
yName: "Sales",
yKeyAxis: "ySales",
},
],
listeners: {
axisClick: (event) => console.log("[chart axis click]", event),
axisDoubleClick: (event) => console.log("[chart axis double click]", event),
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export interface DataType {
month: Date;
profit: number;
orders: number;
sales: number;
}
export function getData(): DataType[] {
return [
{ month: new Date(2025, 0, 1), profit: 18000, orders: 420, sales: 52000 },
{ month: new Date(2025, 1, 1), profit: 24000, orders: 510, sales: 68000 },
{ month: new Date(2025, 2, 1), profit: 31000, orders: 470, sales: 82000 },
{ month: new Date(2025, 3, 1), profit: 39000, orders: 390, sales: 96000 },
{ month: new Date(2025, 4, 1), profit: 48000, orders: 340, sales: 112000 },
{ month: new Date(2025, 5, 1), profit: 57000, orders: 310, sales: 128000 },
{ month: new Date(2025, 6, 1), profit: 63000, orders: 280, sales: 141000 },
{ month: new Date(2025, 7, 1), profit: 59000, orders: 260, sales: 136000 },
{ month: new Date(2025, 8, 1), profit: 51000, orders: 240, sales: 119000 },
{ month: new Date(2025, 9, 1), profit: 43000, orders: 220, sales: 98000 },
{ month: new Date(2025, 10, 1), profit: 35000, orders: 250, sales: 81000 },
{ month: new Date(2025, 11, 1), profit: 28000, orders: 330, sales: 69000 },
];
}
{
axes: {
x: {
listeners: {
click: (event) => console.log('[x axis click]', event),
doubleClick: (event) => console.log('[x axis double click]', event),
},
// ...
},
yProfit: {
listeners: {
click: (event) => console.log('[profit axis click]', event),
doubleClick: (event) => console.log('[profit axis double click]', event),
},
// ...
},
},
listeners: {
axisClick: (event) => console.log('[chart axis click]', event),
axisDoubleClick: (event) => console.log('[chart axis double click]', event),
},
}In this example:
- Whenever the x-axis is clicked or double-clicked, the x-axis listener prints a message to the console.
- Whenever the left hand "Profit" axis is clicked or double-clicked, the
yProfitAxis listener prints a message to the console. - Whenever any x-axis or y-axis is clicked or double-clicked, the Chart listener prints a message to the console.
crossLineClick and crossLineDoubleClick Copy Link
These are fired on click or double-click of a Cross Line, including its label. This can be defined on the Cross Line itself, the axis or the chart.
These events contain:
- The
crossLineId, as specified on the Cross Line or automatically generated. - The
axisIdanddirectionof the axis the Cross Line belongs to. - The
crossLineType, either'line'or'range'. - The
valueof alineCross Line, or therangeof arangeCross Line. allMatchedParams- every element under the click point, including other Cross Lines or series node. See allMatchedParams.- The
contextobject, if set.
import {
AgCartesianChartOptions,
AgCharts,
AgCrossLineListeners,
AreaSeriesModule,
CrossLinesModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
UnitTimeAxisModule,
} from "ag-charts-community";
import { DataType, getData } from "./data";
const lockdownLabelStyle = { fontStyle: "italic", position: "bottom" } as const;
const variantLineStyle = { strokeWidth: 2, lineDash: [6, 4] };
const variantLabelStyle = { position: "top" } as const;
const lockdownListeners: AgCrossLineListeners = {
click: (event) => console.log("[lockdown click]", event),
doubleClick: (event) => console.log("[lockdown double click]", event),
};
ModuleRegistry.registerModules([
AreaSeriesModule,
CrossLinesModule,
LegendModule,
NumberAxisModule,
UnitTimeAxisModule,
]);
const options: AgCartesianChartOptions<DataType> = {
title: {
text: "COVID-19 ICU Bed Usage",
},
subtitle: {
text: "Monthly peak ICU occupancy",
},
data: getData(),
axes: {
x: {
type: "unit-time",
position: "bottom",
label: {
spacing: 25,
},
crossLines: [
{
id: "first-lockdown",
type: "range",
range: [new Date(2020, 2, 23), new Date(2020, 5, 1)],
label: {
text: "First lockdown",
...lockdownLabelStyle,
},
listeners: lockdownListeners,
},
{
id: "winter-lockdown",
type: "range",
range: [new Date(2020, 10, 5), new Date(2021, 1, 15)],
label: {
text: "Winter lockdown",
...lockdownLabelStyle,
},
listeners: lockdownListeners,
},
{
id: "soft-lockdown",
type: "range",
range: [new Date(2021, 11, 20), new Date(2022, 1, 15)],
label: {
text: "Soft lockdown",
...lockdownLabelStyle,
},
listeners: lockdownListeners,
},
{
id: "alpha-variant",
type: "line",
value: new Date(2020, 11, 1),
...variantLineStyle,
label: {
text: "Alpha",
...variantLabelStyle,
},
},
{
id: "delta-variant",
type: "line",
value: new Date(2021, 6, 1),
...variantLineStyle,
label: {
text: "Delta",
...variantLabelStyle,
},
},
{
id: "omicron-variant",
type: "line",
value: new Date(2021, 10, 1),
...variantLineStyle,
label: {
text: "Omicron",
...variantLabelStyle,
},
},
],
listeners: {
crossLineClick: (event) =>
console.log("[x axis cross line click]", event),
crossLineDoubleClick: (event) =>
console.log("[x axis cross line double click]", event),
},
},
y: {
type: "number",
position: "left",
title: {
text: "ICU beds occupied",
},
crossLines: [
{
id: "icu-capacity",
type: "line",
value: 700,
strokeWidth: 2,
lineDash: [8, 4],
label: {
text: "ICU capacity (700 beds)",
position: "top-right",
},
listeners: {
click: (event) => console.log("[capacity click]", event),
doubleClick: (event) =>
console.log("[capacity double click]", event),
},
},
],
},
},
series: [
{
type: "area",
xKey: "month",
yKey: "maxICU",
yName: "ICU beds occupied",
strokeWidth: 1,
fillOpacity: 0.5,
},
],
listeners: {
crossLineClick: (event) => console.log("[chart cross line click]", event),
crossLineDoubleClick: (event) =>
console.log("[chart cross line double click]", event),
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export interface DataType {
month: Date;
maxICU: number;
}
export function getData(): DataType[] {
return [
{ month: new Date(2019, 11, 1), maxICU: 18 },
{ month: new Date(2020, 0, 1), maxICU: 22 },
{ month: new Date(2020, 1, 1), maxICU: 31 },
{ month: new Date(2020, 2, 1), maxICU: 185 },
{ month: new Date(2020, 3, 1), maxICU: 642 },
{ month: new Date(2020, 4, 1), maxICU: 511 },
{ month: new Date(2020, 5, 1), maxICU: 218 },
{ month: new Date(2020, 6, 1), maxICU: 86 },
{ month: new Date(2020, 7, 1), maxICU: 71 },
{ month: new Date(2020, 8, 1), maxICU: 129 },
{ month: new Date(2020, 9, 1), maxICU: 347 },
{ month: new Date(2020, 10, 1), maxICU: 586 },
{ month: new Date(2020, 11, 1), maxICU: 618 },
{ month: new Date(2021, 0, 1), maxICU: 571 },
{ month: new Date(2021, 1, 1), maxICU: 428 },
{ month: new Date(2021, 2, 1), maxICU: 319 },
{ month: new Date(2021, 3, 1), maxICU: 287 },
{ month: new Date(2021, 4, 1), maxICU: 201 },
{ month: new Date(2021, 5, 1), maxICU: 112 },
{ month: new Date(2021, 6, 1), maxICU: 143 },
{ month: new Date(2021, 7, 1), maxICU: 362 },
{ month: new Date(2021, 8, 1), maxICU: 521 },
{ month: new Date(2021, 9, 1), maxICU: 476 },
{ month: new Date(2021, 10, 1), maxICU: 391 },
{ month: new Date(2021, 11, 1), maxICU: 334 },
{ month: new Date(2022, 0, 1), maxICU: 548 },
{ month: new Date(2022, 1, 1), maxICU: 497 },
{ month: new Date(2022, 2, 1), maxICU: 351 },
{ month: new Date(2022, 3, 1), maxICU: 286 },
{ month: new Date(2022, 4, 1), maxICU: 241 },
{ month: new Date(2022, 5, 1), maxICU: 178 },
{ month: new Date(2022, 6, 1), maxICU: 229 },
{ month: new Date(2022, 7, 1), maxICU: 264 },
{ month: new Date(2022, 8, 1), maxICU: 198 },
{ month: new Date(2022, 9, 1), maxICU: 172 },
{ month: new Date(2022, 10, 1), maxICU: 241 },
{ month: new Date(2022, 11, 1), maxICU: 319 },
{ month: new Date(2023, 0, 1), maxICU: 287 },
{ month: new Date(2023, 1, 1), maxICU: 214 },
{ month: new Date(2023, 2, 1), maxICU: 153 },
{ month: new Date(2023, 3, 1), maxICU: 108 },
{ month: new Date(2023, 4, 1), maxICU: 74 },
{ month: new Date(2023, 5, 1), maxICU: 51 },
{ month: new Date(2023, 6, 1), maxICU: 43 },
{ month: new Date(2023, 7, 1), maxICU: 38 },
{ month: new Date(2023, 8, 1), maxICU: 41 },
{ month: new Date(2023, 9, 1), maxICU: 47 },
{ month: new Date(2023, 10, 1), maxICU: 52 },
{ month: new Date(2023, 11, 1), maxICU: 46 },
];
}
{
axes: {
x: {
crossLines: [
{
id: 'winter-lockdown',
listeners: {
click: (event) => console.log('[lockdown click]', event),
doubleClick: (event) => console.log('[lockdown double click]', event),
},
// ...
},
],
listeners: {
crossLineClick: (event) => console.log('[x axis cross line click]', event),
crossLineDoubleClick: (event) => console.log('[x axis cross line double click]', event),
},
// ...
},
},
listeners: {
crossLineClick: (event) => console.log('[chart cross line click]', event),
crossLineDoubleClick: (event) => console.log('[chart cross line double click]', event),
},
}In this example:
- Whenever a lockdown range or the ICU capacity line is clicked or double-clicked, that Cross Line's own listener prints a message to the console.
- Whenever a Cross Line on the x-axis is clicked or double-clicked, the x-axis listener prints a message to the console.
- Whenever any Cross Line is clicked or double-clicked, the Chart listener prints a message to the console.
- Clicking where a variant line crosses a lockdown range, lists both Cross Lines in
allMatchedParams.
legendItemClick and legendItemDoubleClick Copy Link
These are fired on click or double-click of a legend item.
These events contain:
- The
seriesIdof the series associated with the legend item. - The
itemId, usually theyKeyvalue for cartesian series. - The current
visiblestate of the series or item. - The
preventDefault()method to stop any built-in series visibility toggle that would otherwise occur. - The
contextobject, if set.
Although clicking a legend item usually toggles the series visibility, this change is not included in the legend event. Use the chart seriesVisibilityChange event to listen for this.
import {
AgCartesianChartOptions,
AgChartLegendClickEvent,
AgChartLegendDoubleClickEvent,
AgCharts,
CategoryAxisModule,
LegendModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
ModuleRegistry.registerModules([
CategoryAxisModule,
LegendModule,
LineSeriesModule,
NumberAxisModule,
]);
const options: AgCartesianChartOptions = {
data: [
{
quarter: "Q1",
petrol: 200,
diesel: 100,
},
{
quarter: "Q2",
petrol: 300,
diesel: 130,
},
{
quarter: "Q3",
petrol: 350,
diesel: 160,
},
{
quarter: "Q4",
petrol: 400,
diesel: 200,
},
],
series: [
{
type: "line",
xKey: "quarter",
yKey: "petrol",
},
{
type: "line",
xKey: "quarter",
yKey: "diesel",
},
],
legend: {
listeners: {
legendItemClick: (event: AgChartLegendClickEvent) => {
console.log("[click]", event);
},
legendItemDoubleClick: (event: AgChartLegendDoubleClickEvent) => {
console.log("[double click]", event);
},
},
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
{
legend: {
listeners: {
legendItemClick: (event) => {
console.log('[click]', event);
},
legendItemDoubleClick: (event) => {
console.log('[double click]', event);
},
},
},
}In this example:
- When a legend item is clicked, a message is logged to the console with the
legendItemClickevent contents. - When a legend item is double clicked, a message is logged to the console with the
legendItemDoubleClickevent contents.
captionClick and captionDoubleClick Copy Link
These are fired on click or double-click of the chart's title, subtitle or footnote. These are defined on the caption itself or on the chart.
These events contain:
- The
captionType, either'title','subtitle'or'footnote'. - The
textof the clicked caption. - The
contextobject, if set.
import {
AgCaptionClickEvent,
AgChartOptions,
AgCharts,
BarSeriesModule,
CategoryAxisModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
ModuleRegistry.registerModules([
BarSeriesModule,
CategoryAxisModule,
LegendModule,
NumberAxisModule,
]);
const options: AgChartOptions = {
title: {
text: "Number of Cars Sold",
listeners: {
click: (event: AgCaptionClickEvent<"click">) => {
console.log("[title click]", event);
},
doubleClick: (event: AgCaptionClickEvent<"doubleClick">) => {
console.log("[title double click]", event);
},
},
},
subtitle: {
text: "(single or double click the title, subtitle or footnote)",
},
footnote: {
text: "Source: Internal sales data",
},
data: [
{ month: "March", units: 25 },
{ month: "April", units: 27 },
{ month: "May", units: 42 },
],
series: [
{
type: "bar",
xKey: "month",
yKey: "units",
},
],
listeners: {
captionClick: (event) => console.log("[chart caption click]", event),
captionDoubleClick: (event) =>
console.log("[chart caption double click]", event),
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
{
title: {
text: 'Number of Cars Sold',
listeners: {
click: (event) => console.log('[title click]', event),
doubleClick: (event) => console.log('[title double click]', event),
},
},
// ...
listeners: {
captionClick: (event) => console.log('[chart caption click]', event),
captionDoubleClick: (event) => console.log('[chart caption double click]', event),
},
}In this example:
- Whenever the title, subtitle or footnote is clicked or double-clicked, the Chart listener prints a message to the console with the event details.
- The title has its own listeners, so clicking or double-clicking on it prints a second message.
allMatchedParams Copy Link
Most click events include an allMatchedParams array listing every element found at the click point, not only the one that won the event. This is useful for scenarios where multiple elements overlap, such as a Cross Line and a series node.
Each entry is identified by its own type, matching the specific event it would have delivered for that interaction and includes the same properties as it would have carried. The winning event is also included in the array.
See the Cross Line Click Event example above: clicking where a variant line crosses a lockdown range lists both Cross Lines in allMatchedParams.
State Change Events Copy Link
These are raised when the chart state changes, by either user interaction or an API call and are always defined on the chart options.
seriesVisibilityChange Copy Link
This is fired when the visibility of a series or data item is toggled. This is usually triggered by user interaction with a legend item.
This event contains:
- The
seriesIdof the series. - The
itemId,legendItemNameor other identifiers of the changed item. visible- the new visibility state of the series or item.- The
contextobject, if set.
import {
AgCharts,
AgPolarChartOptions,
AgSeriesVisibilityChange,
LegendModule,
ModuleRegistry,
PieSeriesModule,
} from "ag-charts-community";
ModuleRegistry.registerModules([LegendModule, PieSeriesModule]);
const options: AgPolarChartOptions = {
title: { text: "Business Expense Distribution" },
data: [
{ expense: "Salaries", percentage: 40 },
{ expense: "Office Rent", percentage: 20 },
{ expense: "Marketing", percentage: 15 },
{ expense: "Research & Development", percentage: 10 },
{ expense: "Utilities & Miscellaneous", percentage: 10 },
{ expense: "Travel", percentage: 5 },
],
series: [{ type: "pie", angleKey: "percentage", legendItemKey: "expense" }],
listeners: {
seriesVisibilityChange: (event: AgSeriesVisibilityChange) => {
console.log("[series visibility change]", event);
},
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
{
listeners: {
seriesVisibilityChange: (event) => {
console.log('[series visibility change]', event);
},
},
}In this example:
- When a legend item is clicked, its series or item visibility toggles and this event fires with the details shown in the console.
activeChange Copy Link
This event is fired when the active state is changed. This occurs when a user interaction (mouse, touch, keyboard) on a series node or legend causes a highlight or tooltip change.
This event contains:
activeItem- the item that is now active, orundefinedif no item is active.- The
activeItemcontains:type- the type of the active item, either'series-node'or'legend'.seriesIdanditemIdidentifying the active item.
datum- the data from the chart data array for the active item.source- the source of the event, either'user-interaction'or'state-change'.- The
preventDefault()method to stop the highlight/tooltip change that would otherwise occur. - The
contextobject, if set.
import {
AgActiveChangeEvent,
AgChartOptions,
AgCharts,
BarSeriesModule,
CategoryAxisModule,
LegendModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
import { getData } from "./data";
ModuleRegistry.registerModules([
BarSeriesModule,
LegendModule,
CategoryAxisModule,
NumberAxisModule,
]);
const options: AgChartOptions = {
title: {
text: "Energy Production by Source & Country",
},
subtitle: {
text: "Energy Production (TWh)",
},
data: getData(),
series: [
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "USACoal",
yName: "Coal - USA",
legendItemName: "Coal",
stackGroup: "usa",
fill: "#5b5b5b",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "USAGas",
yName: "Natural Gas - USA",
legendItemName: "Natural Gas",
stackGroup: "usa",
fill: "#f2a541",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "USARenewables",
yName: "Renewables - USA",
legendItemName: "Renewables",
stackGroup: "usa",
fill: "#4caf50",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "USANuclear",
yName: "Nuclear - USA",
legendItemName: "Nuclear",
stackGroup: "usa",
fill: "#6f7bd9",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "GermanyCoal",
yName: "Coal - Germany",
legendItemName: "Coal",
stackGroup: "germany",
showInLegend: false,
fill: "#5b5b5b",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "GermanyGas",
yName: "Natural Gas - Germany",
legendItemName: "Natural Gas",
stackGroup: "germany",
showInLegend: false,
fill: "#f2a541",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "GermanyRenewables",
yName: "Renewables - Germany",
legendItemName: "Renewables",
stackGroup: "germany",
showInLegend: false,
fill: "#4caf50",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "GermanyNuclear",
yName: "Nuclear - Germany",
legendItemName: "Nuclear",
stackGroup: "germany",
showInLegend: false,
fill: "#6f7bd9",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "ChinaCoal",
yName: "Coal - China",
legendItemName: "Coal",
stackGroup: "china",
showInLegend: false,
fill: "#5b5b5b",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "ChinaGas",
yName: "Natural Gas - China",
legendItemName: "Natural Gas",
stackGroup: "china",
showInLegend: false,
fill: "#f2a541",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "ChinaRenewables",
yName: "Renewables - China",
legendItemName: "Renewables",
stackGroup: "china",
showInLegend: false,
fill: "#4caf50",
},
{
type: "bar",
direction: "horizontal",
xKey: "year",
yKey: "ChinaNuclear",
yName: "Nuclear - China",
legendItemName: "Nuclear",
stackGroup: "china",
showInLegend: false,
fill: "#6f7bd9",
},
],
listeners: {
activeChange: (event: AgActiveChangeEvent<unknown, unknown>) => {
console.log("[active change]", event);
},
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export function getData() {
return [
{
year: 2024,
USACoal: 900,
USAGas: 1600,
USARenewables: 800,
USANuclear: 780,
GermanyCoal: 420,
GermanyGas: 500,
GermanyRenewables: 620,
GermanyNuclear: 60,
ChinaCoal: 4200,
ChinaGas: 350,
ChinaRenewables: 1400,
ChinaNuclear: 420,
},
{
year: 2025,
USACoal: 850,
USAGas: 1650,
USARenewables: 900,
USANuclear: 790,
GermanyCoal: 380,
GermanyGas: 480,
GermanyRenewables: 700,
GermanyNuclear: 40,
ChinaCoal: 4000,
ChinaGas: 380,
ChinaRenewables: 1600,
ChinaNuclear: 450,
},
{
year: 2026,
USACoal: 800,
USAGas: 1700,
USARenewables: 1050,
USANuclear: 800,
GermanyCoal: 320,
GermanyGas: 460,
GermanyRenewables: 820,
GermanyNuclear: 0,
ChinaCoal: 3800,
ChinaGas: 420,
ChinaRenewables: 1900,
ChinaNuclear: 500,
},
];
}
{
listeners: {
activeChange: (event) => {
console.log('[active change]', event);
},
},
}In this example:
- Whenever a user interaction (mouse, touch, keyboard) on the series-area or legend changes the highlight state, a message is shown in the console.
zoom Copy Link
This is fired when the zoom level or position changes. This is triggered when zooming in or out of the chart, panning, or using the Navigator, Scrollbar or Range Buttons.
This event contains:
- A
ratioXandratioYwithstartandendproperties with values between0and1. These represent a proportion of the width or height of the chart. - A
rangeXandrangeYwhich contain values that match the axis type, e.g. a date for an Ordinal Time Axis. source- the source of the event:'user-interaction','state-change','chart-update','data-update'or'sync'.- The
contextobject, if set.
import {
AgCartesianChartOptions,
AgCharts,
AnimationModule,
CategoryAxisModule,
ContextMenuModule,
CrosshairModule,
LegendModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
ZoomModule,
} from "ag-charts-enterprise";
import { getData } from "./data";
ModuleRegistry.registerModules([
AnimationModule,
CategoryAxisModule,
CrosshairModule,
LegendModule,
LineSeriesModule,
NumberAxisModule,
ZoomModule,
ContextMenuModule,
]);
const options: AgCartesianChartOptions = {
title: {
text: "2023 Average Temperatures",
},
subtitle: {
text: "Oxford, UK",
},
zoom: {
enabled: true,
anchorPointX: "pointer",
},
listeners: {
zoom: (event) => {
console.log(event);
},
},
data: getData(),
series: [
{
type: "line",
xKey: "month",
xName: "Month",
yKey: "min",
yName: "Min Temperature",
interpolation: { type: "smooth" },
},
{
type: "line",
xKey: "month",
xName: "Month",
yKey: "max",
yName: "Max Temperature",
interpolation: { type: "smooth" },
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
// Source: https://www.metoffice.gov.uk/pub/data/weather/uk/climate/stationdata/oxforddata.txt
export function getData() {
return [
{ month: "January", max: 8.5, min: 2.6 },
{ month: "February", max: 10.4, min: 3.0 },
{ month: "March", max: 10.9, min: 4.7 },
{ month: "April", max: 13.7, min: 5.0 },
{ month: "May", max: 18.2, min: 8.4 },
{ month: "June", max: 23.6, min: 12.2 },
{ month: "July", max: 21.3, min: 13.0 },
{ month: "August", max: 21.9, min: 13.1 },
{ month: "September", max: 22.6, min: 13.2 },
{ month: "October", max: 17.0, min: 9.7 },
{ month: "November", max: 11.1, min: 4.9 },
{ month: "December", max: 10.2, min: 5.2 },
];
}
{
listeners: {
zoom: (event) => {
console.log(event);
},
},
}In this example:
- When the zoom level is changed or the chart is panned, the event is output to the console.
annotations Copy Link
This is fired when the annotations are changed, added or removed in either cartesian charts or with the financial charts toolbar.
This event contains:
- The array of all the
annotationswith their current state. - The
contextobject, if set.
import {
AgChartOptions,
AgCharts,
AnimationModule,
AnnotationsModule,
CategoryAxisModule,
ChartToolbarModule,
ContextMenuModule,
CrosshairModule,
LegendModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-enterprise";
import { getData } from "./data";
ModuleRegistry.registerModules([
AnimationModule,
AnnotationsModule,
CategoryAxisModule,
ChartToolbarModule,
CrosshairModule,
LegendModule,
LineSeriesModule,
NumberAxisModule,
ContextMenuModule,
]);
const options: AgChartOptions = {
data: getData(),
title: {
text: "Monthly Sales Revenue",
},
footnote: {
text: "2024, values in $1000s",
},
series: [
{
type: "line",
xKey: "month",
yKey: "revenue",
interpolation: { type: "smooth" },
marker: {
enabled: false,
},
},
],
listeners: {
annotations: (event) => {
console.log(event);
},
},
annotations: {
enabled: true,
toolbar: {
buttons: [
{
icon: "delete",
value: "clear",
},
{
icon: "text-annotation",
value: "text-menu",
},
],
},
},
initialState: {
annotations: [
{
type: "comment",
x: { value: "Feb", groupPercentage: -0.2 },
y: 46,
text: "$45,000",
fontSize: 12,
},
{
type: "text",
x: { value: "Jun", groupPercentage: -0.2 },
y: 81,
text: "$80,000",
fontSize: 12,
},
{
type: "note",
x: "Sep",
y: 75,
text: "End of summer dip recovered",
fontSize: 12,
},
{
type: "callout",
start: { x: { value: "Dec", groupPercentage: -0.1 }, y: 107 },
end: { x: "Oct", y: 110 },
text: "$95,000",
fontSize: 12,
},
],
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export function getData() {
return [
{ month: "Jan", revenue: 32 },
{ month: "Feb", revenue: 45 },
{ month: "Mar", revenue: 38 },
{ month: "Apr", revenue: 50 },
{ month: "May", revenue: 65 },
{ month: "Jun", revenue: 80 },
{ month: "Jul", revenue: 78 },
{ month: "Aug", revenue: 72 },
{ month: "Sep", revenue: 85 },
{ month: "Oct", revenue: 95 },
{ month: "Nov", revenue: 90 },
{ month: "Dec", revenue: 105 },
];
}
{
listeners: {
annotations: (event) => {
console.log(event);
},
},
}In this example:
- When an annotation is changed, added or removed, the event is output to the console.
selectionChange Copy Link
This is fired when the Data Selection is updated by either user interaction or an API call. See Selection Change Event for full details.
collapsedChange Copy Link
This is fired when an item in an Org Chart is expanded or collapsed, by either user interaction or an API call.
import {
AgChartOptions,
AgCharts,
ContextMenuModule,
ModuleRegistry,
OrganizationSeriesModule,
} from "ag-charts-enterprise";
import { getData } from "./data";
ModuleRegistry.registerModules([OrganizationSeriesModule, ContextMenuModule]);
const options: AgChartOptions = {
title: {
text: "Company Organisation",
},
data: getData(),
listeners: {
collapsedChange: (event) => {
console.log(
`source: ${event.source},`,
"just collapsed:",
event.collapsed.map(({ itemId }) => itemId),
"just expanded:",
event.expanded.map(({ itemId }) => itemId),
);
},
},
initialState: {
collapsed: [
"Mr. Jeffrey Brown",
"Nathan Jones",
"Justin Contreras",
"Lawrence Martinez",
"Eric Jensen",
],
},
series: [
{
type: "organization",
idKey: "id",
parentIdKey: "parentId",
node: {
image: {
key: "avatar",
height: 50,
width: 50,
position: "left",
},
title: { key: "name" },
subtitle: { key: "job" },
labels: [{ key: "location" }],
},
},
],
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
export function getData() {
return [
{
id: "Ashley Rivers",
parentId: null,
name: "Ashley Rivers",
job: "CEO",
department: "Executive",
location: "France",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/19.webp",
},
{
id: "Julia Howe",
parentId: "Ashley Rivers",
name: "Julia Howe",
job: "CTO",
department: "Technology",
location: "United States",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/20.webp",
},
{
id: "Mr. Jeffrey Brown",
parentId: "Julia Howe",
name: "Mr. Jeffrey Brown",
job: "Design",
department: "Technology",
location: "France",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/22.webp",
},
{
id: "Melissa Vazquez",
parentId: "Mr. Jeffrey Brown",
name: "Melissa Vazquez",
job: "Design",
department: "Technology",
location: "France",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/2.webp",
},
{
id: "John Thomas",
parentId: "Mr. Jeffrey Brown",
name: "John Thomas",
job: "Design",
department: "Technology",
location: "Netherlands",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/5.webp",
},
{
id: "Nathan Jones",
parentId: "Julia Howe",
name: "Nathan Jones",
job: "Exec. Vice President",
department: "Technology",
location: "Portugal",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/29.webp",
},
{
id: "James Long",
parentId: "Nathan Jones",
name: "James Long",
job: "Design",
department: "Technology",
location: "Netherlands",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/25.webp",
},
{
id: "Samuel Hernandez",
parentId: "Nathan Jones",
name: "Samuel Hernandez",
job: "Design",
department: "Technology",
location: "Ireland",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/7.webp",
},
{
id: "Justin Contreras",
parentId: "Julia Howe",
name: "Justin Contreras",
job: "Design",
department: "Technology",
location: "Italy",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/10.webp",
},
{
id: "Rachel Ibarra",
parentId: "Justin Contreras",
name: "Rachel Ibarra",
job: "Design",
department: "Technology",
location: "Italy",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/2.webp",
},
{
id: "John Gomez",
parentId: "Justin Contreras",
name: "John Gomez",
job: "Design",
department: "Technology",
location: "France",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/17.webp",
},
{
id: "Gabriella Garcia",
parentId: "Ashley Rivers",
name: "Gabriella Garcia",
job: "Head of Department",
department: "Operations",
location: "Netherlands",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/18.webp",
},
{
id: "Lawrence Martinez",
parentId: "Gabriella Garcia",
name: "Lawrence Martinez",
job: "Design",
department: "Operations",
location: "United States",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/33.webp",
},
{
id: "Devin Pittman",
parentId: "Lawrence Martinez",
name: "Devin Pittman",
job: "Design",
department: "Operations",
location: "United Kingdom",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/18.webp",
},
{
id: "Emily Barajas",
parentId: "Lawrence Martinez",
name: "Emily Barajas",
job: "Design",
department: "Operations",
location: "Italy",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/28.webp",
},
{
id: "Eric Jensen",
parentId: "Gabriella Garcia",
name: "Eric Jensen",
job: "Design",
department: "Operations",
location: "Spain",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/35.webp",
},
{
id: "Michael Morris",
parentId: "Eric Jensen",
name: "Michael Morris",
job: "Design",
department: "Operations",
location: "France",
status: "In Office",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/10.webp",
},
{
id: "Jodi Miller",
parentId: "Eric Jensen",
name: "Jodi Miller",
job: "Design",
department: "Operations",
location: "Italy",
status: "Remote",
avatar: "https://www.ag-grid.com/charts/archive/14.2.0/example-assets/docs-images/hr/30.webp",
},
];
}
{
listeners: {
collapsedChange: (event) => {
console.log(
`source: ${event.source},`,
'just collapsed:',
event.collapsed.map(({ itemId }) => itemId),
'just expanded:',
event.expanded.map(({ itemId }) => itemId)
);
},
},
}This event contains:
collapsed- array of the items newly collapsed by this change, each withitemIdanddatum:itemId- the unique identifier of the datum.datum- the data from the chart data array for the collapsed item.
expanded- array of the items newly expanded by this change, each withitemIdanddatum:itemId- the unique identifier of the datum.datum- the data from the chart data array for the expanded item.
source- the source of the event, either'user-interaction'or'api-call'.- The
contextobject, if set.
In this example:
- Whenever a node is collapsed or expanded, a message is shown in the console.
collapsed and expanded contain only the items changed by this event, not the full set of collapsed or expanded items. Use chart.getState() to get the current state of all items.
Validation Issues Copy Link
Option misconfiguration and caught runtime errors are reported through the validations.issueRaised event.
See Issue Raised Events.
Prevent Default Copy Link
Some events include a preventDefault() method to stop the built-in behaviour that would otherwise follow the interaction.
Call event.preventDefault() from within the listener, and check event.defaultPrevented to see whether an earlier listener already called it.
The events that can be prevented are:
legendItemClickandlegendItemDoubleClick- stops the series visibility toggle that a legend click would otherwise trigger.seriesNodeClick,seriesNodeDoubleClick- stops any tooltip pagination or selection that a node click would otherwise trigger.activeChange- stops the highlight/tooltip change itself from being applied.selectionChange- stops the Data Selection update.collapsedChange- stops the Org Chart node from expanding or collapsing.
import {
AgCartesianChartOptions,
AgChartLegendClickEvent,
AgCharts,
CategoryAxisModule,
LegendModule,
LineSeriesModule,
ModuleRegistry,
NumberAxisModule,
} from "ag-charts-community";
let counter = 1;
ModuleRegistry.registerModules([
CategoryAxisModule,
LegendModule,
LineSeriesModule,
NumberAxisModule,
]);
const options: AgCartesianChartOptions = {
data: [
{
quarter: "Q1",
petrol: 200,
diesel: 100,
},
{
quarter: "Q2",
petrol: 300,
diesel: 130,
},
{
quarter: "Q3",
petrol: 350,
diesel: 160,
},
{
quarter: "Q4",
petrol: 400,
diesel: 200,
},
],
series: [
{
type: "line",
xKey: "quarter",
yKey: "petrol",
},
{
type: "line",
xKey: "quarter",
yKey: "diesel",
},
],
legend: {
listeners: {
legendItemClick: (event: AgChartLegendClickEvent) => {
counter = (counter + 1) % 2;
document.getElementById("myCounter")!.textContent = `${counter}`;
if (counter !== 1) {
event.preventDefault();
}
},
},
},
listeners: {
seriesVisibilityChange: (event) => {
console.log("[series visibility change]", event);
},
},
};
options.container = document.getElementById("myChart");
const chart = AgCharts.create(options);
{
legend: {
listeners: {
legendItemClick: (event) => {
counter = (counter + 1) % 2;
if (counter !== 1) {
event.preventDefault();
}
},
},
},
}In this example:
- When a legend item is clicked, the visibility change is prevented and a counter decreases instead, by calling
preventDefaulton thelegendItemClickevent. - When the counter hits zero, the toggle is allowed to occur and the seriesVisibilityChange event fires.
Item Identifiers Copy Link
Many events expose an itemId to identify the item within its series. How it is derived depends on the item type:
- Series nodes use a node identifier.
- Automatically generated from the data, and may change when the data updates.
- Set
dataIdKeyto use adatumfield as a stable identifier across data updates (see Identifying Items by Key). - Series whose nodes don't map directly to a datum - such as Histogram bins and Sankey or Chord nodes - expose a
getItemIdcallback instead. - Waterfall
totalandsubtotalbars use theirtotals.itemIdif set, otherwise theirtotals.axisLabel.
- Legend items use the legend item's identifier. Typically the
yKeyvalue for most series, or the legend item's position for series with one legend item per datum, such aspieanddonut.
API Reference Copy Link
All series event options have similar interface contracts. See the series-specific documentation for variations.
Properties available on the AgSeriesListeners interface.
- seriesNodeClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in the series is clicked.
- seriesNodeDoubleClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in the series is double-clicked.
Properties available on the AgSeriesListeners interface.
- seriesNodeClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in the series is clicked.
- seriesNodeDoubleClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in the series is double-clicked.
Properties available on the AgBaseSeriesOptions interface.
- nodeClickRange
InteractionRange - Range from a node that a click triggers the listener.
Properties available on the AgBaseSeriesOptions interface.
- nodeClickRange
InteractionRange - Range from a node that a click triggers the listener.
Properties available on the AgChartLegendListeners interface.
- legendItemClick
Function - The listener to call when a legend item is clicked.
- legendItemDoubleClick
Function - The listener to call when a legend item is double-clicked.
Properties available on the AgChartLegendListeners interface.
- legendItemClick
Function - The listener to call when a legend item is clicked.
- legendItemDoubleClick
Function - The listener to call when a legend item is double-clicked.
Axis listeners. Cross Line listeners are Cartesian charts only.
- click
Listener - The listener to call when the axis is clicked.
- doubleClick
Listener - The listener to call when the axis is double-clicked.
Axis listeners. Cross Line listeners are Cartesian charts only.
- click
Listener - The listener to call when the axis is clicked.
- doubleClick
Listener - The listener to call when the axis is double-clicked.
Cross Line listeners can also be set on the axis that owns the Cross Line.
Cross Line listeners. Cartesian charts only.
- click
Listener - The listener to call when the Cross Line is clicked.
- doubleClick
Listener - The listener to call when the Cross Line is double-clicked.
Cross Line listeners. Cartesian charts only.
- click
Listener - The listener to call when the Cross Line is clicked.
- doubleClick
Listener - The listener to call when the Cross Line is double-clicked.
Axis listeners. Cross Line listeners are Cartesian charts only.
- crossLineClick
Listener - The listener to call when a Cross Line on this axis is clicked.
- crossLineDoubleClick
Listener - The listener to call when a Cross Line on this axis is double-clicked.
Axis listeners. Cross Line listeners are Cartesian charts only.
- crossLineClick
Listener - The listener to call when a Cross Line on this axis is clicked.
- crossLineDoubleClick
Listener - The listener to call when a Cross Line on this axis is double-clicked.
Caption listeners can be set on the chart's title, subtitle and footnote.
Properties available on the AgCaptionListeners interface.
- click
Listener - The listener to call when the caption is clicked.
- doubleClick
Listener - The listener to call when the caption is double-clicked.
Properties available on the AgCaptionListeners interface.
- click
Listener - The listener to call when the caption is clicked.
- doubleClick
Listener - The listener to call when the caption is double-clicked.
Properties available on the AgBaseChartListeners interface.
- captionClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is clicked.
- captionDoubleClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is double-clicked.
Properties available on the AgBaseChartListeners interface.
- captionClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is clicked.
- captionDoubleClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is double-clicked.
Properties available on the AgBaseChartListeners interface.
- seriesNodeClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in any series is clicked. Useful for a chart containing multiple series.
- seriesNodeDoubleClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in any series is double-clicked. Useful for a chart containing multiple series.
- axisClick
Listener - The listener to call when any axis in the chart is clicked. Useful for a chart containing multiple axes.
- axisDoubleClick
Listener - The listener to call when any axis in the chart is double-clicked. Useful for a chart containing multiple axes.
- captionClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is clicked.
- captionDoubleClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is double-clicked.
- seriesVisibilityChange
Listener - The listener to call when a series visibility is changed.
- activeChange
Listener - The listener to call when the active state (highlight/tooltip) is changed.
- selectionChange
Listener - The listener to call when data selection is changed
- collapsedChange
Listener - The listener to call when collapsed items are changed.
- click
Listener - The listener to call when the chart is clicked.
- doubleClick
Listener - The listener to call when the chart is double-clicked.
- crossLineClick
Listener - The listener to call when a Cross Line on any axis is clicked.
- crossLineDoubleClick
Listener - The listener to call when a Cross Line on any axis is double-clicked.
- annotations
Listener - The listener to call when the annotations are changed.
- zoom
Listener - The listener to call when the zoom is changed.
Properties available on the AgBaseChartListeners interface.
- seriesNodeClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in any series is clicked. Useful for a chart containing multiple series.
- seriesNodeDoubleClick
Listener - The listener to call when a node (marker, column, bar, tile or a pie sector) in any series is double-clicked. Useful for a chart containing multiple series.
- axisClick
Listener - The listener to call when any axis in the chart is clicked. Useful for a chart containing multiple axes.
- axisDoubleClick
Listener - The listener to call when any axis in the chart is double-clicked. Useful for a chart containing multiple axes.
- captionClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is clicked.
- captionDoubleClick
Listener - The listener to call when any caption (title, subtitle or footnote) in the chart is double-clicked.
- seriesVisibilityChange
Listener - The listener to call when a series visibility is changed.
- activeChange
Listener - The listener to call when the active state (highlight/tooltip) is changed.
- selectionChange
Listener - The listener to call when data selection is changed
- collapsedChange
Listener - The listener to call when collapsed items are changed.
- click
Listener - The listener to call when the chart is clicked.
- doubleClick
Listener - The listener to call when the chart is double-clicked.
- crossLineClick
Listener - The listener to call when a Cross Line on any axis is clicked.
- crossLineDoubleClick
Listener - The listener to call when a Cross Line on any axis is double-clicked.
- annotations
Listener - The listener to call when the annotations are changed.
- zoom
Listener - The listener to call when the zoom is changed.