Skip to content

Instantly share code, notes, and snippets.

Created August 24, 2015 12:07
Show Gist options
  • Save anonymous/16efe20dd5f69587af08 to your computer and use it in GitHub Desktop.
Save anonymous/16efe20dd5f69587af08 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/tadeti
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://raw.githubusercontent.com/dima117/Chart.Scatter/master/Chart.Core.js"></script>
<script src="https://raw.githubusercontent.com/dima117/Chart.Scatter/master/Chart.Scatter.js"></script>
</head>
<body>
<canvas id="chart_sample" width="64" height="48"></canvas>
<script>
Chart.defaults.global.responsive = true;
Chart.defaults.global.animation = false;
var data =
[
{
label : 'CPU Temperature',
strokeColor : '#A043BA',
data : [
{x:new Date('2015-07-15T07:07:00'),y:0},
{x:new Date('2015-07-15T08:08:00'),y:1},
{x:new Date('2015-07-15T09:09:00'),y:2},
{x:new Date('2015-07-15T10:10:00'),y:1},
{x:new Date('2015-07-15T11:11:00'),y:0}
]
}
];
var ctx = document.getElementById("chart_sample").getContext("2d");
var myDateLineChart = new Chart(ctx).Scatter(data, {
bezierCurve: false,
showTooltips: true,
scaleShowHorizontalLines: true,
scaleShowLabels: true,
scaleType: "date",
pointHitDetectionRadius : 5,
pointDot : false,
pointDotRadius : 2,
useUtc: false,
scaleTimeFormat: "HH:MM",
scaleDateTimeFormat: "d.m.yyyy, HH:MM",
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment