G2Plot
G2Plot copied to clipboard
🐛 [BUG] 如果brush宽度过大,会导致线段重叠
🐛 Bug description [Please make everyone to understand it]
以此情况作为brush的空间:
brush结果如下,部分线段被重叠了:
但是如果选取空间较小还是正常的,效果如下:
Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction.
📷 Step to reproduce
配置图表的代码如下:
;(async function () {
const data = await getTag(props.sources[0])
chart = new Line(g2.value, {
data,
padding: 'auto',
xField: 'step',
yField: 'data',
// 坐标轴相关
xAxis: {
// type: 'timeCat',
tickCount: 5 // 设置坐标轴刻度数量,防止数据过多导致刻度过密
},
yAxis: {},
// 大小相关
height: 200,
autoFit: true,
// 开启一些交互
interactions: [{ type: 'brush-x' }],
// 样式相关
// smooth: true, // 平滑曲线
color: experimentColor.value
})
chart.render()
})()
data的数据结构类似:
[
{
step:1,
data: 1
},
....
]
🏞 Expected result
我希望线段不要被重叠