参考效果如图
配置项中需要注意的几个要点:
1. 颜色取值需要有范围,以突出立体感
2. 对于需要堆叠的数据,设置相同stack
3. 对于pictorialBar类型的图,数据大小和图形显示位置通过data和symbolPosition: 'end',symbolOffset: [0, '50%'],symbolSize: [barWidth, 10]进行调整
4. symbol: 'diamond'展示的是菱形图形,其他类型的可以参考官网配置项
示例代码如下:
const colors = [
{
type: 'linear',
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [{ offset: 0, color: '#23D67D' }, { offset: 0.5, color: '#23D67D' }, { offset: 0.5, color: '#0BBE65' }, { offset: 1, color: '#0BBE65' }]
},
{
type: 'linear',
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [{ offset: 0, color: '#3370FF' }, { offset: 0.5, color: '#337