You must be logged in to post your query.
Home › Forums › Chart Support › How are the viewport attributes formatted when the axis numbers are a time?
Tagged: attributes, Axis, formatting, objects, time, viewport
I have a graph with the X axis values being a javascript Date object. These are formatted for each data point as “HH:mm:ss.fff” and on the axis it is displayed as “HH:mm”. I would like to zoom in and then use the new values of chart.axisX[0].get(“viewportMinimum”) and chart.axisX[0].get(“viewportMaximum”) for another feature in my app. These values are not the date objects and show values that look like this: “1483281267314.5”. I was wondering how date objects are formatted to get numbers like this so that I may format these numbers in reverse to get the time again.
@ayy,
You can use rangeChanging or rangeChanged event to get viewportMinimum and viewportMaximum after zooming / panning. And you can use formatDate() to modify the date as per your requirement.
————- Indranil Deo Team CanvasJS
Thank you!
You must be logged in to reply to this topic. Login/Register