天天看點

echart series areaStyle 顔色不顯示

官方給的案例中,顔色都能正常顯示:

https://echarts.apache.org/examples/zh/editor.html?c=area-basic

echart series areaStyle 顔色不顯示

 可我做了一些嘗試都不能顯示顔色!

                    // areaStyle: {

                    //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{

                    //         offset: 0,

                    //         color: 'rgb(255, 158, 68)'

                    //     }, {

                    //         offset: 1,

                    //         color: 'rgb(255, 70, 131)'

                    //     }])

                    // },

會不會是版本問題?

package.json 檢視版本為 "echarts": "^3.8.5",

改為 "echarts": "^4.0.0",操作如下:

npm install  [email protected]

好了,顔色顯示出來了!

注意改成版本5.0.0 顔色也顯示不出來。

樹立目标,保持活力,gogogo!