Base2.html
6.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-chart-theme-Base'>/**
</span> * Provides default colors for non-specified things. Should be sub-classed when creating new themes.
* @private
*/
Ext.define('Ext.chart.theme.Base', {
/* Begin Definitions */
requires: ['Ext.chart.theme.Theme'],
/* End Definitions */
constructor: function(config) {
Ext.chart.theme.call(this, config, {
background: false,
axis: {
stroke: '#444',
'stroke-width': 1
},
axisLabelTop: {
fill: '#444',
font: '12px Arial, Helvetica, sans-serif',
spacing: 2,
padding: 5,
renderer: function(v) { return v; }
},
axisLabelRight: {
fill: '#444',
font: '12px Arial, Helvetica, sans-serif',
spacing: 2,
padding: 5,
renderer: function(v) { return v; }
},
axisLabelBottom: {
fill: '#444',
font: '12px Arial, Helvetica, sans-serif',
spacing: 2,
padding: 5,
renderer: function(v) { return v; }
},
axisLabelLeft: {
fill: '#444',
font: '12px Arial, Helvetica, sans-serif',
spacing: 2,
padding: 5,
renderer: function(v) { return v; }
},
axisTitleTop: {
font: 'bold 18px Arial',
fill: '#444'
},
axisTitleRight: {
font: 'bold 18px Arial',
fill: '#444',
rotate: {
x:0, y:0,
degrees: 270
}
},
axisTitleBottom: {
font: 'bold 18px Arial',
fill: '#444'
},
axisTitleLeft: {
font: 'bold 18px Arial',
fill: '#444',
rotate: {
x:0, y:0,
degrees: 270
}
},
series: {
'stroke-width': 0
},
seriesLabel: {
font: '12px Arial',
fill: '#333'
},
marker: {
stroke: '#555',
radius: 3,
size: 3
},
colors: [ "#94ae0a", "#115fa6","#a61120", "#ff8809", "#ffd13e", "#a61187", "#24ad9a", "#7c7474", "#a66111"],
seriesThemes: [{
fill: "#115fa6"
}, {
fill: "#94ae0a"
}, {
fill: "#a61120"
}, {
fill: "#ff8809"
}, {
fill: "#ffd13e"
}, {
fill: "#a61187"
}, {
fill: "#24ad9a"
}, {
fill: "#7c7474"
}, {
fill: "#115fa6"
}, {
fill: "#94ae0a"
}, {
fill: "#a61120"
}, {
fill: "#ff8809"
}, {
fill: "#ffd13e"
}, {
fill: "#a61187"
}, {
fill: "#24ad9a"
}, {
fill: "#7c7474"
}, {
fill: "#a66111"
}],
markerThemes: [{
fill: "#115fa6",
type: 'circle'
}, {
fill: "#94ae0a",
type: 'cross'
}, {
fill: "#115fa6",
type: 'plus'
}, {
fill: "#94ae0a",
type: 'circle'
}, {
fill: "#a61120",
type: 'cross'
}]
});
}
}, function() {
var palette = ['#b1da5a', '#4ce0e7', '#e84b67', '#da5abd', '#4d7fe6', '#fec935'],
names = ['Green', 'Sky', 'Red', 'Purple', 'Blue', 'Yellow'],
i = 0, j = 0, l = palette.length, themes = Ext.chart.theme,
categories = [['#f0a50a', '#c20024', '#2044ba', '#810065', '#7eae29'],
['#6d9824', '#87146e', '#2a9196', '#d39006', '#1e40ac'],
['#fbbc29', '#ce2e4e', '#7e0062', '#158b90', '#57880e'],
['#ef5773', '#fcbd2a', '#4f770d', '#1d3eaa', '#9b001f'],
['#7eae29', '#fdbe2a', '#910019', '#27b4bc', '#d74dbc'],
['#44dce1', '#0b2592', '#996e05', '#7fb325', '#b821a1']],
cats = categories.length;
//Create themes from base colors
for (; i < l; i++) {
themes[names[i]] = (function(color) {
return Ext.extend(themes.Base, {
constructor: function(config) {
themes.Base.prototype.constructor.call(this, Ext.apply({
baseColor: color
}, config));
}
});
}(palette[i]));
}
//Create theme from color array
for (i = 0; i < cats; i++) {
themes['Category' + (i + 1)] = (function(category) {
return Ext.extend(themes.Base, {
constructor: function(config) {
themes.Base.prototype.constructor.call(this, Ext.apply({
colors: category
}, config));
}
});
}(categories[i]));
}
});
</pre>
</body>
</html>