vue-echarts-v3使用的过程中折线图区域呈渐变色。

https://img3.mukewang.com/5c0f68010001ad6c02760095.jpg

这是我的图表数据

我希望红色部分是渐变色。
我已经使用了visvisualMap的方法,并不能达到我想要的效果。
当我使用new echarts.graphic.LinearGradient(0, 0, 0, 1, [{

                    offset: 0,
                    color: 'rgb(255, 158, 68)'
                }, {
                    offset: 1,
                    color: 'rgb(255, 70, 131)'
                }])。。。我找到的其中一种方法,。。但是不知道怎么获取echarts对象,

由于不想在项目中引入过多的资源,所以引入zRender暂时不在考虑范围之内。。。
求助
希望解决vue-echarts-v3插件使用是,获取new echarts.graphic.LinearGradient()的办法

<IEcharts :option="bar" class="step_echarts"></IEcharts


https://img.mukewang.com/5c0f68230001188e04870510.jpg

慕无忌1623718
浏览 4720回答 1
1回答

慕仙森

我随便写了三个颜色。series: [{&nbsp; &nbsp; &nbsp; &nbsp; name: 'Clouds',&nbsp; &nbsp; &nbsp; &nbsp; type: 'line',&nbsp; &nbsp; &nbsp; &nbsp; data: [5, 7, 13, 20, 30],&nbsp; &nbsp; &nbsp; &nbsp; areaStyle: {normal:{}},&nbsp; &nbsp; &nbsp; &nbsp; itemStyle: {&nbsp; &nbsp; &nbsp; &nbsp; normal: {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: new echarts.graphic.LinearGradient(&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0, 0, 0, 1,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {offset: 0, color: 'red'},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {offset: 0.5, color: 'pink'},&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {offset: 1, color: '#ddd'}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }}]
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript