apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.1k stars 19.6k forks source link

Zoom with drag #13397

Open Bilge opened 3 years ago

Bilge commented 3 years ago

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.

echarts-bot[bot] commented 3 years ago

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 dev@echarts.apache.org. 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! 🍵

pissang commented 3 years ago

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

fmmattioni commented 3 years ago

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

tamersalama commented 3 years ago

It'd be great to activate this by default

Bilge commented 3 years ago

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

throrin19 commented 3 years ago

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)

AmirAsghary commented 3 years ago

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

throrin19 commented 3 years ago

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,
    });
ruisebastiao commented 3 years ago

+1

heng4 commented 2 years ago

+1

MeetzhDing commented 2 years ago

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

Bilge commented 2 years ago

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

DaveMDS commented 1 year ago

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 :)

thorrak commented 1 year ago

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

oyvindi commented 1 year ago

ditto, need this as well !

fnlombard commented 1 year ago

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

vildantursic commented 11 months ago

+1

tobias-eberle commented 10 months ago

+1

eskwisit commented 8 months ago

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

slymnozdmrc commented 7 months ago

+1

c3-ryanlittle commented 4 months ago

+1