Basic chart with interval property - CanvasJS
Basic chart with interval property - CanvasJS
by canvasjs
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 500px; width: 100%; margin-left:auto; margin-right:auto;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Battery Chart"
},
axisX: {
title: "",
valueFormatString: "MM/DD" ,
labelAngle: -50,
minimum: new Date (2014,11,2), // change here
maximum: new Date (2014,11,3),
interval: 1,
intervalType: "day"
},
axisY: {
includeZero: false,
title: "Battery (mV)"
},
data: [
{
type: "line",
dataPoints: [
{ x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new Date (2014,11,2), y: 3900},
{x:new...