wx-f2
wx-f2 copied to clipboard
环形图不完整
@antv/wx-f2版本:2.1.0
微信小程序开发工具版本: 1.03.2006192
init代码
`onInitChart(F2, config) {
const data = [{
name: '股票类',
percent: 30,
a: '1'
}, {
name: '债券类',
percent: 20,
a: '1'
}, {
name: '现金类1',
percent: 20,
a: '1'
}, {
name: '现金类2',
percent: 10,
a: '1'
}, {
name: '现金类3',
percent: 10,
a: '1'
}, {
name: '现金类4',
percent: 10,
a: '1'
}, {
name: '现金类4',
percent: 10,
a: '1'
}];
const map = {};
data.forEach(function(obj) {
map[obj.name] = obj.percent + '%';
});
console.log(config);
const chart = new F2.Chart(config);
chart.source(data, {
percent: {
formatter: function formatter(val) {
return val + '%';
}
}
});
chart.tooltip(false);
chart.legend({
position: 'right',
itemFormatter: function itemFormatter(val) {
return val + ' ' + map[val];
}
});
chart.coord('polar', {
transposed: true,
innerRadius: 0.7,
radius: 0.85
});
chart.axis(false);
chart.interval()
.position('a*percent')
.color('name', [ '#FE5D4D', '#3BA4FF', '#737DDE' ])
.adjust('stack');
chart.render();
return chart;
}
}` changeData相同的数据后就会出现,或者不changeData,点击legend时也会出现环形图断开的情况
我也遇到了,咋解决的,也没个记录
我试过了,这个估计是chageData的bug,每次都clear重绘就好了,暂时先这么解决