php - PHPChart how to export to pdf,and image? -


i'm using phpchart creating charts, want have option exporting charts pdf , images. bellow code:

<link rel="stylesheet" type="text/css" href="/phpchart_enterprise/js/src/jquery.jqplot.css" /> <!--<link rel="stylesheet" type="text/css" href="/phpchart_enterprise/examples/examples.css" />--> <!--[if lt ie 7]> <script type="text/javascript" src="../../flot/excanvas.js"></script> <![endif]--> <!--[if lt ie 7]> <script type="text/javascript" src="../../explorercanvas/excanvas.js"></script> <![endif]--> <!--[if lt ie 9]> <script type="text/javascript" src="/phpchart_enterprise/js/src/excanvas.js"></script> <![endif]--> <!--[if lt ie 7]> <script type="text/javascript" src="../../flashcanvas/src/flashcanvas.js"></script> <![endif]-->  <!-- begin: load jquery --> <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/jquery.js"></script> 
<!-- begin: load jqplot --> <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/jquery.jqplot.js"></script> <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/plugins/jqplot.categoryaxisrenderer.js"></script> <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/plugins/jqplot.dateaxisrenderer.js"></script> <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/plugins/jqplot.barrenderer.js"></script> <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/plugins/jqplot.canvasaxistickrenderer.js">   </script>  <script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/plugins/jqplot.canvastextrenderer.js"></script>   <!--<script language="javascript" type="text/javascript" src="/phpchart_enterprise/js/src/canvashack2.js"></script>--> <script type="text/javascript"> $(document).ready(function(){      if (!$.jqplot.use_excanvas) {         $('div.jqplot-target').each(function(){             // add view image button             var btn = $(document.createelement('button'));             btn.text('view png');             btn.bind('click', {chart: $(this)}, function(evt) {                 evt.data.chart.jqplotviewimage();             });             $(this).after(btn);              // add save image button             btn = $(document.createelement('button'));             btn.text('save png');             btn.bind('click', {chart: $(this)}, function(evt) {                 evt.data.chart.jqplotsaveimage();             });             $(this).after(btn);             btn = null;         });     }      $('#stackchart1').canvashack(); }); </script> 

but when click on generated buttons save png , view png browser goes loading , down.

for , guid thanks.

did check out image export example? it's done in javascript.

http://phpchart.com/phpchart/examples/export_image.php

not sure pdf export, believe require server side script. see example below.

https://phpchart.uservoice.com/knowledgebase/articles/443666-how-to-export-my-chart-on-the-server-side-in-php


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -