O'Reilly logo

Ext JS 4 First Look by Loiane Groner

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 a Chart

The Ext.chart package contains a package called theme. Inside this package, we will find there are two classes: Ext.chart.theme.Base and Ext.chart.theme.Theme .

The Theme class is a base class for creating a custom theme in Ext JS 4.

Let's try to create a theme based on blue colors. To do it, we will set base color and use it at the axis and we will declare an array of bluish colors to be used by the series:

Ext.define('Ext.chart.theme.Blue', { extend: 'Ext.chart.theme.Base', baseColor: '#000099', colors: ['#3399FF', '#0066CC', '#003366'], constructor: function(config) { this.callParent([Ext.apply({ axis: { fill: this.baseColor, stroke: this.baseColor }, axisLabelLeft: { fill: this.baseColor }, axisLabelBottom: { fill: this.baseColor ...

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