echarts 折线图线条粗细_echarts设置面积图面积区域渐变与echarts折线图线条设置为虚线...

1. echarts 设置面积图面积区域渐变.

var colorArr = ['#a6b5ff', '#a6b5ff', '#9692ff', '#33cef2'],

var option = {

color:colorArr, //设置线条颜色

series: [{

name: '邮件营销',

type: 'line',

stack: '总量',

areaStyle: {

normal: {}

},

data: [120, 132, 191, 134, 90, 230, 210],

smooth: true,

areaStyle: {

normal: {

opacity: 0.3,

color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ //关键在这里, 设置面积渐变

offset: 0,

color: colorArr[0] //这里是我设置的渐变的颜色从线条颜色变为白色,如果是循环数据,其中的0依次循环colorArr 就ok了

}, {

offset: 1,

color: '#fff'

}])

}

}

}, {

name: '联盟广告',

type: 'line',

stack: '总量',

areaStyle: {

normal: {}

},

data: [100, 182, 111, 84, 90, 120, 250],

smooth: true,

}]

}

2. echarts 折线图设置折线线条为虚线

series: [{

name: '联盟广告',

type: 'line',

data: [100, 182, 111, 84, 90, 120, 250],

smooth: true,

itemStyle: {

normal: {

lineStyle: {

width: 2,

type: 'dashed' //'dotted'小圆点虚线 'solid'实线

}

}

},

}]

效果图如图所示

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值