2 个回答

题主是要给柱状图加渐变色吗?
加渐变色可以看下面的代码。

itemStyle: {
     normal: {
         color: new echarts.graphic.LinearGradient(
             0, 1, 1, 1,
             [
                 {offset: 0, color: '#b0c2f9'},     //渐变头部色
                 {offset: 0.5, color: '#188df0'},
                 {offset: 1, color: '#185bff'}
             ]
         )
     },
     emphasis: {
         color: new echarts.graphic.LinearGradient(
             0, 1, 1, 1,
             [
                 {offset: 0, color: '#b0c2f9'},
                 {offset: 0.7, color: '#e6b600'},
                 {offset: 1, color: '#ceac09'}
             ]
         )
     }
  }
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏