echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Line is disconnected from points outside zoomed-in region in Line Chart with value type xaxis

Open ys4503 opened this issue 5 years ago • 5 comments

Version

4.9.0

Reproduction link

https://jsfiddle.net/zg7mw5nf/

Steps to reproduce

The line is not connected to points outside the zoom-in region when using dataZoom in a Line chart with xaxis type value. Try zooming between 6 and 9 in above JSFiddle Link

What is expected?

The line should be connected to points outside the zoom-in region.

What is actually happening?

The line is only connected to points inside the zoom-in region.


There should be scatterline type chart.

ys4503 avatar Sep 21 '20 07:09 ys4503

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 Sep 21 '20 07:09 echarts-bot[bot]

I found a solution around this bug. Just modify the source code of echart.js in function AxisProxy -> filterData, from:

var thisLeftOut = value < valueWindow[0] var thisRightOut = value > valueWindow[1]

to

var thisLeftOut = value < valueWindow[0] && seriesData.get(dataDims[i], dataIndex+1) < valueWindow[0]; var thisRightOut = value > valueWindow[1] && seriesData.get(dataDims[i], dataIndex-1) > valueWindow[1];

Then set the filterMode option of dataZoom component to 'weakFilter'

cfwang123 avatar Nov 19 '20 05:11 cfwang123

Thanks for sharing your solution. This is a very nice way around and it should be implemented in 'weakFilter' or its own filterMode.

It seems the default mode is intended for performance reasons. However, it should default to your solution in this particular chart type. Using 'none' filterMode also fixes this issue but it doesn't filter any data and it may not be optimum for huge data.

ys4503 avatar Nov 19 '20 22:11 ys4503

I've prototyped a 'filterPlusOne' filterMode which solves this issue in ECharts 5 for the simple use case where only one dimension is being filtered (e.g. a line chart with horizontal zoom) in a performant way. Not sure whether this is the correct approach, though, and there may be a cleaner way to implement it.

Changes here: https://github.com/zorac/echarts/compare/master...zorac:fix-13316

zorac avatar May 18 '22 13:05 zorac

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar May 17 '24 21:05 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar May 24 '24 21:05 github-actions[bot]