echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Zoom with drag

Open Bilge opened this issue 3 years ago • 21 comments

What problem does this feature solve?

Currently we need to attach a dataZoom component to zoom. This enables either widget zooming or mouse wheel zooming, but it does not support left-click drag zooming, which seems more intuitive and precise. That is, it is easier to zoom into the data you want by highlighting it directly, rather than controlling a separate widget (which is cumbersome) or using a mouse wheel (which is imprecise).

What does the proposed API look like?

See live example.

Bilge avatar Oct 07 '20 15:10 Bilge

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 you have posted enough image to demo your request. 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 questions.

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

Have a nice day! 🍵

echarts-bot[bot] avatar Oct 07 '20 15:10 echarts-bot[bot]

Hi @Bilge. We have a toolbox component to support the zoom by brush feature.

https://echarts.apache.org/examples/zh/editor.html?c=line-tooltip-touch

It can be turned on by clicking

image

But I think having it in the dataZoom component is also necessary. Will plan it in the feature

pissang avatar Oct 09 '20 02:10 pissang

Any news if it is already possible to zoom in when dragging? Or perhaps to turn on the zoom feature by default?

fmmattioni avatar Jan 29 '21 11:01 fmmattioni

It'd be great to activate this by default

tamersalama avatar Feb 07 '21 07:02 tamersalama

@pissang Can we get this issue included in an upcoming milestone?

Bilge avatar Feb 19 '21 10:02 Bilge

It's possible to activate this by default without toolbox configured or showed ? In out case we want zoom on dragging by default in our charts (like grafana)

throrin19 avatar Mar 18 '21 13:03 throrin19

+1 it is very much needed. I believe it offers better UX as well

AmirAsghary avatar Apr 06 '21 10:04 AmirAsghary

I made a hack to do this. If someone is interrested, I made this like that :

  1. In Options, I initiate toolbox and I set buttons with empty path to not show them :
    toolbox : {
        orient   : 'vertical',
        itemSize : 13,
        top      : 15,
        right    : -6,
        feature  : {
            dataZoom : {
                yAxisIndex  : 'none',
                icon        : {
                    zoom : 'path://', // hack to remove zoom button
                    back : 'path://', // hack to remove restore button
                },
            },
        },
    },
    
  2. When chart is available, I dispatch action to activate toolbox zoom (in my case, the toolbox action is already dispatch when finished event is fired) :
    chartInst.dispatchAction({
        type                    : 'takeGlobalCursor',
        key                     : 'dataZoomSelect',
        dataZoomSelectActive    : true,
    });
    

throrin19 avatar Apr 07 '21 12:04 throrin19

+1

ruisebastiao avatar Apr 30 '21 21:04 ruisebastiao

+1

heng4 avatar Sep 30 '21 07:09 heng4

Can we get this issue included in an upcoming milestone? @pissang

MeetzhDing avatar Mar 31 '22 15:03 MeetzhDing

...it is... 👉🏻 🏁 5.3

Bilge avatar Mar 31 '22 15:03 Bilge

Hi, we are at 5.4 and still cannot find an easy way to activate the drag-to-zoom by default. I also thing this would be a great usability improvement, all my clients try that type of zoom at first Thanks :)

DaveMDS avatar Dec 06 '22 11:12 DaveMDS

+1 on this - definitely interested if it was to be made available!

thorrak avatar May 29 '23 15:05 thorrak

ditto, need this as well !

oyvindi avatar Jun 08 '23 11:06 oyvindi

I also require this. I am using eCharts to build a UI for a spectrum analyser.

fnlombard avatar Jul 17 '23 08:07 fnlombard

+1

vildantursic avatar Sep 19 '23 10:09 vildantursic

+1

tobias-eberle avatar Nov 08 '23 14:11 tobias-eberle

I'm pretty sure PR are welcomed, aren't they ? 🙄

eskwisit avatar Jan 09 '24 13:01 eskwisit

+1

slymnozdmrc avatar Feb 06 '24 08:02 slymnozdmrc

+1

c3-ryanlittle avatar Apr 21 '24 04:04 c3-ryanlittle