agcOnSelect

Overview

The agcOnSelect directive requires the googleChart directive to be declared on the same element. It allows you to bind an expression to the ChartWrapper instance's 'select' event. The expression will have some useful local variables available when it is called.

Check out the Google Charts API Documentation for more information on the 'select' event.
See the Hide Series Example for a practical sample of how to use this directive.

Code Example

<div google-chart chart="myChartObject" agc-on-select="selectHandler(selectedItem)"></div>

Available Locals

Name Description
chart The chart instance belonging to the associated googeChart directive. This is the instance of specific chart type (ie. BarChart, LineChart, etc.) This can be used to drop down to the Google Charts API level and program directly against the chart object.
chartWrapper The instance of ChartWrapper belonging to the associated googeChart directive. Can be used to drop down to the Google Charts API level and program directly against the ChartWrapper and chart objects.
selectedItem A single object with row and column properties representing the selected DataTable entry. If the user has selected multiple data points, only the first will appear in the variable. To capture a multi-select, use selectedItems. A null value for the row means that the legend was selected (on most charts).
selectedItems An Array of objects with row and column keys representing the selected DataTable entries. A null value for the row means that the legend was selected (on most charts).