Jump to content

Displaying Graphs


cleeclee

Recommended Posts

I'm having some troubles with displaying the graphs. It shows a broken image when i run it.

Below is my code. I have also attached a picture that should say that my gd library is working? Could i know which part of my code has to be corrected for it to display the graph i want?

<?php
header ("Content-type: image/png");
$x1=$_GET['x1'];
$x2=$_GET['x2'];
$y1=$_GET['y1'];
$y2=$_GET['y2'];

$im = @ImageCreate (100, 200)
or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 224, 234, 234);
$text_color = ImageColorAllocate ($im, 233, 14, 91);

// imageline ($im,$x1,$y1,$x2,$y2,$text_color);
imageline ($im,0,0,100,200,$text_color);
imageline ($im,100,0,0,200,$text_color);


ImagePng ($im);
?>

Link to comment
https://forums.phpfreaks.com/topic/268719-displaying-graphs/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.