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
https://antv-g2.gitee.io/zh/examples/case/pie#pie3
直接粘贴如下代码运行即可:
import { Chart } from '@antv/g2';
const data = [ { type: '一线城市', value: 3 }, { type: '二线城市', value: 4 }, ]; const chart = new Chart({ container: 'container', autoFit: true, height: 500, }); chart.data(data);
chart.coordinate('theta', { radius: 0.75 }); chart.tooltip({ showMarkers: false });
chart.scale('value', {nice: true});
const interval = chart .interval() .adjust('stack') .position('value') .color('type')
chart.interaction('element-single-selected');
chart.render();
The text was updated successfully, but these errors were encountered:
你为啥要设置 nice ?
Sorry, something went wrong.
我看v3版本不是默认nice=true吗?在v4版本设置了就会有问题
不设置吧,对饼图,nice 并没有意义~ v4 的 nice 和 v3 的不一样了~~~
有啥不一样,愿闻其详~
nice 的目的是为了生成可读性强的坐标刻度(1,2,5的倍数),nice 之后会调整数据的范围,用于生成合适的 ticks,比较典型的使用场景是折线图、条形图图的 y 轴。饼图这种情况不需要坐标刻度,所以不需要 nice。
No branches or pull requests
Reproduction link
https://antv-g2.gitee.io/zh/examples/case/pie#pie3
Steps to reproduce
直接粘贴如下代码运行即可:
import { Chart } from '@antv/g2';
const data = [
{ type: '一线城市', value: 3 },
{ type: '二线城市', value: 4 },
];
const chart = new Chart({
container: 'container',
autoFit: true,
height: 500,
});
chart.data(data);
chart.coordinate('theta', {
radius: 0.75
});
chart.tooltip({
showMarkers: false
});
chart.scale('value', {nice: true});
const interval = chart
.interval()
.adjust('stack')
.position('value')
.color('type')
chart.interaction('element-single-selected');
chart.render();
The text was updated successfully, but these errors were encountered: