0

hi guys, just a little help regarding GD Graph, is it not possible to combine the graph plus a little code to echo or display?? because, when i try to insert the code in the upper part of the program, it runs but if i put the code in the middle of the program, it does not.

require_once("gdgraph.php");
$sizeOfTheGraph= new GDGraph(1027,353,"X Bar-R Chart");
$plottedData = Array('Sample Data' => Array(3.4868, 3.4870,3.4870));
$olors = Array('Sample Data' => Array(228,6,6));		
$x_labels = Array('0','1','2');			
$thicknesses = Array('Sample Data' => 10);
$sizeOfTheGraph->line_graph($plottedData, $colors, $x_labels);

please help..thanks ^^

2
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by saiprem
1

hi guys, just a little help regarding GD Graph, is it not possible to combine the graph plus a little code to echo or display?? because, when i try to insert the code in the upper part of the program, it runs but if i put the code in the middle of the program, it does not.

require_once("gdgraph.php");
$sizeOfTheGraph= new GDGraph(1027,353,"X Bar-R Chart");
$plottedData = Array('Sample Data' => Array(3.4868, 3.4870,3.4870));
$olors = Array('Sample Data' => Array(228,6,6));		
$x_labels = Array('0','1','2');			
$thicknesses = Array('Sample Data' => 10);
$sizeOfTheGraph->line_graph($plottedData, $colors, $x_labels);

please help..thanks ^^

Yes, It is not possible to echo and displaying the graph, I have 2 suggestions for you to implement like this

Put the graph generation in different page
When ever you need to generate a graph
try like this

1)
echo "<img src='newpagegraph.php?data1=20.2&data2=4.40&anyothernecessarydata=otherdata'/>";

2)
echo "<iframe src='newpagegraph.php?data1=20.2&data2=4.40&anyothernecessarydata=otherdata'></iframe>";

Hope it helps you.

0

oh, thanks sir..i tried to display a simple hello world together with the graph but the graph did not show out. thanks for the code..^^

but still iam hoping that there is some..

0

oh, thanks sir..i tried to display a simple hello world together with the graph but the graph did not show out. thanks for the code..^^

but still iam hoping that there is some..

Have you tried implementing what I said..., If not do it, It will works for you.

0

sir, the code did not work, the image is crossed out.

Post your code here.. and manually execute your graph generation page by passing some parameters.

0

If we can see your code, we can understand better..and we will tell you the solution.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.