View unanswered posts | View active topics It is currently Fri Mar 29, 2024 6:24 am



Reply to topic  [ 2 posts ] 
PChart output format 
Author Message
New pChart user
New pChart user

Joined: Wed Aug 10, 2011 9:25 am
Posts: 1
Post 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?


Wed Aug 10, 2011 9:29 am
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post 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.


Wed Aug 10, 2011 12:35 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron