echarts 4.4.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/.github/ISSUE_TEMPLATE.md +1 -1
  2. package/.github/workflows/nodejs.yml +31 -0
  3. package/CONTRIBUTING.md +2 -2
  4. package/README.md +6 -12
  5. package/dist/echarts-en.common.js +2354 -1029
  6. package/dist/echarts-en.common.min.js +1 -1
  7. package/dist/echarts-en.js +2727 -1138
  8. package/dist/echarts-en.js.map +1 -1
  9. package/dist/echarts-en.min.js +1 -1
  10. package/dist/echarts-en.simple.js +2028 -759
  11. package/dist/echarts-en.simple.min.js +1 -1
  12. package/dist/echarts.common.js +2354 -1029
  13. package/dist/echarts.common.min.js +1 -1
  14. package/dist/echarts.js +2727 -1138
  15. package/dist/echarts.js.map +1 -1
  16. package/dist/echarts.min.js +1 -1
  17. package/dist/echarts.simple.js +2028 -759
  18. package/dist/echarts.simple.min.js +1 -1
  19. package/dist/extension/dataTool.js +9 -0
  20. package/dist/extension/dataTool.js.map +1 -1
  21. package/echarts.all.js +1 -1
  22. package/lib/chart/bar/BarSeries.js +4 -1
  23. package/lib/chart/bar/BarView.js +20 -6
  24. package/lib/chart/bar/BaseBarSeries.js +5 -1
  25. package/lib/chart/candlestick/CandlestickSeries.js +1 -0
  26. package/lib/chart/candlestick/CandlestickView.js +42 -1
  27. package/lib/chart/custom.js +1 -0
  28. package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
  29. package/lib/chart/funnel/FunnelSeries.js +15 -5
  30. package/lib/chart/gauge/GaugeSeries.js +0 -9
  31. package/lib/chart/graph/GraphSeries.js +11 -4
  32. package/lib/chart/graph/GraphView.js +28 -8
  33. package/lib/chart/graph/forceHelper.js +8 -2
  34. package/lib/chart/graph/forceLayout.js +5 -2
  35. package/lib/chart/heatmap/HeatmapView.js +4 -4
  36. package/lib/chart/helper/Symbol.js +8 -0
  37. package/lib/chart/helper/createListFromArray.js +14 -8
  38. package/lib/chart/helper/whiskerBoxCommon.js +22 -16
  39. package/lib/chart/line/LineSeries.js +3 -1
  40. package/lib/chart/line/LineView.js +8 -2
  41. package/lib/chart/map/MapSeries.js +8 -1
  42. package/lib/chart/pie/PieSeries.js +27 -6
  43. package/lib/chart/pie/PieView.js +1 -1
  44. package/lib/chart/pie/labelLayout.js +102 -19
  45. package/lib/chart/pie/pieLayout.js +19 -7
  46. package/lib/chart/radar/RadarSeries.js +3 -3
  47. package/lib/chart/sankey/SankeyView.js +28 -9
  48. package/lib/chart/scatter/ScatterSeries.js +3 -1
  49. package/lib/chart/themeRiver/ThemeRiverSeries.js +3 -3
  50. package/lib/chart/tree/TreeSeries.js +15 -1
  51. package/lib/chart/tree/TreeView.js +4 -2
  52. package/lib/component/axis/AngleAxisView.js +97 -20
  53. package/lib/component/axis/AxisBuilder.js +63 -24
  54. package/lib/component/axis/CartesianAxisView.js +55 -11
  55. package/lib/component/axis/RadiusAxisView.js +36 -4
  56. package/lib/component/brush/BrushView.js +6 -0
  57. package/lib/component/brush/brushAction.js +5 -0
  58. package/lib/component/dataZoom/DataZoomModel.js +15 -1
  59. package/lib/component/dataZoom/SliderZoomView.js +4 -10
  60. package/lib/component/helper/BrushController.js +43 -25
  61. package/lib/component/legend/LegendModel.js +3 -3
  62. package/lib/component/legend/LegendView.js +17 -13
  63. package/lib/component/toolbox/ToolboxView.js +16 -7
  64. package/lib/component/toolbox/feature/MagicType.js +19 -14
  65. package/lib/coord/Axis.js +44 -12
  66. package/lib/coord/axisDefault.js +21 -2
  67. package/lib/coord/axisTickLabelBuilder.js +9 -1
  68. package/lib/coord/cartesian/Cartesian2D.js +0 -15
  69. package/lib/coord/geo/geoJSONLoader.js +1 -1
  70. package/lib/coord/polar/polarCreator.js +11 -2
  71. package/lib/coord/radar/Radar.js +3 -1
  72. package/lib/coord/radar/RadarModel.js +4 -1
  73. package/lib/data/DataDiffer.js +2 -4
  74. package/lib/data/DataDimensionInfo.js +157 -0
  75. package/lib/data/List.js +29 -23
  76. package/lib/data/Tree.js +2 -1
  77. package/lib/data/helper/completeDimensions.js +43 -32
  78. package/lib/data/helper/createDimensions.js +2 -0
  79. package/lib/data/helper/sourceHelper.js +214 -114
  80. package/lib/echarts.js +2 -2
  81. package/lib/layout/barGrid.js +136 -11
  82. package/lib/layout/barPolar.js +2 -2
  83. package/lib/model/Global.js +1 -1
  84. package/lib/model/Series.js +3 -3
  85. package/lib/model/referHelper.js +40 -12
  86. package/lib/scale/Interval.js +87 -2
  87. package/lib/scale/Log.js +9 -2
  88. package/lib/scale/helper.js +1 -43
  89. package/lib/theme/dark.js +3 -0
  90. package/lib/util/graphic.js +1 -2
  91. package/lib/util/number.js +25 -1
  92. package/lib/util/shape/sausage.js +93 -0
  93. package/lib/visual/LegendVisualProvider.js +75 -0
  94. package/lib/visual/dataColor.js +2 -12
  95. package/lib/visual/seriesColor.js +15 -7
  96. package/map/js/china.js +2 -2
  97. package/map/json/china.json +1 -1
  98. package/map/json/province/tianjin.json +1 -1
  99. package/package.json +3 -2
  100. package/src/chart/bar/BarSeries.js +5 -1
  101. package/src/chart/bar/BarView.js +24 -8
  102. package/src/chart/bar/BaseBarSeries.js +5 -1
  103. package/src/chart/candlestick/CandlestickSeries.js +2 -0
  104. package/src/chart/candlestick/CandlestickView.js +44 -1
  105. package/src/chart/custom.js +1 -0
  106. package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
  107. package/src/chart/funnel/FunnelSeries.js +11 -4
  108. package/src/chart/gauge/GaugeSeries.js +0 -6
  109. package/src/chart/graph/GraphSeries.js +10 -3
  110. package/src/chart/graph/GraphView.js +26 -8
  111. package/src/chart/graph/forceHelper.js +7 -3
  112. package/src/chart/graph/forceLayout.js +6 -3
  113. package/src/chart/heatmap/HeatmapView.js +4 -4
  114. package/src/chart/helper/Symbol.js +9 -0
  115. package/src/chart/helper/createClipPathFromCoordSys.js +5 -1
  116. package/src/chart/helper/createGraphFromNodeEdge.js +1 -1
  117. package/src/chart/helper/createListFromArray.js +13 -8
  118. package/src/chart/helper/whiskerBoxCommon.js +21 -16
  119. package/src/chart/line/LineSeries.js +1 -1
  120. package/src/chart/line/LineView.js +6 -1
  121. package/src/chart/map/MapSeries.js +5 -1
  122. package/src/chart/pie/PieSeries.js +26 -5
  123. package/src/chart/pie/PieView.js +1 -1
  124. package/src/chart/pie/labelLayout.js +114 -22
  125. package/src/chart/pie/pieLayout.js +20 -7
  126. package/src/chart/radar/RadarSeries.js +5 -3
  127. package/src/chart/sankey/SankeyView.js +26 -9
  128. package/src/chart/scatter/ScatterSeries.js +1 -1
  129. package/src/chart/themeRiver/ThemeRiverSeries.js +4 -3
  130. package/src/chart/tree/TreeSeries.js +12 -1
  131. package/src/chart/tree/TreeView.js +5 -2
  132. package/src/component/axis/AngleAxisView.js +106 -19
  133. package/src/component/axis/AxisBuilder.js +78 -33
  134. package/src/component/axis/CartesianAxisView.js +58 -11
  135. package/src/component/axis/RadiusAxisView.js +37 -4
  136. package/src/component/brush/BrushView.js +6 -0
  137. package/src/component/brush/brushAction.js +6 -1
  138. package/src/component/dataZoom/DataZoomModel.js +15 -1
  139. package/src/component/dataZoom/SliderZoomView.js +4 -9
  140. package/src/component/helper/BrushController.js +50 -28
  141. package/src/component/legend/LegendModel.js +3 -3
  142. package/src/component/legend/LegendView.js +18 -12
  143. package/src/component/toolbox/ToolboxView.js +18 -5
  144. package/src/component/toolbox/feature/MagicType.js +18 -13
  145. package/src/coord/Axis.js +48 -13
  146. package/src/coord/axisDefault.js +25 -1
  147. package/src/coord/axisTickLabelBuilder.js +10 -0
  148. package/src/coord/cartesian/Cartesian2D.js +0 -13
  149. package/src/coord/geo/geoJSONLoader.js +2 -2
  150. package/src/coord/polar/polarCreator.js +16 -3
  151. package/src/coord/radar/Radar.js +3 -1
  152. package/src/coord/radar/RadarModel.js +5 -2
  153. package/src/data/DataDiffer.js +1 -4
  154. package/src/data/DataDimensionInfo.js +135 -0
  155. package/src/data/Graph.js +1 -1
  156. package/src/data/List.js +33 -20
  157. package/src/data/Tree.js +3 -1
  158. package/src/data/helper/completeDimensions.js +49 -30
  159. package/src/data/helper/createDimensions.js +2 -0
  160. package/src/data/helper/sourceHelper.js +216 -124
  161. package/src/echarts.js +2 -2
  162. package/src/layout/barGrid.js +136 -13
  163. package/src/layout/barPolar.js +3 -2
  164. package/src/model/Global.js +1 -1
  165. package/src/model/Series.js +3 -3
  166. package/src/model/referHelper.js +34 -11
  167. package/src/scale/Interval.js +84 -4
  168. package/src/scale/Log.js +9 -2
  169. package/src/scale/helper.js +1 -39
  170. package/src/theme/dark.js +3 -0
  171. package/src/util/graphic.js +1 -2
  172. package/src/util/number.js +22 -2
  173. package/src/util/shape/sausage.js +93 -0
  174. package/src/visual/LegendVisualProvider.js +55 -0
  175. package/src/visual/dataColor.js +0 -13
  176. package/src/visual/seriesColor.js +13 -7
  177. package/theme/azul.js +163 -0
  178. package/theme/bee-inspired.js +178 -0
  179. package/theme/blue.js +178 -0
  180. package/theme/caravan.js +178 -0
  181. package/theme/carp.js +163 -0
  182. package/theme/cool.js +180 -0
  183. package/theme/dark-blue.js +168 -0
  184. package/theme/dark-bold.js +168 -0
  185. package/theme/dark-digerati.js +168 -0
  186. package/theme/dark-fresh-cut.js +168 -0
  187. package/theme/dark-mushroom.js +168 -0
  188. package/theme/dark.js +69 -62
  189. package/theme/eduardo.js +178 -0
  190. package/theme/forest.js +163 -0
  191. package/theme/fresh-cut.js +163 -0
  192. package/theme/fruit.js +178 -0
  193. package/theme/gray.js +220 -0
  194. package/theme/green.js +222 -0
  195. package/theme/helianthus.js +263 -0
  196. package/theme/infographic.js +72 -57
  197. package/theme/inspired.js +163 -0
  198. package/theme/jazz.js +163 -0
  199. package/theme/london.js +163 -0
  200. package/theme/macarons.js +80 -57
  201. package/theme/macarons2.js +251 -0
  202. package/theme/mint.js +155 -0
  203. package/theme/red-velvet.js +163 -0
  204. package/theme/red.js +225 -0
  205. package/theme/roma.js +55 -22
  206. package/theme/royal.js +163 -0
  207. package/theme/sakura.js +140 -0
  208. package/theme/shine.js +52 -45
  209. package/theme/tech-blue.js +180 -0
  210. package/theme/vintage.js +37 -23
  211. package/.travis.yml +0 -16
@@ -0,0 +1,178 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+
45
+ var colorPalette = [
46
+ '#fad089',
47
+ '#ff9c5b',
48
+ '#f5634a',
49
+ '#ed303c',
50
+ '#3b8183',
51
+ '#f7826e',
52
+ '#faac9e',
53
+ '#fcd5cf'
54
+ ];
55
+
56
+ var theme = {
57
+ color: colorPalette,
58
+
59
+ title: {
60
+ textStyle: {
61
+ fontWeight: 'normal',
62
+ color: '#fad089'
63
+ }
64
+ },
65
+
66
+ visualMap: {
67
+ color: ['#fad089', '#a2d4e6']
68
+ },
69
+
70
+ toolbox: {
71
+ color: ['#fad089', '#fad089', '#fad089', '#fad089']
72
+ },
73
+
74
+ tooltip: {
75
+ backgroundColor: 'rgba(0,0,0,0.5)',
76
+ axisPointer: {
77
+ // Axis indicator, coordinate trigger effective
78
+ type: 'line', // The default is a straight line: 'line' | 'shadow'
79
+ lineStyle: {
80
+ // Straight line indicator style settings
81
+ color: '#fad089',
82
+ type: 'dashed'
83
+ },
84
+ crossStyle: {
85
+ color: '#fad089'
86
+ },
87
+ shadowStyle: {
88
+ // Shadow indicator style settings
89
+ color: 'rgba(200,200,200,0.3)'
90
+ }
91
+ }
92
+ },
93
+
94
+ // Area scaling controller
95
+ dataZoom: {
96
+ dataBackgroundColor: '#eee', // Data background color
97
+ fillerColor: 'rgba(144,197,237,0.2)', // Fill the color
98
+ handleColor: '#fad089' // Handle color
99
+ },
100
+
101
+ timeline: {
102
+ lineStyle: {
103
+ color: '#fad089'
104
+ },
105
+ controlStyle: {
106
+ color: '#fad089',
107
+ borderColor: '#fad089'
108
+ }
109
+ },
110
+
111
+ candlestick: {
112
+ itemStyle: {
113
+ color: '#ff9c5b',
114
+ color0: '#f5634a'
115
+ },
116
+ lineStyle: {
117
+ width: 1,
118
+ color: '#3b8183',
119
+ color0: '#ed303c'
120
+ },
121
+ areaStyle: {
122
+ color: '#fad089',
123
+ color0: '#ed303c'
124
+ }
125
+ },
126
+
127
+ chord: {
128
+ padding: 4,
129
+ itemStyle: {
130
+ color: '#fad089',
131
+ borderWidth: 1,
132
+ borderColor: 'rgba(128, 128, 128, 0.5)'
133
+ },
134
+ lineStyle: {
135
+ color: 'rgba(128, 128, 128, 0.5)'
136
+ },
137
+ areaStyle: {
138
+ color: '#ed303c'
139
+ }
140
+ },
141
+
142
+ map: {
143
+ itemStyle: {
144
+ color: '#ddd'
145
+ },
146
+ areaStyle: {
147
+ color: '#f5634a'
148
+ },
149
+ label: {
150
+ color: '#c12e34'
151
+ }
152
+ },
153
+
154
+ graph: {
155
+ itemStyle: {
156
+ color: '#f5634a'
157
+ },
158
+ linkStyle: {
159
+ color: '#fad089'
160
+ }
161
+ },
162
+
163
+ gauge: {
164
+ axisLine: {
165
+ lineStyle: {
166
+ color: [
167
+ [0.2, '#ff9c5b'],
168
+ [0.8, '#fad089'],
169
+ [1, '#3b8183']
170
+ ],
171
+ width: 8
172
+ }
173
+ }
174
+ }
175
+ };
176
+
177
+ echarts.registerTheme('caravan', theme);
178
+ });
package/theme/carp.js ADDED
@@ -0,0 +1,163 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+
45
+ var colorPalette = [
46
+ '#f0d8A8',
47
+ '#3d1c00',
48
+ '#86b8b1',
49
+ '#f2d694',
50
+ '#fa2a00',
51
+ '#ff8066',
52
+ '#ffd5cc',
53
+ '#f9edd2'
54
+ ];
55
+
56
+ var theme = {
57
+ color: colorPalette,
58
+
59
+ title: {
60
+ textStyle: {
61
+ fontWeight: 'normal',
62
+ color: '#f0d8A8'
63
+ }
64
+ },
65
+
66
+ visualMap: {
67
+ color: ['#f0d8A8', '#3d1c00']
68
+ },
69
+
70
+ toolbox: {
71
+ color: ['#f0d8A8', '#f0d8A8', '#f0d8A8', '#f0d8A8']
72
+ },
73
+
74
+ tooltip: {
75
+ backgroundColor: 'rgba(0,0,0,0.5)',
76
+ axisPointer: {
77
+ // Axis indicator, coordinate trigger effective
78
+ type: 'line', // The default is a straight line: 'line' | 'shadow'
79
+ lineStyle: {
80
+ // Straight line indicator style settings
81
+ color: '#f0d8A8',
82
+ type: 'dashed'
83
+ },
84
+ crossStyle: {
85
+ color: '#f0d8A8'
86
+ },
87
+ shadowStyle: {
88
+ // Shadow indicator style settings
89
+ color: 'rgba(200,200,200,0.3)'
90
+ }
91
+ }
92
+ },
93
+
94
+ // Area scaling controller
95
+ dataZoom: {
96
+ dataBackgroundColor: '#eee', // Data background color
97
+ fillerColor: 'rgba(200,200,200,0.2)', // Fill the color
98
+ handleColor: '#f0d8A8' // Handle color
99
+ },
100
+
101
+ timeline: {
102
+ lineStyle: {
103
+ color: '#f0dba8'
104
+ },
105
+ controlStyle: {
106
+ color: '#f0dba8',
107
+ borderColor: '#f0dba8'
108
+ }
109
+ },
110
+
111
+ candlestick: {
112
+ itemStyle: {
113
+ color: '#3d1c00',
114
+ color0: '#86b8b1'
115
+ },
116
+ lineStyle: {
117
+ width: 1,
118
+ color: '#fa2a00',
119
+ color0: '#f2d694'
120
+ },
121
+ areaStyle: {
122
+ color: '#f0d8A8',
123
+ color0: '#86b8b1'
124
+ }
125
+ },
126
+
127
+ map: {
128
+ itemStyle: {
129
+ color: '#ddd'
130
+ },
131
+ areaStyle: {
132
+ color: '#86b8b1'
133
+ },
134
+ label: {
135
+ color: '#c12e34'
136
+ }
137
+ },
138
+
139
+ graph: {
140
+ itemStyle: {
141
+ color: '#3d1c00'
142
+ },
143
+ linkStyle: {
144
+ color: '#f0d8A8'
145
+ }
146
+ },
147
+
148
+ gauge: {
149
+ axisLine: {
150
+ lineStyle: {
151
+ color: [
152
+ [0.2, '#3d1c00'],
153
+ [0.8, '#f0d8A8'],
154
+ [1, '#fa2a00']
155
+ ],
156
+ width: 8
157
+ }
158
+ }
159
+ }
160
+ };
161
+
162
+ echarts.registerTheme('carp', theme);
163
+ });
package/theme/cool.js ADDED
@@ -0,0 +1,180 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+
45
+ var colorPalette = [
46
+ '#b21ab4',
47
+ '#6f0099',
48
+ '#2a2073',
49
+ '#0b5ea8',
50
+ '#17aecc',
51
+ '#b3b3ff',
52
+ '#eb99ff',
53
+ '#fae6ff',
54
+ '#e6f2ff',
55
+ '#eeeeee'
56
+ ];
57
+
58
+ var theme = {
59
+ color: colorPalette,
60
+
61
+ title: {
62
+ textStyle: {
63
+ fontWeight: 'normal',
64
+ color: '#00aecd'
65
+ }
66
+ },
67
+
68
+ visualMap: {
69
+ color: ['#00aecd', '#a2d4e6']
70
+ },
71
+
72
+ toolbox: {
73
+ color: ['#00aecd', '#00aecd', '#00aecd', '#00aecd']
74
+ },
75
+
76
+ tooltip: {
77
+ backgroundColor: 'rgba(0,0,0,0.5)',
78
+ axisPointer: {
79
+ // Axis indicator, coordinate trigger effective
80
+ type: 'line', // The default is a straight line: 'line' | 'shadow'
81
+ lineStyle: {
82
+ // Straight line indicator style settings
83
+ color: '#00aecd',
84
+ type: 'dashed'
85
+ },
86
+ crossStyle: {
87
+ color: '#00aecd'
88
+ },
89
+ shadowStyle: {
90
+ // Shadow indicator style settings
91
+ color: 'rgba(200,200,200,0.3)'
92
+ }
93
+ }
94
+ },
95
+
96
+ // Area scaling controller
97
+ dataZoom: {
98
+ dataBackgroundColor: '#eee', // Data background color
99
+ fillerColor: 'rgba(144,197,237,0.2)', // Fill the color
100
+ handleColor: '#00aecd' // Handle color
101
+ },
102
+
103
+ timeline: {
104
+ lineStyle: {
105
+ color: '#00aecd'
106
+ },
107
+ controlStyle: {
108
+ color: '#00aecd',
109
+ borderColor: '00aecd'
110
+ }
111
+ },
112
+
113
+ candlestick: {
114
+ itemStyle: {
115
+ color: '#00aecd',
116
+ color0: '#a2d4e6'
117
+ },
118
+ lineStyle: {
119
+ width: 1,
120
+ color: '#00aecd',
121
+ color0: '#a2d4e6'
122
+ },
123
+ areaStyle: {
124
+ color: '#b21ab4',
125
+ color0: '#0b5ea8'
126
+ }
127
+ },
128
+
129
+ chord: {
130
+ padding: 4,
131
+ itemStyle: {
132
+ color: '#b21ab4',
133
+ borderWidth: 1,
134
+ borderColor: 'rgba(128, 128, 128, 0.5)'
135
+ },
136
+ lineStyle: {
137
+ color: 'rgba(128, 128, 128, 0.5)'
138
+ },
139
+ areaStyle: {
140
+ color: '#0b5ea8'
141
+ }
142
+ },
143
+
144
+ graph: {
145
+ itemStyle: {
146
+ color: '#b21ab4'
147
+ },
148
+ linkStyle: {
149
+ color: '#2a2073'
150
+ }
151
+ },
152
+
153
+ map: {
154
+ itemStyle: {
155
+ color: '#c12e34'
156
+ },
157
+ areaStyle: {
158
+ color: '#ddd'
159
+ },
160
+ label: {
161
+ color: '#c12e34'
162
+ }
163
+ },
164
+
165
+ gauge: {
166
+ axisLine: {
167
+ lineStyle: {
168
+ color: [
169
+ [0.2, '#dddddd'],
170
+ [0.8, '#00aecd'],
171
+ [1, '#f5ccff']
172
+ ],
173
+ width: 8
174
+ }
175
+ }
176
+ }
177
+ };
178
+
179
+ echarts.registerTheme('cool', theme);
180
+ });
@@ -0,0 +1,168 @@
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ (function(root, factory) {
21
+ if (typeof define === 'function' && define.amd) {
22
+ // AMD. Register as an anonymous module.
23
+ define(['exports', 'echarts'], factory);
24
+ } else if (
25
+ typeof exports === 'object' &&
26
+ typeof exports.nodeName !== 'string'
27
+ ) {
28
+ // CommonJS
29
+ factory(exports, require('echarts'));
30
+ } else {
31
+ // Browser globals
32
+ factory({}, root.echarts);
33
+ }
34
+ })(this, function(exports, echarts) {
35
+ var log = function(msg) {
36
+ if (typeof console !== 'undefined') {
37
+ console && console.error && console.error(msg);
38
+ }
39
+ };
40
+ if (!echarts) {
41
+ log('ECharts is not Loaded');
42
+ return;
43
+ }
44
+ var contrastColor = '#eee';
45
+ var axisCommon = function() {
46
+ return {
47
+ axisLine: {
48
+ lineStyle: {
49
+ color: contrastColor
50
+ }
51
+ },
52
+ axisTick: {
53
+ lineStyle: {
54
+ color: contrastColor
55
+ }
56
+ },
57
+ axisLabel: {
58
+ textStyle: {
59
+ color: contrastColor
60
+ }
61
+ },
62
+ splitLine: {
63
+ lineStyle: {
64
+ type: 'dashed',
65
+ color: '#aaa'
66
+ }
67
+ },
68
+ splitArea: {
69
+ areaStyle: {
70
+ color: contrastColor
71
+ }
72
+ }
73
+ };
74
+ };
75
+
76
+ var colorPalette = [
77
+ '#00305a',
78
+ '#004b8d',
79
+ '#0074d9',
80
+ '#4192d9',
81
+ '#7abaf2',
82
+ '#99cce6',
83
+ '#d6ebf5',
84
+ '#eeeeee'
85
+ ];
86
+ var theme = {
87
+ color: colorPalette,
88
+ backgroundColor: '#333',
89
+ tooltip: {
90
+ axisPointer: {
91
+ lineStyle: {
92
+ color: contrastColor
93
+ },
94
+ crossStyle: {
95
+ color: contrastColor
96
+ }
97
+ }
98
+ },
99
+ legend: {
100
+ textStyle: {
101
+ color: contrastColor
102
+ }
103
+ },
104
+ title: {
105
+ textStyle: {
106
+ color: contrastColor
107
+ }
108
+ },
109
+ toolbox: {
110
+ iconStyle: {
111
+ normal: {
112
+ borderColor: contrastColor
113
+ }
114
+ }
115
+ },
116
+
117
+ // Area scaling controller
118
+ dataZoom: {
119
+ dataBackgroundColor: '#eee', // Data background color
120
+ fillerColor: 'rgba(200,200,200,0.2)', // Fill the color
121
+ handleColor: '#00305a' // Handle color
122
+ },
123
+
124
+ timeline: {
125
+ itemStyle: {
126
+ color: colorPalette[1]
127
+ },
128
+ lineStyle: {
129
+ color: contrastColor
130
+ },
131
+ controlStyle: {
132
+ color: contrastColor,
133
+ borderColor: contrastColor
134
+ },
135
+ label: {
136
+ color: contrastColor
137
+ }
138
+ },
139
+
140
+ timeAxis: axisCommon(),
141
+ logAxis: axisCommon(),
142
+ valueAxis: axisCommon(),
143
+ categoryAxis: axisCommon(),
144
+
145
+ line: {
146
+ symbol: 'circle'
147
+ },
148
+ graph: {
149
+ color: colorPalette
150
+ },
151
+
152
+ gauge: {
153
+ axisLine: {
154
+ lineStyle: {
155
+ color: [
156
+ [0.2, '#004b8d'],
157
+ [0.8, '#00305a'],
158
+ [1, '#7abaf2']
159
+ ],
160
+ width: 8
161
+ }
162
+ }
163
+ }
164
+ };
165
+
166
+ theme.categoryAxis.splitLine.show = false;
167
+ echarts.registerTheme('dark-blue', theme);
168
+ });