echarts icon indicating copy to clipboard operation
echarts copied to clipboard

changed weakFilter logic, so line charts will not disappear, while zoom

Open Skuperday opened this issue 2 years ago • 15 comments

Brief Information

This pull request is in the type of:

  • [x] bug fixing
  • [ ] new feature
  • [ ] others

What does this PR do?

it fixes some troubles with dataZoom in line charts, when line chart remain only 1-2 dots. and make bar charts dissapear when bars go beyond the edges of the chart

Fixed issues

https://github.com/apache/echarts/issues/17858 https://github.com/apache/echarts/issues/12720 https://github.com/apache/echarts/issues/13321 https://github.com/apache/echarts/issues/11240 https://github.com/apache/echarts/issues/10374

Details

Before: What was the problem?

if we use filterMode: none with bar chart we get problem with exceed but if we will use filterMode: weakFilter (as an example) our line charts on the same area with bar charts will disappear while zoom, if there is only 1-2 points (because there no way to make a line through 1 point)

with this simple change, line charts will be completed based on the values ​​of the elements already existing on the chart

After: How does it behave after the fixing?

Document Info

One of the following should be checked.

  • [x] This PR doesn't relate to document changes
  • [ ] The document should be updated later
  • [ ] The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

  • [ ] Please squash the commits into a single one when merging.

Other information

Skuperday avatar Jan 22 '23 19:01 Skuperday

Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

echarts-bot[bot] avatar Jan 22 '23 19:01 echarts-bot[bot]

@Ovilia i can't find same logic in the src folder. I've tried to looking for "weakFilter" in project, but there only dist files. How do i find where to make changes?

Skuperday avatar Feb 16 '23 18:02 Skuperday

The logic is at https://github.com/apache/echarts/blob/master/src/component/dataZoom/AxisProxy.ts#L318 Here's how to debug: https://github.com/apache/echarts/wiki/How-to-setup-the-dev-environment#3-run-and-debug

Ovilia avatar Feb 21 '23 02:02 Ovilia

Hello there! As a test case, i'm does same changes in our version of library in our product. And my solution works well at this time. Look how it going now vs how it being in past (without my changes)

before: 1 before but while zoom (look how disappear horizontal lines): 2

now: 11 and now while zoom: 22

Skuperday avatar May 23 '23 15:05 Skuperday

Any update on this PR? This would be extremely helpful as we are currently forced to use none filter, which is introducing bugs: https://github.com/apache/echarts/issues/18688

elnipa avatar Jan 05 '24 13:01 elnipa

@Ovilia Please check my changes. I added test cases and did not touch the files in dist.

Skuperday avatar Feb 04 '24 16:02 Skuperday

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-18202@635bfd9

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

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-18202@635bfd9

https://echarts.apache.org/examples/en/editor.html?version=PR-18202%40635bfd9&code=MYewdgzgLgBAJgQygmBeGBtAUDTByARjwBoYCBdYnfAJhLMuozwGZ6KrdmAWdxrvAFY-nfADYRTPAHZJAgBxz8ATnYA6af3wEADOrFbmBIqQJrBhwnVNqWlgmxt3RR3jZrks5ANxYsIAAcoAEtwNBgAb2oADwBBaOCIAC5IgF9RAE94xJSI9OoIAFMAJ2DC5MjqXCgMgMKUvAAbYLBCkir4JAQUxGRqfNxehAAtEBAAWxTsXFwomZmAM2DGqBKAWRA4epg8AHdChABrADFl1eL2-dw4hIgASTAt6JSdUXmauoaIZq2Lt5mABaFYIAcwBUBSLFeHVwEABIF2ABEugBlAEIOAIlJQYoAV0K_1wACMQFAoBMUjQdB1UtRPKlvEA

Look at filter and then try to zoom into. My changes does line not disapear at zoom in. When actual master makes it disapear. Please check the screenshots above to make sure it works correctly mine yours

Skuperday avatar May 11 '24 08:05 Skuperday

@Ovilia I don't know why some checks not successful, first one was succes. Second was canceled at after 5 sec image

Skuperday avatar May 11 '24 08:05 Skuperday

@Skuperday You can dismiss that information.

plainheart avatar May 11 '24 09:05 plainheart

@Ovilia Can you review my changes?

Skuperday avatar Jun 03 '24 10:06 Skuperday