Home forums Using CanvasJS Need help with Date time values in XAxis Reply To: Need help with Date time values in XAxis

#23788

Vishwas R
Keymaster

@hackkpo,

that query gives me 5000+ records, divided by 15 minutes in all the records from this year, but the x axis shows me this range

Range of x-axis depends on the dataPoints, if minimum/maximum or viewportMinimum/viewportMaximum are not set. Kindly share JSFiddle with sample data so that we can look into the chart-options you are using, understand the scenario better and help you out.

And when you put the cursor on it, it says “18 Jan 70”, what it means?

Tooltip content is showing 1970 as the timestamp that you are passing to the dataPoints are PHP Timestamp. PHP uses Unix timestamp which is in seconds whereas JavaScript uses milliseconds as timestamp. Converting PHP timestamp to JS timestamp by multiplying PHP timestamp by 1000 should work fine in your case.


Vishwas R
Team CanvasJS