Commits

Chris Leonello committed 47f694e

Added example for making grid areas on two plots same size using gridPadding option.

  • Participants
  • Parent commits ecb1d62

Comments (0)

Files changed (1)

File examples/gridDimensions.html

+<!DOCTYPE html>
+
+<html lang="en">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <!-- Use Compatibility mode in IE -->
+  <title>Grid Dimensioning Example</title>
+  <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="../src/excanvas.js"></script><![endif]-->
+  
+  <link rel="stylesheet" type="text/css" href="../src/jquery.jqplot.css" />
+  <link rel="stylesheet" type="text/css" href="../examples/examples.css" />
+  
+  <!-- BEGIN: load jquery -->
+  <script language="javascript" type="text/javascript" src="../src/jquery.js"></script>
+  <!-- END: load jquery -->
+  
+  <!-- BEGIN: load jqplot -->
+  <script language="javascript" type="text/javascript" src="../src/jquery.jqplot.js"></script>
+  <!-- END: load jqplot -->
+  <script language="javascript" type="text/javascript">
+    $.jqplot._noToImageButton = true;
+  </script>
+
+  <style type="text/css">
+  .jqplot-target {
+    border: 1px solid rgb(190, 190, 190);
+  }
+  </style>
+  
+  <script class="code" type="text/javascript">
+    $(document).ready(function () {
+      var s1 = [[0, 2], [1, 6], [2, 7], [3, 10]];
+
+      plot1 = $.jqplot("chart1", [s1], {
+        gridPadding: {left: 70, right: 15, top: 15, bottom: 35}
+      });
+    });
+  </script>
+  
+  <script class="code" type="text/javascript">
+    $(document).ready(function () {
+      var s1 = [[0, 2], [1, 6], [2, 7], [3, 10]];
+
+      plot2 = $.jqplot("chart2", [s1], {
+        gridPadding: {left: 70, right: 15, top: 15, bottom: 35},
+        axes: {
+          yaxis: {
+            tickOptions: {
+              formatString: '%.5f'
+            }
+          }
+        }
+      });
+    });
+  </script>
+
+<script type="text/javascript" src="example.js"></script> 
+    
+  </head>
+  <body>
+<?php include "nav.inc"; ?>
+        
+    <div id="chart1" style="margin:30px; width:400px; height:200px;"></div>
+    <div id="chart2" style="margin:30px; width:400px; height:200px;"></div>
+
+  </body>
+</html>