Home › Forums › Chart Support › viewportMaximum – limit to 100 most recent values › Reply To: viewportMaximum – limit to 100 most recent values
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.set("viewportMinimum", dps[dps.length - 1 - dpsInView].x)
Please check this JSFiddle for a working example.