Enhancing our application with charts
The examples covered so far were in traditional code (basic examples using the Ext JS framework directly), but what happens when we want to embed the charts in an MVC or MVVM app? Well! First of all, we need to add a reference to the proper code package that we want to use:
So, let's begin by opening the
app.json
file (the application code used in chapters 10, 11, and 12) and locating this code:"requires": [ ],
For use in Ext JS charting, let's change it to this:
"requires": [ "sencha-charts" ],
Or for legacy charts (Ext JS 4), change to:
"requires": [ "ext-charts" ],
After this change, save the file. Now, let's use the Sencha CMD tool. Open the CMD tool and type this:
sencha app build
By using this command, we ensure that our code as well as Ext JS and the Chart package are included in our application. So, after the build ends, let's monitor the changes in our application using this line:
sencha app watch
This procedure will make sure that the desired package...