Personal tools

Template:Flot ffcp hg19: Difference between revisions

From FANTOM5_SSTAR

Jump to: navigation, search
No edit summary
No edit summary
Line 3: Line 3:
     <div id="placeholder" style="width:600px;height:300px;"></div>
     <div id="placeholder" style="width:600px;height:300px;"></div>


    <p>Simple example. You don't need to specify much to get an
 
      attractive look. Put in a placeholder, make sure you set its
      dimensions (otherwise the plot library will barf) and call the
      plot function with the data. The axes are automatically
      scaled.</p>


<script type="text/javascript">
<script type="text/javascript">
Line 17: Line 13:
     var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
     var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];


    // a null signifies separate line segments
     var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
     var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
      
      

Revision as of 10:38, 13 March 2012

Flot Examples


<script type="text/javascript"> $(function () {

   var d1 = [];
   for (var i = 0; i < 14; i += 0.5)
       d1.push([i, Math.sin(i)]);
   var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
   var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
   
   $.plot($("#placeholder"), [ d1, d2, d3 ]);

}); </script>