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

两个水波纹特效,再开发者工具上没问题,但是再真机测试环境上只显示一个请问这是什么问题 #157

Open
yandasuai opened this issue Feb 11, 2022 · 0 comments

Comments

@yandasuai
Copy link

setOption(value) {
const option = {
series: [{
type: 'liquidFill',
data: [{
value: 0.95,
amplitude: '4.5%', //波浪幅度
direction: 'left', //方向
waveLength: '160%', //波浪大小
radius: '100%', //半径
itemStyle: {
color: {
x: 1,
y: 0.8,
r: 0.5,
colorStops: [{
// offset: 1,
color: '#79E8DD' // 0% 处的颜色
}, ],
},
opacity: 0.7,
shadowBlur: 0
}
},
{
value: 0.95,
direction: 'right', //方向
amplitude: '4.5%', //波浪幅度
waveLength: '160%', //波浪大小
radius: '100%', //半径
itemStyle: {
color: {
x: 1,
y: 0.8,
r: 0.5,
colorStops: [{
offset: 0.3,
color: '#3D6FFB' // 0% 处的颜色
}, {
offset: 0.9,
color: '#75FFDA' // 100% 处的颜色
}],
},
opacity: 0.6,
shadowBlur: 0
}
}
],
backgroundStyle: {
borderWidth: 5,
color: '#F8F8F8'
},
shape: 'arrow', //形状
backgroundColor: '#fff',
center: ['50%', '50%'],
animationDuration: 0,
shape: 'container',
center:['50%','50%'],
outline: {
show: false,
},
label: {
show: false,
}
}]
};
return option
},
initCharts: function (value) {
let setOption = this.setOption
this.ecComponent.init((canvas, width, height, dpr) => {
// 获取组件的 canvas、width、height 后的回调函数
// 在这里初始化图表
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr
});
let data = [value, value, value, ];
chart.setOption(setOption(value, data));
// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
this.chart = chart;
// 注意这里一定要返回 chart 实例,否则会影响事件处理等
return chart;
});
},

html



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

1 participant