Skip to content

[Bug] In Line series chart, the series is not removed when using the legend for filter After applying the datazoom #18688

Closed

Description

@Suraj-Singhvi

Version

5.4.2

Link to Minimal Reproduction

https://codepen.io/Suraj-Singhvi/pen/BaqgKRw

Steps to Reproduce

  1. Load the given chart options
  2. Use the data zoom slider to zoom into specific date/month
  3. Drag the slider from one direction to the other side.
    ex. start.....end should now be end....start
  4. filter both the series using the legends (you would see the last series filtered would still exist)
  5. and now on enabling them again, we now have an unwanted series line in our charts

Current Behavior

Initial state on using the datazoom slider
image

Now use the end of the slider and move it across the start of the slider
image

On filtering the series with the legend, the last series filtered is still visible
image

And now on toggling it back, the unknown series line exists in the chart
image

(Also, sometimes the line series keeps drawing lines on zooming via the slider but I don't have the exact steps as this is a bit random.)
image

Expected Behavior

I would expect the legend to filter out all the series, does not matter how the data zoom slider is used

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

  1. added
    en
    pending
    on May 31, 2023
  2. changed the title [-][Bug] In Line series chart, the series is not removed when using the lengen for filter After applying the datazoom[/-] [+][Bug] In Line series chart, the series is not removed when using the legend for filter After applying the datazoom[/+] on May 31, 2023
  3. helgasoft commented on May 31, 2023

    @helgasoft

    could not reproduce in given codepen.io link

  4. elnipa commented on Jun 12, 2023

    @elnipa

    I can reproduce it. Important is using the dataslider as described in the "steps to reproduce". Even if all series are hidden from the legend, there remain some lines on the screen.

    image

  5. elnipa commented on Sep 29, 2023

    @elnipa

    any progress on this bug?

  6. helgasoft commented on Sep 29, 2023

    @helgasoft

    with 10,000+ data points, 5 zooms and additional controls like moveOnMouseMove, moveOnMouseWheel, zoomOnMouseWheel - no wonder there are problems. This is not a Minimal Reproduction and chances of some volunteer debugging it are very slim.

  7. Suraj-Singhvi commented on Jan 5, 2024

    @Suraj-Singhvi
    Author

    I have created a minimal reproduction sample here https://codepen.io/Suraj-Singhvi/pen/eYXJwXM

    the weird part is it works fine when the datapoints for each series is around 1450 but fails for 1500+ points.

    Try to tweak the numbers in the example shared

    image

  8. elnipa commented on Jan 5, 2024

    @elnipa

    Thanks for this minimal reproduction. Indeed weird behavior and definitely a bug imho.

    I played around with the minimal a little bit and realized that the bug does not occure if the dataZoom.filterMode is not set to none. However, this should be a valid setting to avoid "empty" charts when zooming in and having the points of the zoom range.

    image

  9. Suraj-Singhvi commented on Jan 19, 2024

    @Suraj-Singhvi
    Author

    I tried again by removing the dataZoom.filterMode but the problem still persist if the number of datapoints are more.

    One possible solution would be to have option in the legend to have at least legend avaiable for selection as selecting all the legend would result in showing no series which i dont think is desirable.
    Having option like selectedMode: custom and user can define how much selection they want to provide

    I solved it with below solution

    onLegendSelectChanged(event: any): void {
       const selectedLegendCount = Object.values(event.selected).filter(
         (value) => value,
       ).length;
    
       // Prevent further legend selection
       if (selectedLegendCount === 0) {  
        // get the eChartInstance
           eChartInstance.dispatchAction({
             type: 'legendSelect', // keep the legend selection
             name: event.name,
           });
       }
     }
  10. github-actions commented on Jan 18, 2026

    @github-actions
    Contributor

    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.

  11. added
    stale
    on Jan 18, 2026
  12. github-actions commented on Jan 25, 2026

    @github-actions
    Contributor

    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!

  13. added a commit that references this issue on Mar 12, 2026
    18abd76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenpendingstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions