老规矩,先上图再说话
网上关于怎么在vue中使用echarts已经很多了,但是都是单页面的使用方法,在这里说一个最土的写法中怎么使用echarts,也简单的说一下echaarts中的polar极坐标双数值轴图表。
所有代码在最后,不想看过程的直接拉到最后……
下载 echarts的方法
npm i echarts
然后去node_models里面去找
html
<div id="myChart" :style="{width: '300px', height: '300px',margin:'0 auto'}"></div>
script
let myChart = echarts.init(document.getElementById('myChart'))//引入的echarts会抛出一个echarts对象
myChart.setOption(option)
再说一下 echarts的polar极坐标双数值轴
第一点
clockwise: clockwise, //是否逆时针
startAngle: 90,//x轴旋转角度
interval: 5,//外层圆最小刻度 单位
第二点 color 与 线的颜色一致,更美观
data: {
color: ['#4fa8f9','#6ec71e'],
},
let option = {
color: this.color,
series: [
{
coordinateSystem: 'polar',
symbol: "none",
itemStyle:{
normal:{
lineStyle