Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置波形颜色为渐变色的话,有些是渐变色有些就是纯色 #3711

Open
97702573 opened this issue Nov 30, 2023 · 4 comments
Open

Comments

@97702573
Copy link

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

const liquidPlot = new Liquid('container', {
percent: 0.25,
outline: {
border: 4,
distance: 8,
},
wave: {
count:8,
length: 128,
},
liquidStyle: {
"fill": "l(180) 0:#B4EC51 1:#429321 1:#B4EC51",
"stroke": "l(90) 0.01:#61a8ff 0.82:rgba(28, 129, 255, 0) 0.08:rgba(28, 129, 255, 0.75)",
"show": true,
"shadowColor": "#1c47ff",
"shadowBlur": 36,
"shadowOffsetX": 0,
"shadowOffsetY": 0
}
});
liquidPlot.render();
这是我的代码,fill设置为渐变色,但实际上看着是纯色

@pearmini pearmini transferred this issue from antvis/G2 Nov 30, 2023
@pearmini
Copy link
Member

pearmini commented Nov 30, 2023

还是可以渐变的,只不过需要调整一下参数:

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

const liquidPlot = new Liquid('container', {
  percent: 0.25,
  outline: {
    border: 4,
    distance: 8,
  },
  wave: {
    count: 8,
    length: 128,
  },
  liquidStyle: {
    fill: 'l(180) 0.2:#ff0000 0.8:#61a8ff',
    stroke:
      'l(90) 0.01:#61a8ff 0.82:rgba(28, 129, 255, 0) 0.08:rgba(28, 129, 255, 0.75)',
    show: true,
    shadowColor: '#1c47ff',
    shadowBlur: 36,
    shadowOffsetX: 0,
    shadowOffsetY: 0,
  },
});

liquidPlot.render();

@97702573
Copy link
Author

你给我的,和我给你的fill颜色不一样呀。我的fill是: l(180) 0:#B4EC51 1:#429321

@97702573
Copy link
Author

@pearmini

@pearmini
Copy link
Member

@97702573 你自己调整一下 #B4EC5 和 #429321 前面的数值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants