Book Image

Mastering ArcGIS Server Development with JavaScript

By : Raymond Kenneth Doman
Book Image

Mastering ArcGIS Server Development with JavaScript

By: Raymond Kenneth Doman

Overview of this book

Table of Contents (18 chapters)
Mastering ArcGIS Server Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using Dojox Charts in popups


Combining the dojox/charting modules with the ArcGIS API for JavaScript provides many ways to display data. One way to deliver feature data through charts is through the map's infoWindow. The infoWindow uses an HTML template for its content, and that can provide the hooks we need to attach our graphs.

One issue when adding graphs to the infoWindow is determining when to draw the graph. Thankfully, there's an event for that. The map's infoWindow fires a selection-changed event whenever the selected feature graphic is changed, either by clicking on another graphic, or by clicking on the next and previous buttons. We can assign an event listener to that event, look at the selected graphic and, if it has the data we need, we can draw the graphs.