I try to create a new page and no success see:


Here the script:

Any idea why it does not work ?

Thank you for help.

wxepaisseurdeneige.php.txt (3.84 KB)

Hi Jean-Robert,

The reason it doesn’t work is the script inside is trying to create an image so the resulting PNG is embedded in the HTML instead of being recognized as a image and displayed by the browser.

Take this code

# PHPlot Example: Linepoints plot with Data Value Labels
require_once './phplot/phplot.php';

//Import and re-format data
$row = 0;
if (($handlex = fopen("customtextout.txt", "r")) !== FALSE) {
    while (($rdata = fgetcsv($handlex, 1440, ",")) !== FALSE) {
        $num = count($rdata);

$data[$row][0] = $rdata[3];        
$data[$row][1] = $rdata[6];        


//Added this section to get the last 24 records from the array - Thanks Kevin!

if((count($data)>24)) {
   $data = array_slice($data,-24);


$plot = new PHPlot(1600, 600);
$plot->SetImageBorderType('raised'); // Improves presentation in the manual
$plot->SetTitle("Epaisseur de la neige dernieres 24 heures a St-Etienne-des-Gres, Quebec Canada\n"
              . "(en cm)");

# Turn on Y data labels:

# Turn on X data label lines (drawn from X axis up to data point):

# With Y data labels, we don't need Y ticks, Y tick labels, or grid lines.
# X tick marks are meaningless with this data:



from the page and put it in a new file (all by itself, with no additional HTML before or after it. Call it plot-image1.php

Then in the wxepaisseurdeneig.php script, just put

<div id="main-copy">
<img src="plot-image1.php" />

</div><!-- end main-copy -->

Then the browser will invoke the plot-image1.php script via the call and the PNG should be displayed normally in the page.

Best regards,

Hi Ken

Thank you, it work very well.

Thank you for your precious help.