Home Forums Chart Support MySQL – (Displaying Date-Time values on a Chart Axis) Reply To: MySQL – (Displaying Date-Time values on a Chart Axis)

#22016

@JohnSnowGum,

When you use JSON data as an array of arrays, you need to slightly modify the above fiddle. Below is the code snippet.

for (var i = 0; i < dateArray.length; i++) {
  if (dateArray[i][0] != currentXValue) {
    if (count > 0)
      dps.push({x: new Date(currentXValue), y: count});
    currentXValue = dateArray[i];
    count = 1;
  } else {
    count++;
  }
}

Please take a look at this updated JSFiddle for complete code.

__
Priyanka M S
Team CanvasJS