Examples
Google Trends
ECharts Option Keywords
Install
<script src="echarts.min.js"></script>
<script src="echarts-wordcloud.min.js"></script>
Or
npm install echarts-wordcloud
var echarts = require('echarts');
require('echarts-wordcloud');
Usage
var chart = echarts.init(document.getElementById('main'));
chart.setOption({
...
series: [{
type: 'wordCloud',
shape: 'circle',
maskImage: maskImage,
left: 'center',
top: 'center',
width: '70%',
height: '80%',
right: null,
bottom: null,
sizeRange: [12, 60],
rotationRange: [-90, 90],
rotationStep: 45,
gridSize: 8,
drawOutOfBounds: false,
textStyle: {
normal: {
fontFamily: 'sans-serif',
fontWeight: 'bold',
color: function () {
return 'rgb(' + [
Math.round(Math.random() * 160),
Math.round(Math.random() * 160),
Math.round(Math.random() * 160)
].join(',') + ')';
}
},
emphasis: {
shadowBlur: 10,
shadowColor: '#333'
}
},
data: [{
name: 'Farrah Abraham',
value: 366,
textStyle: {
normal: {},
emphasis: {}
}
}]
}]
});