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 Dojo Charts in our application


Our census application from previous chapters could use some visual appeal when it comes to presenting data. We'll make our first attempt at adding charts and graphs using the dojox/charting library. We'll apply the graphs to the map popup whenever the user clicks on a census block group, county, or state. The census blocks don't have enough information for us to graph.

Loading the modules

Since our graphs are currently limited to our census application, we need to update the modules in our custom y2k/Census module definition:

  1. We'll start by adding dojo/on to handle the map popup events.

  2. We'll add the default chart object along with a pie chart and a bar chart module.

  3. We'll add the PrimaryColors theme and SimpleTheme to create our own custom color template.

  4. Finally, we'll add a highlight and a tooltip action to let the user read the results when they hover over parts of the graphs.

  5. It should look a bit like the following:

    define([…
      "dojo/on",
      "dojox/charting...