-
Notifications
You must be signed in to change notification settings - Fork 649
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
官网饼图选中交互例子中,没有设置默认选中的属性吗? #248
Labels
Comments
稍等,这个属于合理的新功能,我支持一下。 |
3 tasks
3.2.1-beta.1 版本,使用方法: var data = [
{ name: '芳华', percent: 0.4, a: '1' },
{ name: '妖猫传', percent: 0.2, a: '1' },
{ name: '机器之血', percent: 0.18, a: '1' },
{ name: '心理罪', percent: 0.15, a: '1' },
{ name: '寻梦环游记', percent: 0.05, a: '1' },
{ name: '其他', percent: 0.12, a: '1' }
];
var chart = new F2.Chart({
id: 'mountNode',
pixelRatio: window.devicePixelRatio
});
chart.source(data, {
percent: {
formatter: function formatter(val) {
return val * 100 + '%';
}
}
});
chart.legend({
position: 'right',
marker: 'square'
});
chart.tooltip(false);
chart.coord('polar', {
transposed: true,
radius: 0.85,
innerRadius: 0.618
});
chart.axis(false);
chart
.interval()
.position('a*percent')
.color('name', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14', '#F04864', '#8543E0'])
.adjust('stack')
.style({
lineWidth: 1,
stroke: '#fff',
lineJoin: 'round',
lineCap: 'round'
});
chart.render();
chart.interaction('pie-select', {
animate: {
duration: 300,
easing: 'backOut'
},
defaultSelected: { name: '机器之血', percent: 0.18, a: '1' }, // 设置默认选中
}); |
@simaQ 手动好评 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: