@phillips321,
You can set the x-value as a date object instead of using labels.
To only display a certain number of recent dataPoints you can set the viewportMinimum according to the number of dataPoints you would like to view. Please find the code snippet for the same below.
chart.axisX[0].set("viewportMinimum", dps[0][dps[0].length - 1 - dpsInView].x)
Please check this JSFiddle for a working example.
—
Thangaraj Raman
Team CanvasJS