Skip to content

Candlestick body width bug with range breaks #4742

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
matdecac opened this issue Apr 8, 2020 · 10 comments · Fixed by #4814
Closed

Candlestick body width bug with range breaks #4742

matdecac opened this issue Apr 8, 2020 · 10 comments · Fixed by #4814
Assignees
Labels
bug something broken
Milestone

Comments

@matdecac
Copy link

matdecac commented Apr 8, 2020

Hello everyone,

I am using plotly with python and found a bug with the new (very useful) rangebreaks feature.

When using candlestick graphs it generates some kind of yaxis size reduction on the body of every candles, resulting in what look likes vertical lines for each candles.

I created a codepen with and without rangebreaks as the only difference.

Thanks a lot for this great library,

codepen link

Mathias

@archmoj
Copy link
Contributor

archmoj commented Apr 8, 2020

Hi @matdecac,
Thanks for using potly.
I am afraid you applied an old bundle in your codepen!
Here is what your demo looks like using v1.53.0.

@matdecac
Copy link
Author

matdecac commented Apr 8, 2020

Thanks @archmoj, I am using plotly.py, and by reading the release page it is not yet released with v1.53.0. So I will wait :).

Thanks for the support, I am closing the issue.

Mathias

@matdecac matdecac closed this as completed Apr 8, 2020
@archmoj archmoj reopened this Apr 8, 2020
@archmoj
Copy link
Contributor

archmoj commented Apr 8, 2020

@matdecac
I think latest plotly.py uses v1.53.0; but let me confirm.

@matdecac
Copy link
Author

matdecac commented Apr 8, 2020

@archmoj, According to the PR : it was merged 8 days ago.
Release 4.6.0 of plotly.py contains above PRs.

So you are right.. I will create a sample of the bug in plotly.py

@archmoj
Copy link
Contributor

archmoj commented Apr 8, 2020

@matdecac Are you still experiencing this issue using upgraded plotly.py?

@matdecac
Copy link
Author

matdecac commented Apr 8, 2020

@archmoj Yes I was already using 4.6.0.

@matdecac
Copy link
Author

matdecac commented Apr 8, 2020

@archmoj,

  • I reviewed in detail your codepen, it seems like the range breaks is not applied : there is data after 17:30 which is the limit of the range breaks
  • I built the same exemple in Python :
 
fig = go.Figure(
    data=[{
      "x": [
        "2020-01-02 17:00", "2020-01-02 17:10",
        "2020-01-02 17:20", "2020-01-02 17:30",
        "2020-01-02 17:40", "2020-01-02 17:50",
        "2020-01-02 18:00", "2020-01-02 18:10"
      ],
      "open": [
        10, 10,
        10, 10,
        10, 10,
        10, 10
      ],
      'high': [
        12, 12,
        12, 12,
        12, 12,
        12, 14
      ],
      'low': [
        8, 8,
        8, 8,
        8, 8,
        3, 8
      ],
      'close': [
        12, 7,
        11, 10.5,
        9, 8.5,
        3, 14
      ],
      'type': 'candlestick',
    }],
    layout={
        'title': 'Bug example',
        'template': "plotly_dark", 
        'xaxis_rangeslider_visible': False,
        'showlegend': False, 
        'hovermode': 'x',
        'xaxis': {
            'rangebreaks': [
                dict(bounds=["sat", "mon"]), #hide weekends
                dict(pattern='hour', bounds=[17.5, 9]),
            ]
        },
    },
)
fig.show()

@archmoj
Copy link
Contributor

archmoj commented Apr 8, 2020

OK. There are more API changes that should be applied in that pen e.g. breaks to rangebreaks and %H to hour.
So I think this new demo now illustrates the bug you are referring to.

@archmoj archmoj added the bug something broken label Apr 8, 2020
@matdecac
Copy link
Author

matdecac commented Apr 8, 2020

Ok, sorry I used a codepen from another bug which must have been a bit old.

But thanks for reopenning !

Edit : I use plotly inside :

  • Jupyter notebook : I see the bug there
  • orca (for image generation) : I see the bug there
  • dash : I do not see the bug there

Mathias

@rbi13
Copy link

rbi13 commented Apr 29, 2020

I am having the same issue with plotly.js v1.53.0 using values/dvalues.
The breaks are displayed correctly, however the candles are displayed as vertical lines and none of the hover functionality is working.

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

Successfully merging a pull request may close this issue.

4 participants