I am facing a challenge in creating a line graph that displays (x, y) coordinates where the x axis represents a date and the y axis represents a value. The dates are formatted like DD-MM-YYYY, for example, 15-04-2015.
My initial trace is added with the following code:
var trace = {
x: ["9-10-2016", "6-12-2016", "8-12-2016"],
y: [30, 11, 38],
name: "trace 1",
mode: 'lines
I have sorted the arrays for the x and y axes based on date using a custom method for sorting JavaScript arrays.
However, when I attempt to add a new trace to the graph, I am unable to ensure that the points are ordered by date relative to the other traces already present on the graph. It seems that the points always appear to the right of everything on the first trace, regardless of whether some points in the second trace have dates earlier than those in the first trace.