antvis/G2


The issue has been closed
折线图 line 的默认主题样式中增加 lineCap: 'round' #5685
hustcc posted onGitHub
AntV Open Source Contribution Plan(可选)
- 我同意将这个 Issue 参与 OSCP 计划
Issue 难度
中等难度
任务介绍
主要有两个问题:
- 当数据只有一条的时候,当前 lineCap 默认为 butt,为导致看不到任何图形,设置为 round,可以默认一个半径为 lineWidth 的远点。
- 数据差异比较大的时候,round 不会显示出毛刺。
.style('lineCap', 'round')
主要修改方式,是在 theme 中入默认配置项。
详细介绍
No response
参考说明
调式代码
import { Chart } from "@antv/g2";
const chart = new Chart({
container: "container",
autoFit: true
});
chart
.line()
.data([{ genre: 'Sports', sold: 100 }])
.encode("x", "genre")
.encode("y", "sold")
.style('lineWidth', 4)
// .style('lineCap', 'round')
chart.render();