Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Sencha Charts Essentials

You're reading from   Sencha Charts Essentials Create stunning charts and visualizations for both web and mobile applications

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781785289767
Length 214 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ajit Kumar Ajit Kumar
Author Profile Icon Ajit Kumar
Ajit Kumar
Arrow right icon
View More author details
Toc

Theming using a custom theme


A chart provides a theme config, which can be used to associate a chart theme to it. A chart theme is a subclass of the Ext.chart.theme.Base class. The framework offers various subclasses, which can be used to style our chart. These classes are located under the ext/packages/sencha-charts/src/chart/theme folder.

For example, we can use the PurpleGradients class and configure theme on the cartesian and pie chart with an alias name—purple-gradients:

theme: 'purple-gradients'

The theme produces the following results:

Similarly, we can try other existing themes to see which one suits our requirements.

However, none of them are close to our need, as before we had a custom background image and a series rendered in different colors. Also, the labels need to be styled differently for the axes. So, we have to define our own custom theme. Here is definition of our custom theme, awesome:

Ext.define('SCE.view.chart.theme.Awesome', {
    extend: 'Ext.chart.theme.Base',
    singleton...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image