Date-Time in ISO Format - CanvasJS JavaScript Charts
Date-Time in ISO Format - CanvasJS JavaScript Charts
by canvasjs
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer",
{
axisX:{
valueFormatString: "DD/MM/YYYY HH:mm" ,
labelAngle: -50,
intervalType:"minute",
interval:1440
},
data: [
{
type: "line",
dataPoints: [
{ x: new Date(2012, 07, 01,05,30,00), y: 50} ,
{ x: new Date(2012, 07, 02,05,30,10), y: 75},
{ x: new Date(2012, 07, 03,05,30,20), y: 10},
{ x: new Date("2012-08-04T05:30"), y: 12},//ISO Format
{ x: new Date("2012-08-05T05:30"), y: 60},//ISO Format
{ x: new Date(2012, 07, 06,05,30,50), y: 17},
]
}
]
});
chart.render();