jqplot / examples / gridPadding.html

<!DOCTYPE html>

<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Simple Test</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.css" />
  
  <!-- BEGIN: load jquery -->
  <script language="javascript" type="text/javascript" src="../src/jquery-1.4.4.min.js"></script>
  <!-- END: load jquery -->
  
  <!-- BEGIN: load jqplot -->
  <script language="javascript" type="text/javascript" src="../src/jquery.jqplot.js"></script>
  <!-- END: load jqplot -->
 
<script class="code" type="text/javascript">$(document).ready(function(){   
    plot1a = $.jqplot('chart1a', [[1,2,1]], 
        {
            title: 'Sample Grid Padding'
        }
    );
});</script> 
  
<script class="code" type="text/javascript">$(document).ready(function(){   
    plot1 = $.jqplot('chart1', [[1,2,1]], 
        {
            title: 'Sample Grid Padding',
            gridPadding: {top:0, right:0, bottom:0, left:0}
        }
    );
});</script>  

<script class="code" type="text/javascript">$(document).ready(function(){   
    plot2 = $.jqplot('chart2', [[1,2,1]], 
        {
            title: 'Sample Grid Padding',
            gridPadding: {top:null, right:0, bottom:62, left:0}
        }
    );
});</script>
  
<script class="code" type="text/javascript">$(document).ready(function(){   
    plot3 = $.jqplot('chart3', [[1,2,1]], 
        {
            gridPadding: {right:60}
        }
    );
});</script>

<script type="text/javascript">    
    $(document).ready(function(){
        $('script.code').each(function(index) {
            $('pre.code').eq(index).text($(this).html());
        });
        $(document).unload(function() {$('*').unbind(); });
    });
</script>

<style type="text/css">
    .jqplot-target {
        border: 1px solid red;
        margin-left: 20px;
        margin-top: 20px;
        width: 400px;
        height: 300px;
    }

    pre.code {
        margin-top: 35px;
    }
</style>
  </head>
  <body>
<?php include "nav.inc"; ?>
<p>Setting custom gridPadding on charts.  The red border indicates the plot target container.  By default, the grid will size itself to fit axes, titles, etc. within the plot target.  This values will be overridden if a "gridPadding" option is specified.</p>
<p>The default computed gridPadding:</p>
    <div id="chart1a"></div>
    <pre class="code"></pre>
<p>Setting all gridPadding to 0 hides the title under the plot:</p>
    <div id="chart1"></div>
    <pre class="code"></pre>
<p>If a gridPadding member is null or undefined, the default will be used:</p>
    <div id="chart2"></div>
    <pre class="code"></pre>
<p>Just specify padding on the sides we need, defaults used for others:</p>
    <div id="chart3"></div>
    <pre class="code"></pre>
  </body>
</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.