antvis / G2Plot

:dango: An interactive and responsive charting library based on G2.
https://g2plot.antv.antgroup.com
MIT License
2.56k stars 607 forks source link

🤔 请问水波球怎么设置渐变色(多色) #3356

Closed sunjiesama closed 1 year ago

sunjiesama commented 2 years ago

按照文档中的方法直接没有颜色了,是我哪里写的不对吗,还请大佬指教一下orz image

visiky commented 1 year ago

水波图没有 colorField 去做数据分组,设置渐变色用绘图属性的渐变色就行 文档

import { Liquid } from '@antv/g2plot';

const liquidPlot = new Liquid('container', {
  percent: 0.25,
  outline: {
    border: 4,
    distance: 8,
  },
  wave: {
    length: 128,
  },
  liquidStyle: {
    fill: 'l(90) 0:#1890ff 0.3:#ffffff 1:#7ec2f3 '
  }
});
liquidPlot.render();
image