Skip to content

modebar can't be hidden with multiple traces #56

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
mheilman opened this issue Dec 1, 2015 · 2 comments
Closed

modebar can't be hidden with multiple traces #56

mheilman opened this issue Dec 1, 2015 · 2 comments
Labels
bug something broken

Comments

@mheilman
Copy link

mheilman commented Dec 1, 2015

It looks like the mode bar can't be hidden in line charts with more than one trace (though it works fine for single trace charts).

Here's a minimal example:

<html>
<body>
  <div id="plotly-div"></div>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>

var trace1 = { x: [0, 1], y: [4, 5], type: "scatter"};
var trace2 = { x: [0, 1], y: [4, 5], type: "scatter"};
//var data = [trace1];  // This works: the mode bar gets removed.
var data = [trace1, trace2];  // This doesn't work: the mode bar remains.
Plotly.plot('plotly-div', data, {}, { displayModeBar: false });

</script>
</body>
</html>

I looked through the code a bit and thought that perhaps this has something to do with this comment.

@etpinard etpinard added the bug something broken label Dec 1, 2015
@etpinard
Copy link
Contributor

etpinard commented Dec 1, 2015

Bug confirmed. Thanks for reporting.

The problem is in the modebar manager. The logic here isn't quite right.

Working on a fix now.

@mheilman
Copy link
Author

mheilman commented Dec 1, 2015

Amazing. Thanks!.

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

No branches or pull requests

2 participants