You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Joe Hudson <jo...@gmail.com> on 2022/10/06 15:38:23 UTC

is it possible to add an event handler for legend right click and have access to the series that was clicked

The purpose of this is to add a custom, series specific context menu so if
there is an alternative more context menu-y way of doing this I'd go with
whatever is the suggested approach.  Thanks very much for the guidance.

Re: is it possible to add an event handler for legend right click and have access to the series that was clicked

Posted by Joe Hudson <jo...@gmail.com>.
Thank you so much for the reply. I'm not quite sure how I would go about
knowing which series was clicked on.  Would you be able to direct me to an
example that does this sort of thing?  Thanks!

Joe


On Sun, Oct 9, 2022, 3:09 AM Ovilia <ov...@gmail.com> wrote:

> Hi,
> Legend is designed to toggle the displaying of series. Using right
> clicking is hard for the users to discover this interaction so this may
> probably be a good idea.
> That being said, if you wish to do such a feature, you should listen to
> the canvas for the right click event and check the click position to
> calculate which legend item is being clicked.
>
> Thanks
>
> *Ovilia*
>
>
> On Fri, Oct 7, 2022 at 12:18 AM Joe Hudson <jo...@gmail.com> wrote:
>
>> The purpose of this is to add a custom, series specific context menu so if
>> there is an alternative more context menu-y way of doing this I'd go with
>> whatever is the suggested approach.  Thanks very much for the guidance.
>>
>

Re: is it possible to add an event handler for legend right click and have access to the series that was clicked

Posted by Ovilia <ov...@gmail.com>.
Hi,
Legend is designed to toggle the displaying of series. Using right clicking
is hard for the users to discover this interaction so this may probably be
a good idea.
That being said, if you wish to do such a feature, you should listen to the
canvas for the right click event and check the click position to calculate
which legend item is being clicked.

Thanks

*Ovilia*


On Fri, Oct 7, 2022 at 12:18 AM Joe Hudson <jo...@gmail.com> wrote:

> The purpose of this is to add a custom, series specific context menu so if
> there is an alternative more context menu-y way of doing this I'd go with
> whatever is the suggested approach.  Thanks very much for the guidance.
>