O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Attaching events to chart components

It's possible to listen out for events on charts allowing users to interact with the data being presented. This includes interactions, such as clicking on charts' series (bars, lines, and so on) and hovering over specific areas of a graph.

By adding support for these types of interactions to your charts you will enhance the user experience and allow more in-depth data to be revealed when it's needed.

This example will demonstrate how to listen for various mouse events, such as clicking and hovering.

Getting ready

This recipe requires the use of a web server for serving the charts data. A JSON file is provided with example data.

How to do it...

  1. Start by defining a model for the data we are loading into the chart: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required