You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Wenli Zhang <ov...@gmail.com> on 2018/10/25 05:53:51 UTC

[Improvement] Click event triggering

When user listens click event using:

chart.on('click', function() {...})

It only receives message when the click is on the series item.
In the case of line charts, it only triggers when clicks on the small
symbol on the line.

But for line charts that with axisPointer or tooltip of 'axis' type (e.g.:
http://gallery.echartsjs.com/editor.html?c=xSJfK8-MCo&v=2 ), this may not
make sense.
It is expected that click event is triggered whenever clicking inside grid
area, or maybe whenever tooltip or axisPointer is shown.
This is extremely useful on mobile since currently click can almost never
triggered except that touch exactly on the symbol item.

Another thing is, it is also often requested that clicks on other
components, like axis label, title, and etc. should also be triggered and
can be listened by users.


Zhang Wenli
http://zhangwenli.com

Re: [Improvement] Click event triggering

Posted by Wenli Zhang <ov...@gmail.com>.
Hi Shuang,

I think it a good idea to expose mouse events on *grid*. By mouse events, I
mean something like mouseenter, mousemove, mouseleave and etc.
Recently we got this issues asking exactly the same thing:
https://github.com/apache/incubator-echarts/issues/9281 .

We should probably provide events on grid first, and later on, we can also
provide events on other components.


Zhang Wenli
http://zhangwenli.com


On Thu, Oct 25, 2018 at 3:00 PM SHUANG SU <su...@gmail.com> wrote:

> (1)
> In this case, should we resolve it by just exposing mouse events of "grid"?
>
>
> (2)
> The click event have been exposed on "axis label" and "title".
> But not by defualt, for old version compatibility reasons.
> see:
>
> https://ecomfe.github.io/echarts-doc/public/en/option.html#yAxis.triggerEvent
>
> https://ecomfe.github.io/echarts-doc/public/en/option.html#title.triggerEvent
>
> But "Other components trigger events" is necessary.
> We have been gradually exposing some events for components,
> like "axis", "title", But not enough.
>
>
>
>
> ------------------------------
>  Su Shuang (100pah)
> ------------------------------
>
>
>
> On Thu, 25 Oct 2018 at 13:54, Wenli Zhang <ov...@gmail.com> wrote:
>
> > When user listens click event using:
> >
> > chart.on('click', function() {...})
> >
> > It only receives message when the click is on the series item.
> > In the case of line charts, it only triggers when clicks on the small
> > symbol on the line.
> >
> > But for line charts that with axisPointer or tooltip of 'axis' type
> (e.g.:
> > http://gallery.echartsjs.com/editor.html?c=xSJfK8-MCo&v=2 ), this may
> not
> > make sense.
> > It is expected that click event is triggered whenever clicking inside
> grid
> > area, or maybe whenever tooltip or axisPointer is shown.
> > This is extremely useful on mobile since currently click can almost never
> > triggered except that touch exactly on the symbol item.
> >
> > Another thing is, it is also often requested that clicks on other
> > components, like axis label, title, and etc. should also be triggered and
> > can be listened by users.
> >
> >
> > Zhang Wenli
> > http://zhangwenli.com
> >
>

Re: [Improvement] Click event triggering

Posted by SHUANG SU <su...@gmail.com>.
(1)
In this case, should we resolve it by just exposing mouse events of "grid"?


(2)
The click event have been exposed on "axis label" and "title".
But not by defualt, for old version compatibility reasons.
see:
https://ecomfe.github.io/echarts-doc/public/en/option.html#yAxis.triggerEvent
https://ecomfe.github.io/echarts-doc/public/en/option.html#title.triggerEvent

But "Other components trigger events" is necessary.
We have been gradually exposing some events for components,
like "axis", "title", But not enough.




------------------------------
 Su Shuang (100pah)
------------------------------



On Thu, 25 Oct 2018 at 13:54, Wenli Zhang <ov...@gmail.com> wrote:

> When user listens click event using:
>
> chart.on('click', function() {...})
>
> It only receives message when the click is on the series item.
> In the case of line charts, it only triggers when clicks on the small
> symbol on the line.
>
> But for line charts that with axisPointer or tooltip of 'axis' type (e.g.:
> http://gallery.echartsjs.com/editor.html?c=xSJfK8-MCo&v=2 ), this may not
> make sense.
> It is expected that click event is triggered whenever clicking inside grid
> area, or maybe whenever tooltip or axisPointer is shown.
> This is extremely useful on mobile since currently click can almost never
> triggered except that touch exactly on the symbol item.
>
> Another thing is, it is also often requested that clicks on other
> components, like axis label, title, and etc. should also be triggered and
> can be listened by users.
>
>
> Zhang Wenli
> http://zhangwenli.com
>