<div id="getWordCloud" style="height: 200px; width: 100%"></div>
<script>
require("echarts-wordcloud");
import echarts from "echarts";
export default {
methods: {
getWordCloud() {
let myChart = echarts.init(
document.getElementById("getWordCloud"),
"macarons"
);
myChart.setOption({
tooltip: {},
series: [
{
type: "wordCloud",
shape: "smooth",
gridSize: 8,
rotationRange: 90,
textStyle: {
normal: {
fontFamily: "",
color: function () {
return (
"rgb(" +
Math.round(Math.random() * 255) +
", " +
Math.round(Math.random() * 255) +
", " +
Math.round(Math.random() * 255) +
")"
);
},
},
emphasis: {
shadowBlur: 5,
shadowColor: "#333",
},
},
left: "center",
top: "center",
right: null,
bottom: null,
width: "100%",
height: "100%",
data: [],
},
],
});
},
},
};
</script>