title: How to add codes to jqPlot bar chart save as image on button click in jsp
body: <p>I displayed a jqPlot bar chart in jsp .Now i have seen an option of button click to view chart as image and save it into image but i dont know how to achieve this ..
  I have added button code..</p>
  
  <p>Here is my code..</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
          $(document).ready(function(){
              $.jqplot.config.enablePlugins = true;
              var s1 = [200, 600, 700, 1000,1400];
              var ticks = ['Local', 'STD', 'ISD', 'INET','Incoming'];
  
              plot1 = $.jqplot('chart1', [s1], {
                  // Only animate if we're not using excanvas (not in IE 7 or IE 8)..
                  animate: !$.jqplot.use_excanvas,
                  seriesDefaults:{
                      renderer:$.jqplot.BarRenderer,
                      pointLabels: { show: true }
                  },
                  axes: {
                      xaxis: {
                          renderer: $.jqplot.CategoryAxisRenderer,
                          ticks: ticks
                      }
                  },
                  highlighter: { show: true }
              });
  
              $('#chart1').bind('jqplotDataClick',
              function (ev, seriesIndex, pointIndex, data) {
                  $('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
              }
          );
          });
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;br/&gt;
      &lt;br/&gt;
      &lt;input type="submit" name="ViewImage" id="view" value="ViewImage"&gt;
      &lt;div name="chart1" id="chart1" value="chart1" style="height: 300px;width: 400px;left: 100px"&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Any help will be appreciated..</p>
  
  <p>Thanks in advance..</p>