You must be logged in to post your query.
Home › Forums › Chart Support › Broken date/time
Hello,
I’m trying to use CanvasJS. At first, everything seemed easy but configuring date/time has been very difficult.
For one thing, I apparently need to append “000” to Unix timestamps? Otherwise, they are wrong. Is that right?
Second, the example I was looking at has the X-axis format under data. However, this doesn’t work:
data: [{ type: "area", xValueType: "dateTime", xValueFormatString: "DDD HH:mm:ss",
It only works when I have this:
axisX: { title: "Date/Time", valueFormatString: "DDD HH:mm:ss"
I am using the latest “canvasjs.min.js” but xValueFormatString does not seem to work at all, even when I copy one of the examples, directly.
@andenjs,
Unix Timestamp is the number of seconds that has elapsed since January 1, 1970 whereas JavaScript timestamp is the number of milliseconds that has elapsed since January 1, 1970. Multiplying unix timestamp by 1000 gives you JavaScript timestamp.
Second, the example I was looking at has the X-axis format under data. However, this doesn’t work
xValueFormatString is used to define the the format of x-value that appears in toolTip and indexLabel whereas valueFormatString is used to define the format of the value that appears in axis. Setting valueFormatString should work fine in your case.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register