We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
现在饼图只能根据data展示,希望能有按照弧度的排序
No response
The text was updated successfully, but these errors were encountered:
可以给 stackY 加配置参数:
import { Chart } from '@antv/g2'; const data = [ { item: '事例五', count: 9, percent: 0.09 }, { item: '事例一', count: 40, percent: 0.4 }, { item: '事例二', count: 21, percent: 0.21 }, { item: '事例三', count: 17, percent: 0.17 }, { item: '事例四', count: 13, percent: 0.13 }, ]; const chart = new Chart({ container: 'container', autoFit: true, }); chart.coordinate({ type: 'theta', outerRadius: 0.8 }); chart .interval() .data(data) .transform({ type: 'stackY', orderBy:'value', reverse:true }) // 这里 .encode('y', 'percent') .encode('color', 'item') .legend('color', { position: 'bottom', layout: { justifyContent: 'center' } }) .label({ position: 'outside', text: (data) => `${data.item}: ${data.percent * 100}%`, }) .tooltip((data) => ({ name: data.item, value: `${data.percent * 100}%`, })); chart.render();
Sorry, something went wrong.
No branches or pull requests
问题描述
现在饼图只能根据data展示,希望能有按照弧度的排序
重现链接
No response
重现步骤
No response
预期行为
No response
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: