Can't position annotation by date

Here’s a working version: https://jsfiddle.net/etpinard/98phb124/3/

As mentioned in Dates on x-axis not spaced appropriately, plotly only understand a limited set strings as dates. The above version has the annotation x attribute set to a unix timestamp.

For date string like the one in your example, the convert function would be:

function toDate(d) {
  var parts = d.split('/');
  
  return new Date(parts[2], parts[0], parts[1]).getTime();
} 
1 Like