How to remove weekend datetime gaps from x-axis of a financial chart?

前端 未结 5 998
[愿得一人]
[愿得一人] 2021-01-06 16:31

I have a use case where I pull and plot Forex data in the form of ask and bid on the graph and this is based on minute, hour or day candlesti

5条回答
  •  盖世英雄少女心
    2021-01-06 17:21

    According to documentation

    try to add this before fig.show()

    fig.update_xaxes(
        rangebreaks=[
            dict(bounds=["sat", "sun"]), #hide weekends
        ]
    )
    

    or

    fig.layout.xaxis.type = 'category'
    

提交回复
热议问题