echarts-wordcloud
echarts-wordcloud copied to clipboard
echarts 4.0.3不支持该插件吗
代码如下(直接黏贴即可用):
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcss.com/echarts/4.0.3/echarts.simple.js">
</script>
<script src="../dist/echarts-wordcloud.js">
</script>
</meta>
</head>
<body>
<style>
html, body, #main {
width: 100%;
height: 100%;
margin: 0;
}
</style>
<div id="main">
</div>
<script>
var chart = echarts.init(document.getElementById('main'));
var option = {
tooltip: {},
series: [ {
type: 'wordCloud',
gridSize: 2,
sizeRange: [12, 50],
rotationRange: [-90, 90],
shape: 'pentagon',
width: 600,
height: 400,
drawOutOfBound: true,
textStyle: {
normal: {
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: data
} ]
};
chart.setOption(option);
window.onresize = chart.resize;
</script>
</body>
</html>
,应该是 echarts 的 utils 为空值导致。
期望: 能得以解决,或找出问题原因。