pChart 2.x forum http://wiki.pchart.net/forum/ |
|
PChart output format http://wiki.pchart.net/forum/viewtopic.php?f=3&t=2131 |
Page 1 of 1 |
Author: | kurteknikk [ Wed Aug 10, 2011 9:29 am ] |
Post subject: | PChart output format |
Hi, I'm new to pchart but i really like its slick design. I just need one thing which i'm not sure if its available or not. Is it possible to get the actual image bytes from the pchart object to put them directly in the image tag instead of creating a seperate php script for every chart i have? |
Author: | jean-damien [ Wed Aug 10, 2011 12:35 pm ] |
Post subject: | Re: PChart output format |
Hi, You should be able to do something like this : Code: ob_start(); imagepng($image); $contents = ob_get_contents(); ob_end_clean(); echo "<img src='data:image/png;base64,".base64_encode($contents)."' />"; but I've not tested it. The main idea is to keep the scripts doing the pictures away from the code that is generating your HTML page. JD. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |