You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Colby Wall <co...@hitachivantara.com.INVALID> on 2023/03/17 15:43:38 UTC

Echarts markline events

Hi Echarts devs!

I'm running into a brick wall with documentation and finding no similar question online to what I'm looking for so I hope you have an answer for me. I'm looking to add a mouseover event to marklines in my chart. Is this possible and what documentation should I look at to make this work? I'm currently using vue-echarts-v3.

Thanks for any help,
Colby Wall

Re: Echarts markline events

Posted by Ovilia <ov...@gmail.com>.
Hi,

I'm afraid that markline events are not supported for Apache ECharts.
But here is how you can hack with it.
const zr = myChart.getZr();
zr.on('click', params => console.log(params));

The `params.target` is the element you clicked. We cannot know directly if
it's a markline, but you can detect it by some extra information like if
it's dashed.

I made a demo [1] for you.

[1]
https://echarts.apache.org/examples/zh/editor.html?c=line-marker&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQAqOAtiDgE4CGYArkzrAMIAWLaAHNuEOGD7cewOmKGwA6jhwBrSkQC-AGiJhgwLJBAFUxDEwhCRTKi1IQAzuvTaiuEdAAmJ1-j0GAI2BSEyJ0Bz5gAHcCMCZ2HB0zADMcNk58QjN0TzYWAC19OlDs4gBPAEF7BwBJLzIqaBgcZ2zfbNywFgA1CBwY5FguFk8AeWgsMoJkliwHbnazOhYhCABjajLGEwwtzIBtSiwxFq1YSgCWJkoAXVhF4i4HPS4fJOyHFgA3HAra5ZEPjC90071IVUcJWIYD2VDWbBwQmATDKlHe6CC7C8VzKAHEWMZYDM5olgZ0WARDgBZGBo87UBJ0yhKTxM6h8dhMgBiFiZAGU2PysbdQURKtUoX5YecvrNGejYHZHAAZFgBHBYSXEZLI5ZgMDMKhIWVYBIaWAABp4rRcovCzD6DkpwNM2WgLDomUoAAlLJJnmjgVLtudjtBTkHYOTKQBGAAMZxjMcTAGZE8nYDGAEyJnOwACcNwV6GWTBUAAVgGIKFlSlG8s668QkLsQ5RlqQ6e7PVQqXZKPdi9kWzC27JoF2PV6qWIBxpI-gbpGHiWriplSctWZo7B9iPpZRvswVqdYN2vRUvkI50vSvOzA9XWZz1RldEcAGh6OvWGI6Ud_sGYALR5nmACsZxprAeZxkWkalhWVbQDWT4dA2u4ti-5yABYqgAA5oAcvJ0iaCQECBZzghKmZnOKkKwEBMYAHRgfct5tEOCEbuGW7EABC7Nq2XpHqwIiTj25yXteg58eg-zSc2clmA4ZR0EEmrnE04aBk2pQhOc-ZxgApFp2lmDRTrnB2NraSudaoSZSkqQYcIQEway4MZJnoFgaoatxJkgMADgQJAMBUM8VxgB5nnoDqTB6gaNjnH2nYKcQNlNt-VCWUOTZYZQuGABtZgCdDlZTb3tprGlJVaXAuVS4aAA3CgKBrDAzywAAXkwCCwHQZT8BFDEiGA-RMAAFAAlE1XUMTAY2UG56xqGcIBXB6DgIAAfLArXQA4Bg4AxWDAEIY2rawdAOBNU1AA

Thanks

*Ovilia*


On Mon, Mar 20, 2023 at 3:22 PM Colby Wall
<co...@hitachivantara.com.invalid> wrote:

> Hi Echarts devs!
>
> I'm running into a brick wall with documentation and finding no similar
> question online to what I'm looking for so I hope you have an answer for
> me. I'm looking to add a mouseover event to marklines in my chart. Is this
> possible and what documentation should I look at to make this work? I'm
> currently using vue-echarts-v3.
>
> Thanks for any help,
> Colby Wall
>