Vue 炫酷 Echarts 图表

网址:https://www.makeapie.com/explore.html#sort=ranktimeframe=allauthor=all

上面的网址已经停服了,有几个网址更新一下子

https://www.makeapie.cn/

https://www.isqqw.com/#/homepage

这上边还是有很多设计炫酷的 echarts 图表的,可以做大屏的时候使用。简单的写几个案例,可以根据自己的需要选择使用。

水波球

首先使用这个水波球也有叫水纹球的,他需要安装一个插件

npm install echarts-liquidfill

然后就可以使用了。

效果

代码

<doc>https://www.makeapie.com/explore.html#sort=rank~timeframe=all~author=allhttps://www.npmjs.com/package/echarts-liquidfillnpm install echarts-liquidfill
</doc>
<template><div><div id="shuiwen" style="width: 500px;height:400px;border:1px solid red;float: left;"></div></div>
</template>
<script>import echarts from 'echarts'import "echarts-liquidfill";export default {data() {return {charts: '',}},mounted() {this.init("shuiwen")},methods: {init(id) {this.charts = echarts.init(document.getElementById(id))let value = 0.45;let data = [value, value, value,];let option = {backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{offset: 0,color: '#431ab8'}, {offset: 1,color: '#471bba'}]),title: {text: (value * 100).toFixed(0) + '{a|%}',textStyle: {fontSize: 50,fontFamily: 'Microsoft Yahei',fontWeight: 'normal',color: '#bcb8fb',rich: {a: {fontSize: 28,}}},x: 'center',y: '35%'},graphic: [{type: 'group',left: 'center',top: '60%',children: [{type: 'text',z: 100,left: '10',top: 'middle',style: {fill: '#aab2fa',text: '使用占比',font: '20px Microsoft YaHei'}}]}],series: [{type: 'liquidFill',radius: '80%',center: ['50%', '50%'],//  shape: 'roundRect',data: data,backgroundStyle: {color: {type: 'linear',x: 1,y: 0,x2: 0.5,y2: 1,colorStops: [{offset: 1,color: 'rgba(68, 145, 253, 0)'}, {offset: 0.5,color: 'rgba(68, 145, 253, .25)'}, {offset: 0,color: 'rgba(68, 145, 253, 1)'}],globalCoord: false},},outline: {borderDistance: 0,itemStyle: {borderWidth: 20,borderColor: {type: 'linear',x: 0,y: 0,x2: 0,y2: 1,colorStops: [{offset: 0,color: 'rgba(69, 73, 240, 0)'}, {offset: 0.5,color: 'rgba(69, 73, 240, .25)'}, {offset: 1,color: 'rgba(69, 73, 240, 1)'}],globalCoord: false},shadowBlur: 10,shadowColor: '#000',}},itemStyle: {color: {type: 'linear',x: 0,y: 0,x2: 0,y2: 1,colorStops: [{offset: 1,color: 'rgba(58, 71, 212, 0)'}, {offset: 0.5,color: 'rgba(31, 222, 225, .2)'}, {offset: 0,color: 'rgba(31, 222, 225, 1)'}],globalCoord: false},},label: {normal: {formatter: '',}}},]};// 使用刚指定的配置项和数据显示图表。this.charts.setOption(option);}},}
</script>
<style scoped></style>

伪立体柱状图

效果

代码

<doc>https://www.makeapie.com/editor.html?c=xoqSlmiSRZ
</doc>
<template><div><div id="weilitizhuzhuangtu" style="width: 500px;height:400px;border:1px solid red;float: left;"></div></div>
</template>
<script>import echarts from 'echarts'export default {data() {return {charts: '',}},mounted() {this.init("weilitizhuzhuangtu")},methods: {init(id) {this.charts = echarts.init(document.getElementById(id))// 绘制左侧面const CubeLeft = echarts.graphic.extendShape({shape: {x: 0,y: 0},buildPath: function (ctx, shape) {// 会canvas的应该都能看得懂,shape是从custom传入的const xAxisPoint = shape.xAxisPointconst c0 = [shape.x, shape.y]const c1 = [shape.x - 13, shape.y - 13]const c2 = [xAxisPoint[0] - 13, xAxisPoint[1] - 13]const c3 = [xAxisPoint[0], xAxisPoint[1]]ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath()}})// 绘制右侧面const CubeRight = echarts.graphic.extendShape({shape: {x: 0,y: 0},buildPath: function (ctx, shape) {const xAxisPoint = shape.xAxisPointconst c1 = [shape.x, shape.y]const c2 = [xAxisPoint[0], xAxisPoint[1]]const c3 = [xAxisPoint[0] + 18, xAxisPoint[1] - 9]const c4 = [shape.x + 18, shape.y - 9]ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()}})// 绘制顶面const CubeTop = echarts.graphic.extendShape({shape: {x: 0,y: 0},buildPath: function (ctx, shape) {const c1 = [shape.x, shape.y]const c2 = [shape.x + 18, shape.y - 9]const c3 = [shape.x + 5, shape.y - 22]const c4 = [shape.x - 13, shape.y - 13]ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()}})// 注册三个面图形echarts.graphic.registerShape('CubeLeft', CubeLeft)echarts.graphic.registerShape('CubeRight', CubeRight)echarts.graphic.registerShape('CubeTop', CubeTop)const MAX = [300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300]const VALUE = [21.9, 26.8, 24.2, 54.9, 74.5, 78.3, 119.0, 126.9, 190.8, 123.2, 156.2, 169.3, 179.5, 155.5]let option = {backgroundColor: "#012366",tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'},formatter: function (params, ticket, callback) {const item = params[1]return item.name + ' : ' + item.value;}},grid: {left: 40,right: 40,bottom: 100,top: 100,containLabel: true},xAxis: {type: 'category',data: ['立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种', '夏至', '小暑', '大暑', '立秋', '处暑'],axisLine: {show: false,lineStyle: {color: 'white'}},offset: 25,axisTick: {show: false,length: 9,alignWithLabel: true,lineStyle: {color: '#7DFFFD'}},axisLabel: {show: true,fontSize: 16},},yAxis: {type: 'value',axisLine: {show: false,lineStyle: {color: 'white'}},splitLine: {show: false},axisTick: {show: false},axisLabel: {show: false,fontSize: 16},boundaryGap: ['20%', '20%']},series: [{type: 'custom',renderItem: function (params, api) {const location = api.coord([api.value(0), api.value(1)])return {type: 'group',children: [{type: 'CubeLeft',shape: {api,x: location[0],y: location[1],xAxisPoint: api.coord([api.value(0), 0])},style: {fill: 'rgba(47,102,192,.27)'}}, {type: 'CubeRight',shape: {api,x: location[0],y: location[1],xAxisPoint: api.coord([api.value(0), 0])},style: {fill: 'rgba(59,128,226,.27)'}}, {type: 'CubeTop',shape: {api,x: location[0],y: location[1],xAxisPoint: api.coord([api.value(0), 0])},style: {fill: 'rgba(72,156,221,.27)'}}]}},data: MAX}, {type: 'custom',renderItem: (params, api) => {const location = api.coord([api.value(0), api.value(1)])var color = api.value(1) > 2000 ? 'red' : new echarts.graphic.LinearGradient(0, 0, 0, 1, [{offset: 0,color: 'rgba(67,102,243,1)'},{offset: 1,color: 'rgba(29,67,243,1)'}])return {type: 'group',children: [{type: 'CubeLeft',shape: {api,xValue: api.value(0),yValue: api.value(1),x: location[0],y: location[1],xAxisPoint: api.coord([api.value(0), 0])},style: {fill: color}}, {type: 'CubeRight',shape: {api,xValue: api.value(0),yValue: api.value(1),x: location[0],y: location[1],xAxisPoint: api.coord([api.value(0), 0])},style: {fill: color}}, {type: 'CubeTop',shape: {api,xValue: api.value(0),yValue: api.value(1),x: location[0],y: location[1],xAxisPoint: api.coord([api.value(0), 0])},style: {fill: color}}]}},data: VALUE}, {type: 'bar',label: {normal: {show: true,position: 'top',fontSize: 16,color: '#fff',offset: [2, -25]}},itemStyle: {color: 'transparent'},tooltip: {},data: MAX}]}// 使用刚指定的配置项和数据显示图表。this.charts.setOption(option);}},}
</script>
<style scoped></style>

炫彩饼状图

效果

代码

<doc>https://www.makeapie.com/editor.html?c=xoqSlmiSRZ
</doc>
<template><div><div id="bingzhuangtu" style="width: 500px;height:400px;border:1px solid red;float: left;"></div></div>
</template>
<script>import echarts from 'echarts'export default {data() {return {charts: '',}},mounted() {this.init("bingzhuangtu")},methods: {init(id) {this.charts = echarts.init(document.getElementById(id))var img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMYAAADGCAYAAACJm/9dAAABS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyI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4GpwNdQiJ6QoWhZyZ+BaXhpSSkZhJ7pn9EzHhp770lUFlOJavOKpNKFEfI6WqF5KO37H8OB69DCtBtQjCvTM76ADnxcjZ5pfLJ1CXr2x1OBzaYkqkUYIUuBMcAxRIsSQe3gK4E/oTmQ0dmbVrGMRs/sT+jciXj/bQVwLHrmS7M3LT2qTRghT6ORkcODdEhfNAeyFB0schmwY+bWlT9D0LN5DT2rSejZhTyNnu0hwILMrcuAahVGyGJUe3wdHWnbEntvX7SP+F3gMbTUZAC1ywAkgMfQGqZb0TMKaUHP8OvomS7O1rxsqWtdUlOLVoejGdnzgD0S3v8IreGZi4I0fJydabmwHWoKTUR9tKRBitXo0MefkVI4zDxpam5MfL3WhBFSj/Z/nI/W7DQkXNOCdpE9jbbhVsSMbTcYARwFHI2aQ4X+748jQTQDWzKzLmMKCaNv4qvVzxbg2eBve/SLeTowjmg3WQP6NT02yL+Lmg/Lgr9VRGGAypU+SAijg7/DgF0LXLsZiWA2Cp68PgP7ypZarTEKMQzVIOPRr+rWJgivRkPA5cxVaIi1EJ+i2vAJVEOU7WrXtHCN0T3WovU+96DO6OEoksk4FNqn0n9F2tC+iGZUWy4CNuZqUZliYRRmI5pND2fUd0JDwKPRMGVLgfvKiRa0EegF1PxbDnyQq0UVwv8BNYmwIpIWBvwAAAAASUVORK5CYII=';var trafficWay = [{name: '火车',value: 20}, {name: '飞机',value: 10}, {name: '客车',value: 30}, {name: '轮渡',value: 40}];var data = [];var color = ['#00ffff', '#00cfff', '#006ced', '#ffe000', '#ffa800', '#ff5b00', '#ff3000']for (var i = 0; i < trafficWay.length; i++) {data.push({value: trafficWay[i].value,name: trafficWay[i].name,itemStyle: {normal: {borderWidth: 5,shadowBlur: 20,borderColor: color[i],shadowColor: color[i]}}}, {value: 2,name: '',itemStyle: {normal: {label: {show: false},labelLine: {show: false},color: 'rgba(0, 0, 0, 0)',borderColor: 'rgba(0, 0, 0, 0)',borderWidth: 0}}});}var seriesOption = [{name: '',type: 'pie',clockWise: false,radius: [105, 109],hoverAnimation: false,itemStyle: {normal: {label: {show: true,position: 'outside',color: '#ddd',formatter: function (params) {var percent = 0;var total = 0;for (var i = 0; i < trafficWay.length; i++) {total += trafficWay[i].value;}percent = ((params.value / total) * 100).toFixed(0);if (params.name !== '') {return '交通方式:' + params.name + '\n' + '\n' + '占百分比:' + percent + '%';} else {return '';}},},labelLine: {length: 10,length2: 20,show: true,color: '#00ffff'}}},data: data}];let option = {backgroundColor: '#0A2E5D',color: color,title: {text: '交通方式',top: '48%',textAlign: "center",left: "49%",textStyle: {color: '#fff',fontSize: 22,fontWeight: '400'}},graphic: {elements: [{type: "image",z: 3,style: {image: img,width: 178,height: 178},left: 'center',top: 'center',position: [100, 100]}]},tooltip: {show: false},legend: {icon: "circle",orient: 'horizontal',// x: 'left',data: ['火车', '飞机', '客车', '轮渡'],right: 10,bottom: 10,align: 'right',textStyle: {color: "#fff"},itemGap: 10},toolbox: {show: false},series: seriesOption}// 使用刚指定的配置项和数据显示图表。this.charts.setOption(option);}},}
</script>
<style scoped></style>

动效仪表盘

效果

代码

<doc>https://www.makeapie.com/editor.html?c=xoqSlmiSRZ
</doc>
<template><div><div id="yibiaopan" style="width: 500px;height:400px;border:1px solid red;float: left;"></div></div>
</template>
<script>import echarts from 'echarts'export default {data() {return {charts: '',angle: 0,value: 55.33,option: {}}},mounted() {this.init("yibiaopan")},methods: {init(id) {this.charts = echarts.init(document.getElementById(id))this.angle = 0;//角度,用来做简单的动画效果的this.value = 55.33;this.option = {backgroundColor: "#061740",title: {text: '{a|' + this.value + '}{c|%}',x: 'center',y: 'center',textStyle: {rich: {a: {fontSize: 48,color: '#29EEF3'},c: {fontSize: 20,color: '#ffffff',// padding: [5,0]}}}},legend: {type: "plain",orient: "vertical",right: 0,top: "10%",align: "auto",data: [{name: '涨价后没吃过',icon: "circle"}, {name: '天天吃',icon: "circle"}, {name: '三五天吃一次',icon: "circle"}, {name: '半个月吃一次',icon: "circle"}],textStyle: {color: "white",fontSize: 16,padding: [10, 1, 10, 0]},selectedMode: false},series: [{name: "ring5",type: 'custom',coordinateSystem: "none",renderItem:  (params, api) => {return {type: 'arc',shape: {cx: api.getWidth() / 2,cy: api.getHeight() / 2,r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,startAngle: (0 + this.angle) * Math.PI / 180,endAngle: (90 + this.angle) * Math.PI / 180},style: {stroke: "#0CD3DB",fill: "transparent",lineWidth: 1.5},silent: true};},data: [0]}, {name: "ring5",type: 'custom',coordinateSystem: "none",renderItem:  (params, api) => {return {type: 'arc',shape: {cx: api.getWidth() / 2,cy: api.getHeight() / 2,r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,startAngle: (180 + this.angle) * Math.PI / 180,endAngle: (270 + this.angle) * Math.PI / 180},style: {stroke: "#0CD3DB",fill: "transparent",lineWidth: 1.5},silent: true};},data: [0]}, {name: "ring5",type: 'custom',coordinateSystem: "none",renderItem: (params, api) => {return {type: 'arc',shape: {cx: api.getWidth() / 2,cy: api.getHeight() / 2,r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,startAngle: (270 + -this.angle) * Math.PI / 180,endAngle: (40 + -this.angle) * Math.PI / 180},style: {stroke: "#0CD3DB",fill: "transparent",lineWidth: 1.5},silent: true};},data: [0]}, {name: "ring5",type: 'custom',coordinateSystem: "none",renderItem: (params, api) => {return {type: 'arc',shape: {cx: api.getWidth() / 2,cy: api.getHeight() / 2,r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,startAngle: (90 + -this.angle) * Math.PI / 180,endAngle: (220 + -this.angle) * Math.PI / 180},style: {stroke: "#0CD3DB",fill: "transparent",lineWidth: 1.5},silent: true};},data: [0]}, {name: "ring5",type: 'custom',coordinateSystem: "none",renderItem:  (params, api) => {let x0 = api.getWidth() / 2;let y0 = api.getHeight() / 2;let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;let point = this.getCirlPoint(x0, y0, r, (90 + -this.angle))return {type: 'circle',shape: {cx: point.x,cy: point.y,r: 4},style: {stroke: "#0CD3DB",//粉fill: "#0CD3DB"},silent: true};},data: [0]}, {name: "ring5",  //绿点type: 'custom',coordinateSystem: "none",renderItem:  (params, api) => {let x0 = api.getWidth() / 2;let y0 = api.getHeight() / 2;let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;let point = this.getCirlPoint(x0, y0, r, (270 + -this.angle))return {type: 'circle',shape: {cx: point.x,cy: point.y,r: 4},style: {stroke: "#0CD3DB",      //绿fill: "#0CD3DB"},silent: true};},data: [0]}, {name: '吃猪肉频率',type: 'pie',radius: ['58%', '45%'],silent: true,clockwise: true,startAngle: 90,z: 0,zlevel: 0,label: {normal: {position: "center",}},data: [{value: this.value,name: "",itemStyle: {normal: {color: { // 完成的圆环的颜色colorStops: [{offset: 0,color: '#4FADFD' // 0% 处的颜色}, {offset: 1,color: '#28E8FA' // 100% 处的颜色}]},}}},{value: 100 - this.value,name: "",label: {normal: {show: false}},itemStyle: {normal: {color: "#173164"}}}]},{name: "",type: "gauge",radius: "58%",center: ['50%', '50%'],startAngle: 0,endAngle: 359.9,splitNumber: 8,hoverAnimation: true,axisTick: {show: false},splitLine: {length: 60,lineStyle: {width: 5,color: "#061740"}},axisLabel: {show: false},pointer: {show: false},axisLine: {lineStyle: {opacity: 0}},detail: {show: false},data: [{value: 0,name: ""}]},]};// 使用刚指定的配置项和数据显示图表。// this.charts.setOption(option);setInterval(() => {//用setInterval做动画感觉有问题this.draw()}, 100);},//获取圆上面某点的坐标(x0,y0表示坐标,r半径,angle角度)getCirlPoint(x0, y0, r, angle) {let x1 = x0 + r * Math.cos(angle * Math.PI / 180)let y1 = y0 + r * Math.sin(angle * Math.PI / 180)return {x: x1,y: y1}},draw() {this.angle = this.angle + 3this.charts.setOption(this.option, true)},},}
</script>
<style scoped></style>

地图

效果

代码

<doc>https://www.makeapie.com/editor.html?c=xr5cqmiBBf
</doc>
<template><div><div id="ditu" style="width: 500px;height:400px;border:1px solid red;float: left;"></div></div>
</template>
<script>import echarts from 'echarts'export default {data() {return {charts: '',}},mounted() {this.init("ditu")},methods: {init(id) {var mapCode = require("../../assets/china.json");echarts.registerMap('china', mapCode);this.charts = echarts.init(document.getElementById(id))var points = [{ value: [118.8062, 31.9208], itemStyle: { color: '#4ab2e5' } }, { value: [127.9688, 45.368], itemStyle: { color: '#4fb6d2' } }, { value: [110.3467, 41.4899], itemStyle: { color: '#52b9c7' } }, { value: [125.8154, 44.2584], itemStyle: { color: '#5abead' } }, { value: [116.4551, 40.2539], itemStyle: { color: '#f34e2b' } }, { value: [123.1238, 42.1216], itemStyle: { color: '#f56321' } }, { value: [114.4995, 38.1006], itemStyle: { color: '#f56f1c' } }, { value: [117.4219, 39.4189], itemStyle: { color: '#f58414' } }, { value: [112.3352, 37.9413], itemStyle: { color: '#f58f0e' } }, { value: [109.1162, 34.2004], itemStyle: { color: '#f5a305' } }, { value: [103.5901, 36.3043], itemStyle: { color: '#e7ab0b' } }, { value: [106.3586, 38.1775], itemStyle: { color: '#dfae10' } }, { value: [101.4038, 36.8207], itemStyle: { color: '#d5b314' } }, { value: [103.9526, 30.7617], itemStyle: { color: '#c1bb1f' } }, { value: [108.384366, 30.439702], itemStyle: { color: '#b9be23' } }, { value: [113.0823, 28.2568], itemStyle: { color: '#a6c62c' } }, { value: [102.9199, 25.46639], itemStyle: { color: '#96cc34' } }, { value: [119.4543, 25.9222] }]// var uploadedDataURL = "/asset/get/s/data-1482909892121-BJ3auk-Se.json";let index = -1;let option = {backgroundColor: '#013954',geo: {map: 'china',aspectScale: 0.75, //长宽比zoom: 1.1,roam: false,itemStyle: {normal: {areaColor: {type: 'radial',x: 0.5,y: 0.5,r: 0.8,colorStops: [{offset: 0,color: '#09132c' // 0% 处的颜色}, {offset: 1,color: '#274d68'  // 100% 处的颜色}],globalCoord: true // 缺省为 false},shadowColor: 'rgb(58,115,192)',shadowOffsetX: 10,shadowOffsetY: 11},emphasis: {areaColor: '#2AB8FF',borderWidth: 0,color: 'green',label: {show: false}}},regions: [{name: '南海诸岛',itemStyle: {areaColor: 'rgba(0, 10, 52, 1)',borderColor: 'rgba(0, 10, 52, 1)',normal: {opacity: 0,label: {show: false,color: "#009cc9",}}},}],},series: [{type: 'map',roam: false,label: {normal: {show: true,textStyle: {color: '#1DE9B6'}},emphasis: {textStyle: {color: 'rgb(183,185,14)'}}},itemStyle: {normal: {borderColor: 'rgb(147, 235, 248)',borderWidth: 1,areaColor: {type: 'radial',x: 0.5,y: 0.5,r: 0.8,colorStops: [{offset: 0,color: '#09132c' // 0% 处的颜色}, {offset: 1,color: '#274d68'  // 100% 处的颜色}],globalCoord: true // 缺省为 false},},emphasis: {areaColor: 'rgb(46,229,206)',//    shadowColor: 'rgb(12,25,50)',borderWidth: 0.1}},zoom: 1.1,//     roam: false,map: 'china' //使用// data: this.difficultData //热力图数据   不同区域 不同的底色}, {type: 'effectScatter',coordinateSystem: 'geo',showEffectOn: 'render',zlevel: 1,rippleEffect: {period: 15,scale: 4,brushType: 'fill'},hoverAnimation: true,label: {normal: {formatter: '{b}',position: 'right',offset: [15, 0],color: '#1DE9B6',show: true},},itemStyle: {normal: {color: '#1DE9B6',shadowBlur: 10,shadowColor: '#333'}},symbolSize: 12,data: points}, //地图线的动画效果{type: 'lines',zlevel: 2,effect: {show: true,period: 4, //箭头指向速度,值越小速度越快trailLength: 0.4, //特效尾迹长度[0,1]值越大,尾迹越长重symbol: 'arrow', //箭头图标symbolSize: 7, //图标大小},lineStyle: {normal: {color: '#1DE9B6',width: 1, //线条宽度opacity: 0.1, //尾迹线条透明度curveness: .3 //尾迹线条曲直度}},data: [{ coords: [[118.8062, 31.9208], [119.4543, 25.9222]], lineStyle: { color: '#4ab2e5' } }, { coords: [[127.9688, 45.368], [119.4543, 25.9222]], lineStyle: { color: '#4fb6d2' } }, { coords: [[110.3467, 41.4899], [119.4543, 25.9222]], lineStyle: { color: '#52b9c7' } }, { coords: [[125.8154, 44.2584], [119.4543, 25.9222]], lineStyle: { color: '#5abead' } }, { coords: [[116.4551, 40.2539], [119.4543, 25.9222]], lineStyle: { color: '#f34e2b' } }, { coords: [[123.1238, 42.1216], [119.4543, 25.9222]], lineStyle: { color: '#f56321' } }, { coords: [[114.4995, 38.1006], [119.4543, 25.9222]], lineStyle: { color: '#f56f1c' } }, { coords: [[117.4219, 39.4189], [119.4543, 25.9222]], lineStyle: { color: '#f58414' } }, { coords: [[112.3352, 37.9413], [119.4543, 25.9222]], lineStyle: { color: '#f58f0e' } }, { coords: [[109.1162, 34.2004], [119.4543, 25.9222]], lineStyle: { color: '#f5a305' } }, { coords: [[103.5901, 36.3043], [119.4543, 25.9222]], lineStyle: { color: '#e7ab0b' } }, { coords: [[106.3586, 38.1775], [119.4543, 25.9222]], lineStyle: { color: '#dfae10' } }, { coords: [[101.4038, 36.8207], [119.4543, 25.9222]], lineStyle: { color: '#d5b314' } }, { coords: [[103.9526, 30.7617], [119.4543, 25.9222]], lineStyle: { color: '#c1bb1f' } }, { coords: [[108.384366, 30.439702], [119.4543, 25.9222]], lineStyle: { color: '#b9be23' } }, { coords: [[113.0823, 28.2568], [119.4543, 25.9222]], lineStyle: { color: '#a6c62c' } }, { coords: [[102.9199, 25.46639], [119.4543, 25.9222]], lineStyle: { color: '#96cc34' } }]}]};this.charts.setOption(option, true);},}}
</script>
<style scoped></style>

上面是几个简单的demo,如果需要的话可以去上面分享的网站自己选择使用。

项目地址:https://gitee.com/wjw1014/vue-interface-layout/tree/master/src/components/echarts

Vue 炫酷 Echarts 图表相关推荐

  1. 干货分享 | 用Pyecharts绘制20钟不同风格的炫酷交互式图表,建议收藏

    今天小编来给大家介绍一下如何在Pyecharts当中画出炫酷的图表,通过该模块当中的一系列设置,本文我们大致会介绍pyecharts当中的 Theme图表背景 Pyecharts模块内部内置了10多种 ...

  2. vue socketio 实现echarts图表动态显示

    本文主要为续之前vue和flask使用socketio实现互连的文章,记一下我的Vue项目中使用echarts实现动态图表的方法. 如仍然不了解 socketio 的使用方法,可点击此看我之前写的关于 ...

  3. Vue中使echarts图表自适应

    Vue中使echarts图表自适应 1.先在main.js中自定义一个全局指令,如下 // 定义全局指令 Vue.directive('resize', { // 使用局部注册指令的方式// 指令的名 ...

  4. Vue中使用echarts图表插件

    一.安装echarts依赖 npm install echarts -S 或者使用淘宝的镜像 npm install -g cnpm --registry=https://registry.npm.t ...

  5. 可视化展示炫酷3D图表

    3D数据可视化的的目的,不是简单的将数据变得三维化,而是通过3D可视化的方式将数据进行三维的表达出来,相比二维数据,更有逻辑,感知力更强.让用户或者管理者一目了然,能让使用者更加敏捷的观察到数据的变化 ...

  6. vue2.0_在vue中使用echarts图表插件

    说明:本例子基于vue-cli脚手架搭建 首先,安装echarts依赖 npm install echarts -S 注:安装NodeJS之后,使用npm来安装包使用的是国外的地址,经常会出现超时错误 ...

  7. Vue动态渲染echarts图表

    最近做项目遇到这样一个场景,有一个标签选择界面,选择不同的标签需要展示不同的图表有可能折线图,有可能柱状图,也可能饼图,图表的类型由后端返回,标签可以多选.这个时候就需要动态来渲染不定数量和类型的ec ...

  8. 分享几个 Pyecharts 技巧,助你画出更直观/炫酷的图表

    作者 | 俊欣 来源 | 关于数据分析与可视化 想必大家应该也已经看到很多关于数据分析的内容了,今天小编就为大家来分享一下国产可视化库pyecharts在绘制图表时一些的技巧,帮助读者画出更加酷炫以及 ...

  9. 实战案例,手把手教你使用 Tableau 绘制超炫酷可视化图表

    有一种美叫数据的美,Tableau可以让你看到这种数据美,以及探索数据美的可能,如下图表均是由强大的tableau可视化而成的. 喜欢点赞.收藏 使用tableau的优势就在于不需要懂技术,更不需要写 ...

  10. vue循环生成echarts图表

    1. 效果图 2. 引入echarts npm install echarts --save 3. main.js全局引入 4. 页面 data数据是从后台接口中返回的,需要通过watch监听来获取c ...

最新文章

  1. 测试之美---测试员的心思你不懂
  2. Python学习笔记四(Python OS模块)
  3. web前端技术分享Electron之IPC 通信
  4. 51CTO的技术门诊谈OSSIM
  5. 【渝粤教育】国家开放大学2018年春季 3897T商务英语1 参考试题
  6. 智能硬件网络配置方式
  7. rpg制作大师2003_RPG制作大师MV 我们一起做游戏(十四)
  8. jQuery基础系列
  9. 练习题︱基于今日头条开源数据(二)——两款Apriori算法实践
  10. 文件操作 详解(freopen)(C++)
  11. 解决npm install xxx -g问题
  12. Flutter实战】文本组件及五大案例
  13. 浅谈JSONP跨域漏洞
  14. quartz 表结构 oracle,Quartz所使用的表的说明
  15. 计算机语言lc-3,GBT 15969.3-2005 可编程序控制器 第3部分 编程语言.pdf-全文可读
  16. 用python爬取头条文章_AI第四课:Python爬取今日头条文章
  17. ubuntu18给当前用户安装cuda11.2 图文教程 、 配置cuDNN8.1 ——【一文读懂】
  18. 【通州建设】地铁S6线更名为21号线!途径通州多站!
  19. 沪江日语小D落户博客园~
  20. (读后摘抄)《计算机程序设计语言的发展》_王汝传

热门文章

  1. 车辆路径跟踪算法及数学模型
  2. 使用Maven构建Eova项目
  3. wps2019政府专版 无广告
  4. ug添加imachining变量_UG变量设置)
  5. OneNET协议之LWM2M+CoAP
  6. [数据][xml格式] 2012年统计用区划代码和城乡划分代码
  7. 倍福plc有什么优点_倍福工业 PC 有哪些优点?
  8. 倍福plc有什么优点_plc控制系统的优点是什么
  9. 牛逼!SpringBoot+Vue企业级支付系统!附源码!
  10. Kindle for PC: 优雅的 PDF 阅读器工具