//使用echarts.graphic.LinearGradient控制台报错
// 默认的引入方式
import echarts from 'echarts
// 修改后的引入方式(默认的引入导出方式没有暴露echarts.graphic.LinearGradient相关功能)
import * as echarts from 'echarts'
...
itemStyle: {
normal: {
barBorderRadius: [0, 10, 10, 0],
color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [{
offset: 0,
color: "rgba(255, 149, 37, .7)" // 0% 处的颜色
}, {
offset: 0.2,
color: "rgba(254, 174, 19, .7)" // 60% 处的颜色
}, {
offset: 1,
color: "rgba(255, 188, 11, 1)" // 100% 处的颜色
}], false)
}
},