html5 boiler plate
[scannr.git] / js / flotr2 / examples / js / examples / basic-stepped.js
blob:a/js/flotr2/examples/js/examples/basic-stepped.js -> blob:b/js/flotr2/examples/js/examples/basic-stepped.js
--- a/js/flotr2/examples/js/examples/basic-stepped.js
+++ b/js/flotr2/examples/js/examples/basic-stepped.js
@@ -1,1 +1,45 @@
+(function () {
 
+Flotr.ExampleList.add({
+  key : 'basic-stepped',
+  name : 'Basic Stepped',
+  callback : basic_stepped,
+  type : 'test'
+});
+
+function basic_stepped (container) {
+
+  var
+    d1 = [[0, 3], [4, 8], [8, 5], [9, 13]], // First data series
+    d2 = [],                                // Second data series
+    i, graph;
+
+  // Generate first data set
+  for (i = 0; i < 14; i += 0.5) {
+    d2.push([i, Math.sin(i)]);
+  }
+
+  // Draw Graph
+  graph = Flotr.draw(container, [ d1, d2 ], {
+    lines: {
+      steps : true,
+      show : true
+    },
+    xaxis: {
+      minorTickFreq: 4
+    }, 
+    yaxis: {
+      autoscale: true
+    },
+    grid: {
+      minorVerticalLines: true
+    },
+    mouse : {
+      track : true,
+      relative : true
+    }
+  });
+}
+
+})();
+