We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
官网给的例子,迷你面积图的高度设置为 30px,面积图就不能正常绘制了 https://g2.antv.antgroup.com/zh/examples/general/mini/#area
No response
import { Chart } from '@antv/g2';
const data = [ 264, 417, 438, 887, 309, 397, 550, 575, 563, 430, 525, 592, 492, 467, 513, 546, 983, 340, 539, 243, 226, 192, ];
const chart = new Chart({ container: 'container', width: 480, height: 30, // 这里 });
chart.data(data);
chart .area() .encode('x', (_, idx) => idx) .encode('y', (d) => d) .encode('shape', 'smooth') .scale('y', { zero: true }) .style('fill', 'linear-gradient(-90deg, white 0%, darkgreen 100%)') .style('fillOpacity', 0.6) .animate('enter', { type: 'fadeIn' }) .axis(false);
chart.interaction('tooltip', { render: (e, { title, items }) => items[0].value, });
chart.render();
The text was updated successfully, but these errors were encountered:
把 padding margin 都设置为 0 吧,应该有一个默认 16px 的值。所以小于 32px 的时候,画布区域实际就位 0 了。
padding: 0, margin: 0,
Sorry, something went wrong.
No branches or pull requests
问题描述
官网给的例子,迷你面积图的高度设置为 30px,面积图就不能正常绘制了
https://g2.antv.antgroup.com/zh/examples/general/mini/#area
重现链接
No response
重现步骤
import { Chart } from '@antv/g2';
const data = [
264, 417, 438, 887, 309, 397, 550, 575, 563, 430, 525, 592, 492, 467, 513,
546, 983, 340, 539, 243, 226, 192,
];
const chart = new Chart({
container: 'container',
width: 480,
height: 30, // 这里
});
chart.data(data);
chart
.area()
.encode('x', (_, idx) => idx)
.encode('y', (d) => d)
.encode('shape', 'smooth')
.scale('y', { zero: true })
.style('fill', 'linear-gradient(-90deg, white 0%, darkgreen 100%)')
.style('fillOpacity', 0.6)
.animate('enter', { type: 'fadeIn' })
.axis(false);
chart.interaction('tooltip', {
render: (e, { title, items }) => items[0].value,
});
chart.render();
预期行为
No response
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: