慕無忌1623718
2018-11-06 13:14:47
這是我的圖表數(shù)據(jù)我希望紅色部分是漸變色。我已經(jīng)使用了visvisualMap的方法,并不能達(dá)到我想要的效果。當(dāng)我使用new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0,
color: 'rgb(255, 158, 68)'
}, {
offset: 1,
color: 'rgb(255, 70, 131)'
}])。。。我找到的其中一種方法,。。但是不知道怎么獲取echarts對(duì)象,由于不想在項(xiàng)目中引入過多的資源,所以引入zRender暫時(shí)不在考慮范圍之內(nèi)。。。求助希望解決vue-echarts-v3插件使用是,獲取new echarts.graphic.LinearGradient()的辦法<IEcharts :option="bar" class="step_echarts"></IEcharts
1 回答

慕仙森
TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超8個(gè)贊
我隨便寫了三個(gè)顏色。
series: [{
name: 'Clouds',
type: 'line',
data: [5, 7, 13, 20, 30],
areaStyle: {normal:{}},
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: 'red'},
{offset: 0.5, color: 'pink'},
{offset: 1, color: '#ddd'}
]
)
}
}
}]
添加回答
舉報(bào)
0/150
提交
取消