title: jqplot: make chart appear in tab navigation + print view
body: <p>I have a tab navigation whose second tab contains a jqplot chart. </p>
  
  <p>My goals:</p>
  
  <ul>
  <li><p>Displaying the chart in the second tab. </p></li>
  <li><p>Displaying both tabs in the print view with the chart. </p></li>
  </ul>
  
  <p>Here comes my code:</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;nav&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a class="tablink" title="box-tab1" href="#"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a class="tablink" title="box-tab2" href="#"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/nav&gt;
  
  &lt;br&gt;&lt;br&gt;&lt;br&gt;
  
  &lt;div id="tabcon"&gt;
      &lt;div class="tabbox" id="box-tab1"&gt;&lt;p&gt;Tab 1&lt;/p&gt;&lt;/div&gt;
      &lt;div class="tabbox" id="box-tab2"&gt; &lt;div id="chart"&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>.tabbox {
      display: none;
  }
  
  #box-tab1 {
      display: block;
  }
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>var plot1 = $.jqplot ('chart', [[3,7,9,1,4,6,8,2,5]]);
  
   $('.tablink').click(function (e) {
                      var tabtitle = $(this).attr('title');
                      $('.tabbox').hide();
                      $('#' + tabtitle).show();
  
                      if (tabtitle == 'box-tab2') {
                          plot1.replot();
                      }
  
                      e.preventDefault();
   });
  </code></pre>
  
  <p><strong>JSFIDDLE:</strong> <a href="http://jsfiddle.net/yGLmT/69/" rel="nofollow">http://jsfiddle.net/yGLmT/69/</a></p>
  
  <p>How do I achieve my two goals?</p>