echarts icon indicating copy to clipboard operation
echarts copied to clipboard

on('click) events don't work with rapid data updates.

Open ChristianRemwood opened this issue 4 years ago • 12 comments

Version

5.2.1

Steps to reproduce

Head to this example (https://echarts.apache.org/examples/en/editor.html?c=dynamic-data)

Change the update time from 2100 to 21

Attempt to click "Dynamic Bar" Legend text

What is expected?

The "Dynamic Bar" data should be toggled

What is actually happening?

There is a high likelihood that the data will not be toggled unless your mouse-down and mouse-up events happen under 21ms


I have temporarily fixed this on a local copy by changing the event type for "dispatchSelectAction" from click to mouseup. This is not ideal, but is enough for what I needed short term. ex: ( LegendView.ts: itemGroup.on('mouseup', curry(dispatchSelectAction, name, null, api, excludeSeriesId)) )

I have also discovered the issue seems to be with the generated javascript section "if(this._downEl!==this._upEl||!this._downPoint||Dt(this._downPoint,[e.zrX,e.zrY])>4)" in min.js.

Specifically the section 'this._downEl!==this._upEl'

After expanding the objects I can see they look nearly identical, but the parent sections are drastically different. I suspect the parent ID changes each time setOption() is called.

ChristianRemwood avatar Oct 11 '21 22:10 ChristianRemwood

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that it contains a minimum reproducible demo and necessary images to illustrate. Otherwise, our committers will ask you to do so.

A minimum reproducible demo should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.

You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe to our mailing list.

Have a nice day! 🍵

echarts-bot[bot] avatar Oct 11 '21 22:10 echarts-bot[bot]

May I ask in which scenio do you have this requirement? Do the data change as frequent as such?

Ovilia avatar Oct 13 '21 02:10 Ovilia

I am feeding the charts live data from several different sensors and the data needs to refresh every 10-20ms in order for us to not miss anything. The refresh rate seems to be no problem for most things, but the on click events don't work. The reason I need the on click elements to work in my use case is we need to toggle on and off several data sets to get a better picture of what's happening at all stages of our sensors processing.

On Tue, Oct 12, 2021, 7:15 PM Wenli Zhang @.***> wrote:

May I ask in which scenio do you have this requirement? Do the data change as frequent as such?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apache/echarts/issues/15861#issuecomment-941849805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AILLEFQUVYOXIWH3Q5D2YHTUGTTTNANCNFSM5FZGPSNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChristianRemwood avatar Oct 13 '21 04:10 ChristianRemwood

Hi, refreshing everying 10-20ms seems to be too frequent in most cases. Maybe you should first consider if you do need such frequent updates. The animation usually takes 500ms-1000ms to complete, so if you do update so frequently, you should consider switching off the animation by 'option.animation = false'. That being said, we should still look into the reason why the event is not triggered.

Ovilia avatar Oct 15 '21 02:10 Ovilia

I do have animations turned off already

On Thu, Oct 14, 2021, 8:50 PM Wenli Zhang @.***> wrote:

Hi, refreshing everying 10-20ms seems to be too frequent in most cases. Maybe you should first consider if you do need such frequent updates. The animation usually takes 500ms-1000ms to complete, so if you do update so frequently, you should consider switching off the animation by 'option.animation = false'. That being said, we should still look into the reason why the event is not triggered.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apache/echarts/issues/15861#issuecomment-943942769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AILLEFSBG4IQZLFJHSQQDJTUG6JGVANCNFSM5FZGPSNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChristianRemwood avatar Oct 15 '21 04:10 ChristianRemwood

I did also observe that other mouse events trigger no problem. It's just the click events. Also the click events do step down through the code, but they return early at the line of code I mentioned previously.

On Thu, Oct 14, 2021 at 8:50 PM Wenli Zhang @.***> wrote:

Hi, refreshing everying 10-20ms seems to be too frequent in most cases. Maybe you should first consider if you do need such frequent updates. The animation usually takes 500ms-1000ms to complete, so if you do update so frequently, you should consider switching off the animation by 'option.animation = false'. That being said, we should still look into the reason why the event is not triggered.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apache/echarts/issues/15861#issuecomment-943942769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AILLEFSBG4IQZLFJHSQQDJTUG6JGVANCNFSM5FZGPSNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- -Christian Remwood

ChristianRemwood avatar Oct 15 '21 14:10 ChristianRemwood

Is there any update to solve this?

omerbarda5 avatar May 18 '22 11:05 omerbarda5

I am facing the exact same issue. Is there any solution ?

jainsuneet avatar Dec 28 '22 14:12 jainsuneet

me too... when I update my real-time data by setInterval 250ms and I implement my zoom in/out/fit buttons in toolbox, lots of clicks are disappearing (didn't into toolbox.feature.myZoomIn.onclick) even click is just from a long idle time

obxyann avatar Apr 24 '24 05:04 obxyann

Same here. The problem persists.

akenverus avatar Sep 16 '24 15:09 akenverus