X-coordinates in Order


I am displaying Week and Year in a xaxis. I want to display all the Week and Year in order from Wk1 to Wk53.

I have tried to convert date to JS dates. But it doesn’t work for me. Below is the Same with Data.

Unfortunately, there’s no easy way to do what you’re describing.

The data you’re using can’t be recognized as dates.

We’re hoping to add some ordering functionalities for categorical data soon. Subscribe to https://github.com/plotly/plotly.js/issues/189 for the latest details.

In the meantime, I suggest replacing your x coordinates with number and use a combinaison of tickvals and ticktext.


I can pass the data with 0 value for the missing data point. But is there any way to hide the tooltip when we have 0 value.

Only with line chart i am getting the dip below is to reproduce the same with sample data.