echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Lines and mark areas disappear during zooming

Open dthunn opened this issue 4 years ago • 11 comments

Version

5.1.1

Steps to reproduce

While zooming on line graphs the lines break apart, this is same issue as https://github.com/apache/echarts/issues/3637. I have decided to submit this issue because that one is closed but the issue definitely still exists.

What is expected?

Lines stay connected after zooming.

What is actually happening?

Lines become disconnected while zooming


This issue has being going on for years it looks like, any help or a fix would be great.

dthunn avatar Apr 28 '21 17:04 dthunn

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 our mailing list.

Have a nice day! 🍵

echarts-bot[bot] avatar Apr 28 '21 17:04 echarts-bot[bot]

I have found the issue that causes it on my end, having yAxis type set to 'log' causes the bug, if I remove it, everything is fine. I would definitely like to keep the log scale on the y-axis is anyone has any ideas.

dthunn avatar Apr 28 '21 19:04 dthunn

I indeed believe this issue still exists: markLines defined by two points disappear when zooming in, as at least one of the points is out of the zoomed window, and even with the filterMode: 'none' option.

A possible workaround could be to hook on the 'datazoom' event and save the zoom state:

const zoomState = {};

echartsInstance.on('datazoom', (event) => {
  const option = echartsInstance.getOption();
  if(option.dataZoom && Array.isArray(option.dataZoom) && option.dataZoom.length > 0) {
    zoomState.startValue = option.dataZoom[0].startValue;
    zoomState.endValue = option.dataZoom[0].endValue;
  }
});

and then proceed to recalculate the chart's options, using the zoomState.startValue and zoomState.endValue as the boundaries of the markLines (I would add +1 to the startValue and -1 to the endValue to make sure we're within the zoomed window). Not ideal, but does the job.

locinus avatar Aug 22 '21 17:08 locinus

This bug still exists in v5.4.2. markline should not be filtered

kingyue737 avatar Apr 03 '23 08:04 kingyue737

This bug still exists. Please, reopen the ticket.

Zamlos avatar Apr 24 '23 14:04 Zamlos

Below is a demo to show the problem.

Demo

Comee avatar May 22 '23 06:05 Comee

This demo @Comee show the MarkLine disappear when I zoom in. The issue still there.

electroheadfx avatar Aug 29 '23 12:08 electroheadfx

The problem still exists. Is there any other alternative method for directly connecting the two points

984803909 avatar Sep 21 '23 08:09 984803909

just use line series

electroheadfx avatar Sep 21 '23 08:09 electroheadfx

this is a serious problem! It is possible to create a markLine with a single point that spans the entire xAxis (time series) where xAxis zoom works fine and the markLine doesn't disappear, but when you want to specify the start point and end of xAxis markLine, the markLine disappears when zooming in the xAxis and there is no solution Zoom filters options do not work!. Now I need to hack the solution, this issue has been open since 2021 and is still not resolved. Is a fix coming?

brianedwardsaunders avatar Oct 12 '24 06:10 brianedwardsaunders

maybe add it for 6.0 ?

electroheadfx avatar Oct 13 '24 09:10 electroheadfx

it's 2024, and still not fixed.

mimers avatar Nov 26 '24 08:11 mimers

This issue is not solved

752841728 avatar Mar 12 '25 01:03 752841728