4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-chart-theme-Base'>/**
19 </span> * @class Ext.chart.theme.Base
20 * Provides default colors for non-specified things. Should be sub-classed when creating new themes.
23 Ext.define('Ext.chart.theme.Base', {
25 /* Begin Definitions */
27 requires: ['Ext.chart.theme.Theme'],
31 constructor: function(config) {
32 Ext.chart.theme.call(this, config, {
40 font: '12px Arial, Helvetica, sans-serif',
43 renderer: function(v) { return v; }
47 font: '12px Arial, Helvetica, sans-serif',
50 renderer: function(v) { return v; }
54 font: '12px Arial, Helvetica, sans-serif',
57 renderer: function(v) { return v; }
61 font: '12px Arial, Helvetica, sans-serif',
64 renderer: function(v) { return v; }
67 font: 'bold 18px Arial',
71 font: 'bold 18px Arial',
79 font: 'bold 18px Arial',
83 font: 'bold 18px Arial',
103 colors: [ "#94ae0a", "#115fa6","#a61120", "#ff8809", "#ffd13e", "#a61187", "#24ad9a", "#7c7474", "#a66111"],
105 fill: "#115fa6"
107 fill: "#94ae0a"
109 fill: "#a61120"
111 fill: "#ff8809"
113 fill: "#ffd13e"
115 fill: "#a61187"
117 fill: "#24ad9a"
119 fill: "#7c7474"
121 fill: "#a66111"
124 fill: "#115fa6",
127 fill: "#94ae0a",
130 fill: "#a61120",
136 var palette = ['#b1da5a', '#4ce0e7', '#e84b67', '#da5abd', '#4d7fe6', '#fec935'],
137 names = ['Green', 'Sky', 'Red', 'Purple', 'Blue', 'Yellow'],
138 i = 0, j = 0, l = palette.length, themes = Ext.chart.theme,
139 categories = [['#f0a50a', '#c20024', '#2044ba', '#810065', '#7eae29'],
140 ['#6d9824', '#87146e', '#2a9196', '#d39006', '#1e40ac'],
141 ['#fbbc29', '#ce2e4e', '#7e0062', '#158b90', '#57880e'],
142 ['#ef5773', '#fcbd2a', '#4f770d', '#1d3eaa', '#9b001f'],
143 ['#7eae29', '#fdbe2a', '#910019', '#27b4bc', '#d74dbc'],
144 ['#44dce1', '#0b2592', '#996e05', '#7fb325', '#b821a1']],
145 cats = categories.length;
147 //Create themes from base colors
148 for (; i < l; i++) {
149 themes[names[i]] = (function(color) {
150 return Ext.extend(themes.Base, {
151 constructor: function(config) {
152 themes.Base.prototype.constructor.call(this, Ext.apply({
160 //Create theme from color array
161 for (i = 0; i < cats; i++) {
162 themes['Category' + (i + 1)] = (function(category) {
163 return Ext.extend(themes.Base, {
164 constructor: function(config) {
165 themes.Base.prototype.constructor.call(this, Ext.apply({