Skip to content

[Bug] MarkLine does not render #21060

Open
@frilox042

Description

@frilox042

Version

5.6.0

Link to Minimal Reproduction

https://jsfiddle.net/pL8u97sz/4/

Steps to Reproduce

  1. call setOption with series without markLine
  2. call setOption again but spread the previous options and adds series with the markLine
chart.setOption({
  xAxis: {
    type: "value",
  },
  yAxis: {
    type: "value"
  },
  series: [{
    data: [[10,10],[20,20],[30,15],[40,10],[50,20],[60,15],],
    type: "line",
  }]
});

chart.setOption({
  ...chart.getOption(),
  series: [{
    data: [[10,10],[20,20],[30,15],[40,10],[50,20],[60,15],],
    type: "line",
    markLine: {
      data: [{ xAxis: 15 }, { xAxis:  25},]
    },
  }]
});

Current Behavior

The chart is rendered without the marklines

Image

Expected Behavior

The chart is rendered with the marklines

Image

Environment

- OS: linux
- Browser: firefox 139.0.4 
- Framework: react@18

Any additional comments?

Note that in my use case, I am using react.
I am updating the chart from different events.
Each does a React.useEffect where they call setOption and spread the previous option.

When I inspect the option from getOption, it has the desired configuration for the chart. Thus, I expect it render the markline

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions