View unanswered posts | View active topics It is currently Sat Apr 27, 2024 12:55 pm



Reply to topic  [ 3 posts ] 
More than one chart into a website 
Author Message
New pChart user
New pChart user

Joined: Tue Jan 31, 2012 2:44 pm
Posts: 3
Post More than one chart into a website
Hi,

How can I do to display more than on chart into a website?

Best regards.

Daniel.


Wed Feb 01, 2012 12:46 pm
Profile
New pChart user
New pChart user

Joined: Tue Jan 31, 2012 2:44 pm
Posts: 3
Post Re: More than one chart into a website
on = one


Thu Feb 02, 2012 12:34 pm
Profile
New pChart user
New pChart user

Joined: Wed Jul 18, 2012 9:06 am
Posts: 2
Post Re: More than one chart into a website
I've got the same problem. I need to create round about 10 different chars on one HTML page.

It works if you have different files (chart1.php, chart2.php) and call them in the image tag of your HTML code like this:
Code:
<img alt="" src="chart1.php" />


The main problem with this is. If you have to fetch different data from a database you have to do that in each of the chart*.php files which is bad, ugly and finally slow.
So the better option is get all the data you need for all charts, put the data into different arrays and access those arrays in one or more well functions I would say.
The problem is this is what I currently can't get to work. :(

If I use a normal PHP functions like lets say renderChart1($myChartTitle, $myChartDataX,$myChartDataY,...) of my initial buildPage() function (here the SQL stuff fetches the data) at my chart_generator.php class to create the chart.
Then I'll get the binary image data which is displayed in my HTML code when I call the functions at my '<img alt="" src="'.renderChart1(...parameters...).'" />' string creation. HTML-String creation is the problem here. The image will be interpreted as text as it is concated into the image src.
This I don't want. ;)
So how do I do it the "correct" way?
Storing the data in _SESSION scope and access the arrays then from another chart1.php file?

The charts will be different for each user (and once additional data is available the old one is also of no use) so the pCache isn't going to help. I could write the image to the filesystem but is this cleaned up?

Sorry, I'm normally develop applications in other languages (like Java, C#,...). PHP had to be used because of LimeSurvey where I replaced the original pChart v1.x version with the new pChart v2.x library. I need it for some very special charts.

Some hints seem to be in this thread: viewtopic.php?f=1&t=29357


Wed Jul 18, 2012 4:18 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 7 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