I'm facing an issue with some incorrect lines appearing in my d3.js chart. Strangely, the problem seems to disappear when I switch tabs on Chrome and return to the chart's tab.
It's puzzling to figure out the root cause of this issue, so I will attach an image to provide a clearer explanation.
https://i.stack.imgur.com/8ZQml.png
Below is the JavaScript code that updates the chart (I am using Vue.js)
const line = d3.line()
.x((_d,i) => this.xScale(this.zoom* i))
.y(d => this.yScale(d))
.curve(d3.curveBasis);
this.svg.select('#g-path').select('path')
.attr('d', line(this.data))
.style("stroke-linejoin", "round")
.style('fill', 'none')
.style('stroke', 'green')
.style('stroke-width', 1);
EDIT: I've noticed that the lines also disappear if I click on another component on the page.
Appreciate any help!