title: PHPChart how to export to pdf,and image?
body: <p>I'm using PHPChart for creating charts, now i want to have an option for exporting charts to pdf and images. 
  Bellow is my code:</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="/phpChart_Enterprise/js/src/jquery.jqplot.css" /&gt;
  &lt;!--&lt;link rel="stylesheet" type="text/css" href="/phpChart_Enterprise/examples/examples.css" /&gt;--&gt;
  &lt;!--[if lt IE 7]&gt;
  &lt;script type="text/javascript" src="../../flot/excanvas.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  &lt;!--[if lt IE 7]&gt;
  &lt;script type="text/javascript" src="../../explorercanvas/excanvas.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  &lt;!--[if lt IE 9]&gt;
  &lt;script type="text/javascript" src="/phpChart_Enterprise/js/src/excanvas.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  &lt;!--[if lt IE 7]&gt;
  &lt;script type="text/javascript" src="../../flashcanvas/src/flashcanvas.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  
  &lt;!-- BEGIN: load jquery --&gt;
  &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/jquery.js"&gt;&lt;/script&gt;
  </code></pre>
  
     
  
  <pre><code>&lt;!-- BEGIN: load jqplot --&gt;
  &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/jquery.jqplot.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/plugins/jqplot.categoryAxisRenderer.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/plugins/jqplot.dateAxisRenderer.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/plugins/jqplot.barRenderer.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/plugins/jqplot.canvasAxisTickRenderer.js"&gt;   &lt;/script&gt;
   &lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/plugins/jqplot.canvasTextRenderer.js"&gt;&lt;/script&gt;
    &lt;!--&lt;script language="javascript" type="text/javascript" src="/phpChart_Enterprise/js/src/canvasHack2.js"&gt;&lt;/script&gt;--&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(function(){
  
      if (!$.jqplot.use_excanvas) {
          $('div.jqplot-target').each(function(){
              // Add a view image button
              var btn = $(document.createElement('button'));
              btn.text('View as PNG');
              btn.bind('click', {chart: $(this)}, function(evt) {
                  evt.data.chart.jqplotViewImage();
              });
              $(this).after(btn);
  
              // add a save image button
              btn = $(document.createElement('button'));
              btn.text('Save as PNG');
              btn.bind('click', {chart: $(this)}, function(evt) {
                  evt.data.chart.jqplotSaveImage();
              });
              $(this).after(btn);
              btn = null;
          });
      }
  
      $('#stackChart1').CanvasHack();
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>But when i click on generated buttons <code>Save as PNG</code> and <code>View AS PNG</code> browser goes to loading and down.</p>
  
  <p>For any help and guid thanks.</p>