首先效果图
1.你需要了解echarts的简单使用方法,以及各个配置项的作用。
2.在下载echarts后还需要下载wordcloud
npm install echarts-wordcloud --save
3.引入wordcloud(我的echarts是挂载到Vue原型上的,在此不需要再引入)
import 'echarts-wordcloud';
4.主要代码(注意要给盒子容器ref=“wordCloud”属性,并给定宽高)
getChart() {
this.worldCloudChart = this.$echarts.init(this.$refs.wordCloud);
this.option = {
tooltip: {
show: true,
position: "top",
formatter: (params) => {
return `${params.marker}${params.name} : 热度