Skip to content

visible: true ignored if x, y data arrays are empty #2861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
seansfkelley opened this issue Aug 1, 2018 · 4 comments
Closed

visible: true ignored if x, y data arrays are empty #2861

seansfkelley opened this issue Aug 1, 2018 · 4 comments
Milestone

Comments

@seansfkelley
Copy link

seansfkelley commented Aug 1, 2018

When rending a trace with no data, it can be desirable to always show a legend item even if there are no data points. (Example: user-editable data; if the user deletes all the data it would be nice to stay consistent and just show an empty trace with a legend entry.)

I thought this was possible with visible: true, but that appears to not be the case. See this example for more (add values to x and y and note that the legend pops in along with the data, i.e., it is not present if the data is not present).

#1310 (comment) suggests this would be desirable behavior, but I see no other issues mentioning it.

@etpinard
Copy link
Contributor

etpinard commented Aug 1, 2018

Thanks for writing in! I think what #1310 (comment) is suggesting should be considered a breaking change and should probably be added to our v2 wishlist in #420.

In the meantime, I think setting x and y to [null] as in https://codepen.io/etpinard/pen/MBVorO?editors=0010#0 is the simplest workaround available (unfortunately).

@seansfkelley
Copy link
Author

Alright, I'll do that for now. I'll leave this issue open so you can move/close at your discretion.

@etpinard etpinard added this to the v2.0.0 milestone Aug 7, 2018
@sorenwacker
Copy link

I think I have that same problem. Trying do create an animation frame where dates are inconsistently distributed.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants