Skip to content
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

Allow scatter traces with mode: 'none' to contribute to tonext* fills #1867

Closed
koreyou opened this issue Jul 8, 2017 · 2 comments
Closed
Labels
feature something new

Comments

@koreyou
Copy link

koreyou commented Jul 8, 2017

Trying to create filled plots with no lines, I used fill with mode = 'none'. This caused unexpected behavior of the first fill not showing up.

var data = [
  {
    "x": [1, 2, 3],
    "y": [-2.0, -3.0, -4.0],
    'type': 'scatter',
    'mode': "none",
    'showlegend': false,
    "name": "1"
  },
  {
    "x": [1, 2, 3],
    "y": [-1.0, -2.0, -3.0],
    'type': 'scatter',
    'showlegend': false,
    'mode': "none",
    "name": "2",
    "fill": "tonexty",
    "fillcolor": "blue"
  },
  {
    "x": [1, 2, 3],
    "y": [0.0, 0.0, 1.0],
    'type': 'scatter',
    'showlegend': false,
    'mode': "none",
    "name": "3",
    "fill": "tonexty",
    "fillcolor": "green"
  }
];

Plotly.newPlot(
  "test", // the ID of the div
  data, {});

fill_with_mode_none

The minimum moving example is here

This is the expected plots:

expected

This can be achieved by passing 0 width line.

    'mode': "lines",
    'line': {'width': 0, 'color': 'green'},

I believe this is not a desired behavior?
It will be great if you can fix the problem or at least document it for fill.

@koreyou koreyou changed the title Scatter's "fill" interfers with "mode" Scatter's "fill" interferes with "mode" Jul 8, 2017
@etpinard
Copy link
Contributor

Interesting. Thanks for pointing this out!

I guess we could allow for line-less fills. I don't see a problem with that. I'll change the issue title accordingly.

In the meantime, your

'mode': "lines",
'line': {'width': 0, 'color': 'green'},

is the best workaround I can think of.

@etpinard etpinard changed the title Scatter's "fill" interferes with "mode" Allow scatter traces with mode: 'none' to contribute to tonext* fills Jul 10, 2017
@etpinard etpinard added the feature something new label Jul 10, 2017
@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
feature something new
Projects
None yet
Development

No branches or pull requests

3 participants