dateTime axis with intervalType hour - CanvasJS

dateTime axis with intervalType hour - CanvasJS

HTML

<script src="http://www.canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 400px; width: 100%;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer",
    {
      title:{
          text: "Temperature Change"
      },
      axisX:{
        interval: 2,
        intervalType: "hour",
        valueFormatString: "hh:mm TT",
      },
      data: [
      {
        type: "line",
        dataPoints: [
        { x: new Date(2012, 01, 1, 12, 00), y: 35},
        { x: new Date(2012, 01, 1, 13, 00), y: 32},
        { x: new Date(2012, 01, 1, 14, 00), y: 33},
        { x: new Date(2012, 01, 1, 15, 00), y: 34},
        { x: new Date(2012, 01, 1, 16, 00), y: 34},
        { x: new Date(2012, 01, 1, 17, 00), y: 34},
        { x: new Date(2012, 01, 1, 18, 00), y: 33},
        { x: new Date(2012, 01, 1, 19, 00), y: 32},
        { x: new Date(2012, 01, 1, 20, 00), y: 29}
        ]
     }
     ]
});

chart.render();

chart.axisX[0].intervalType = "hour";
chart.axisX[0].interval = 2;
chart.render();