Skip to content
🚀 Rapid Application Development with the App Builder

Custom Events

This experimental feature allows users to add interactivity to a chart app.

The custom events section supports three Google Charts events: select, ready, and error. Custom events must be provided as JavaScript code.

WP Data Access - Chart Custom Events

Starter Template

View the hint and click the link below the editor to write the starter template to your editor.

js
return [
	{
		eventName: "select",
		callback() {
			console.log("Selected", chartWrapper?.getChart()?.getSelection())
		},
	},
	{
		eventName: "ready",
		callback() {
			console.log("Chart ready", chartWrapper?.getChart())
		},
	},
	{
		eventName: "error",
		callback(args) {
			console.log("Chart error", args)
		},
	},
]