-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Stacked binary traces #5274
Comments
You can use a category axis. Might just work exactly as you have it but with Plotly.newPlot(gd,
[{y: ['a','b']},{y:['c','d']},{y:['e','f']}],
{yaxis:{tickvals:['a','b','c','d','e','f'],ticktext:['OFF','ON ','OFF','ON ','OFF','ON ']}}
) That said @archmoj I think there's a bug here when I try to include Plotly.newPlot(gd,
[{y: ['b','a']},{y:['c','d'], visible: 'legendonly'},{y:['e','f']}],
{yaxis:{
tickvals:['a','b','c','d','e','f'],
ticktext:['OFF','ON ','OFF','ON ','OFF','ON '],
categoryorder: 'category ascending'
}}
)
|
Hey @alexcjohnson , I've done it! I managed to have stacked binaries using, as you told me, type: "category", categoryorder: "array", and categoryarray. Each time the user clicks on the legend the categoryarray property is reloaded. It now works exactly as I wanted I haven't checked the case with an "invisible" trace (visible : false) because I don't use it. Anyway thank you so much for your help! 1000 points for you! 👍 |
@ciuliene OK great, glad that worked! There's still a bug here though, so I'll leave the issue open until we address it. |
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 |
Hello, I have a problem with Plotly.js. I'm trying to draw some traces which have 0 and 1 as values. They are digital variables and what I want to do is to draw them one above the other one, like this:
To do so, I faked each trace values. First trace can be 0 or 1, second trace can be 3 or 4, third trace can be 6 or 7, etc...
The problem is when I remove a trace using the legend. The result is something like this:
I'd like to have the other lines to be redrawn without the removed one.
So, the question is: is there an easier way to do this? Something like "stacked binary layout"?
Thank you!
The text was updated successfully, but these errors were encountered: