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

Customizing labels, colors, and axes

With little configuration it is possible to customize the look and feel of your chart. This recipe will demonstrate how easy it is to apply different themes, tweak colors, add grid lines, and ensure that your axes are presented neatly for a bar chart.

Customizing labels, colors, and axes

Getting ready

A web server is required for this recipe so the sample JSON data can be loaded. This is supplied in separate JSON file.

How to do it...

  1. Start by defining a model to define the data we are loading:
    Ext.define('Chart', {
        extend: 'Ext.data.Model',
        fields: [{
            name: 'name',
            type: 'string'
        }, {
            name: 'value',
            type: 'int'
        }]
    });
  2. Create a store with an AJAX ...

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