antvis/G2

如图,在折线图上如何实现点击折线上一个点后,保留tooltip的那根线以及展示x轴坐标在最顶端;以及如何修改提示点的样式为一个空心圆,提示线为虚线 #5999

asz97665 posted onGitHub

问题描述

tooltip样式

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


在折线图上如何实现点击折线上一个点后,保留tooltip的那根线以及展示x轴坐标在最顶端

这个没有办法内置实现,期望这个效果可以自己自定义交互

如何修改提示点的样式为一个空心圆

这个能力还没有,感兴趣提一个 PR 吗?比如

chart.interaction("tooltip", { markerType: 'hollow' })

提示线为虚线

chart.interaction("tooltip", { crosshairsLineDash: [3, 4] })
posted by pearmini over 1 year ago

大佬,想问下,crossharisLineDash: [3,4] 这个数组表示的含义是什么呢

posted by Runtus 11 months ago

@Runtus [3, 4] 中3表示线段的长度,4表示线段之间的间距,可以看看这里的解释

posted by pearmini 11 months ago

我认领这个任务

posted by Runtus 11 months ago

@Runtus 这个算一个中级任务!

posted by pearmini 11 months ago

@pearmini 老哥,需要改下官网文档描述吗,因为markerType属于marker${StyleAttrs}中的,如果不特殊说明一下话,用户可能无法感知markerType: "hollow"的存在。

posted by Runtus 11 months ago

@Runtus 可以的

posted by pearmini 10 months ago

Fund this Issue

$0.00
Funded

Pull requests