Commit 7095e859 authored by Sören Henning's avatar Sören Henning

added real-time test

parent 0a215e04
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>CanvasPlot Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="canvasplot.css">
<script src="dep/demo/jquery-2.2.3.min.js" charset="utf-8"></script>
<script src="dep/canvasplot/d3.min.js" charset="utf-8"></script>
<script src="canvasplot.js" charset="utf-8"></script>
<div id="maincontainer">
<script type="text/javascript">
function getDemoPlotSize() {
return [window.innerWidth-100, Math.round(0.45*(window.innerWidth-100))];
$(document).ready(function() {
var lastValue = Math.random()*1000;
var ts = [[new Date(), lastValue]];
var plot = new CanvasTimeSeriesPlot("#maincontainer"), getDemoPlotSize(), {
yAxisLabel: "Stock Index"
plot.addDataSet("ds", "Stock Index", ts, "steelblue", true, true);
$(window).resize(function() {
setInterval(function() {
lastValue += ((Math.random() * 20) - 10);
var newDataPoint = [new Date(), lastValue];
plot.addDataPoint("ds", newDataPoint, true, true);
}, 100);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment