Skip to content

Commit fa3c29c

Browse files
authored
Merge pull request edp963#237 from scottsut/master
wordcloud加上默认主题色彩
2 parents 82ba643 + b7002b9 commit fa3c29c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

webapp/app/containers/Widget/charts/wordCloud.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
* WordCloud chart options generator
2323
*/
2424

25+
import defaultEchartsTheme from '../../../assets/json/echartsThemes/default.project.json'
26+
const colors = defaultEchartsTheme.theme.color
27+
2528
export default function (dataSource, flatInfo, chartParams) {
2629
const {
2730
title,
@@ -64,11 +67,13 @@ export default function (dataSource, flatInfo, chartParams) {
6467
type: 'wordCloud',
6568
textStyle: {
6669
normal: {
67-
color: '#509af2'
70+
color: function () {
71+
return colors[Math.floor(Math.random() * colors.length)]
72+
}
6873
},
6974
emphasis: {
7075
shadowBlur: 10,
71-
shadowColor: '#509af2'
76+
shadowColor: 'rgba(0,0,0,.15)'
7277
}
7378
},
7479
data: Object.keys(grouped).map(k => grouped[k]),

0 commit comments

Comments
 (0)