echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Help Me, I want to achieve this effect

Open mengyouxian opened this issue 3 years ago • 9 comments

What problem does this feature solve?

3361652077210_ pic

What does the proposed API look like?

我想要这样的效果,x轴上可以显示头像。目前我使用散点图+折线图可以实现。但是头像只能使用path 放大和缩小才不会变形,有点不太友好。这个暂且都是小事。我最大的问题是点击头像后在头像上方打开dialog ,这种复杂的结构,目前echarts有什么办法可以实现吗?graphic 可能可以实现简单的效果?但是在弹出后再实现交互就做不了了吧。有没有好的办法?求助……

mengyouxian avatar May 09 '22 06:05 mengyouxian

@mengyouxian It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

BODY

What problem does this feature solve?

3361652077210_ pic

What does the proposed API look like?

I want to have an effect where the avatar can be displayed on the x-axis. Currently I can achieve using scatter chart + line chart. But the avatar can only use path to zoom in and out without deformation, which is a bit unfriendly. This is a small thing for now. My biggest question is to open the dialog above the avatar after clicking on the avatar. Is there any way to achieve this complex structure with echarts? graphic Maybe a simple effect can be achieved? But it can't be done interactively after popping up. Is there a good way? help...

echarts-bot[bot] avatar May 09 '22 06:05 echarts-bot[bot]

Why not use HTML to do this? It's more flexible and easy. Just create an HTML element with an absolute position.

plainheart avatar May 09 '22 06:05 plainheart

嗯 ,用H TML 也有考虑过。用HTML 主要就是位置的问题,点击是echarts canvas上的位置,然而使用HTML然后定位的话是相对于整个页面了,希望弹框能在类似头像的正上方这种位置。仍然在图表x轴上方位置。这个问题有解决办法吗?

mengyouxian avatar May 09 '22 07:05 mengyouxian

然而使用HTML然后定位的话是相对于整个页面了

这句话不对。你可以将 HTML 元素添加到 echarts 容器里面,并为其设置绝对定位,这样就不会是相对于整个页面。

plainheart avatar May 09 '22 07:05 plainheart

不好意思,请问"将 HTML 元素添加到 echarts 容器里面",有示例吗?

mengyouxian avatar May 09 '22 07:05 mengyouxian

示例在这,基本实现了下。

plainheart avatar May 09 '22 07:05 plainheart

非常感谢🙏,,我研究研究

mengyouxian avatar May 09 '22 08:05 mengyouxian

对了,如果你代码已经设置了 grid 的 left、top、bottom、right 参数,可以不用像示例里面那么复杂地获取 x 轴的位置,直接使用你定义的固定数值即可。

plainheart avatar May 09 '22 08:05 plainheart

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar May 08 '24 21:05 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar May 16 '24 21:05 github-actions[bot]