plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
17.01k stars 1.86k forks source link

A trace without data is displayed when a "stacking" defined #5952

Open nikita-zamaraev-loginom opened 3 years ago

nikita-zamaraev-loginom commented 3 years ago

The trace trace0 is displayed, although I did not define its data.

Example on codepen - https://codepen.io/x-base/pen/vYZvqZB

code:

var trace = {
  x: [0, 1, 2, 3, 4],
  y: [1, 5, 3, 7, 5],
  mode: "lines+markers", 
  stackgroup: "1",
  fill: "none",
  type: 'scatter'  
}

var trace0 = { ...trace,
  x: [null], // this is recommended workaround https://github.com/plotly/plotly.js/issues/2861#issuecomment-409587725
  y: [null]
};

var trace1 = { ...trace };

Plotly.newPlot('myDiv', [trace0, trace1]);
gvwilson commented 3 months ago

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

nikita-zamaraev-loginom commented 3 months ago

Hi! The issue is still reproducible. I have verified this on plotly version 2.33.0.

gvwilson commented 3 months ago

thanks @nikita-zamaraev-loginom - I'll add it to our backlog, though I suspect it will be quite a while before anyone can get to it :-(