3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * @class Ext.chart.theme.Base
17 * Provides default colors for non-specified things. Should be sub-classed when creating new themes.
20 Ext.define('Ext.chart.theme.Base', {
22 /* Begin Definitions */
24 requires: ['Ext.chart.theme.Theme'],
28 constructor: function(config) {
29 Ext.chart.theme.call(this, config, {
37 font: '12px Arial, Helvetica, sans-serif',
40 renderer: function(v) { return v; }
44 font: '12px Arial, Helvetica, sans-serif',
47 renderer: function(v) { return v; }
51 font: '12px Arial, Helvetica, sans-serif',
54 renderer: function(v) { return v; }
58 font: '12px Arial, Helvetica, sans-serif',
61 renderer: function(v) { return v; }
64 font: 'bold 18px Arial',
68 font: 'bold 18px Arial',
76 font: 'bold 18px Arial',
80 font: 'bold 18px Arial',
100 colors: [ "#94ae0a", "#115fa6","#a61120", "#ff8809", "#ffd13e", "#a61187", "#24ad9a", "#7c7474", "#a66111"],
133 var palette = ['#b1da5a', '#4ce0e7', '#e84b67', '#da5abd', '#4d7fe6', '#fec935'],
134 names = ['Green', 'Sky', 'Red', 'Purple', 'Blue', 'Yellow'],
135 i = 0, j = 0, l = palette.length, themes = Ext.chart.theme,
136 categories = [['#f0a50a', '#c20024', '#2044ba', '#810065', '#7eae29'],
137 ['#6d9824', '#87146e', '#2a9196', '#d39006', '#1e40ac'],
138 ['#fbbc29', '#ce2e4e', '#7e0062', '#158b90', '#57880e'],
139 ['#ef5773', '#fcbd2a', '#4f770d', '#1d3eaa', '#9b001f'],
140 ['#7eae29', '#fdbe2a', '#910019', '#27b4bc', '#d74dbc'],
141 ['#44dce1', '#0b2592', '#996e05', '#7fb325', '#b821a1']],
142 cats = categories.length;
144 //Create themes from base colors
146 themes[names[i]] = (function(color) {
147 return Ext.extend(themes.Base, {
148 constructor: function(config) {
149 themes.Base.prototype.constructor.call(this, Ext.apply({
157 //Create theme from color array
158 for (i = 0; i < cats; i++) {
159 themes['Category' + (i + 1)] = (function(category) {
160 return Ext.extend(themes.Base, {
161 constructor: function(config) {
162 themes.Base.prototype.constructor.call(this, Ext.apply({