Skip to content

Class "PHPlot" not found. phplot, php8.3, Ubuntu 24.04  #17

@suovantie

Description

@suovantie

REASON FOUND: ( Now I got to go through all my 34 old programs )
In the example below there is :
$plot = new PHPlot(800, 600);.
Everything OK, if you write:
$plot = new Phplot\Phplot\phplot(800, 600);

Original message:
Running the program on command line
Error message "Class "PHPlot" not found" on line
$plot = new PHPlot(800, 600);.

Example code copied from:
https://phplot.sourceforge.net/phplotdocs/examples.htmlhttps://phplot.sourceforge.net/phplotdocs/examples.html

`<?php

PHPlot Example: Simple line graph

require_once 'phplot.php';

$data = array(
array('', 1800, 5), array('', 1810, 7), array('', 1820, 10),
array('', 1830, 13), array('', 1840, 17), array('', 1850, 23),
array('', 1980, 227), array('', 1990, 249), array('', 2000, 281),
);

$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');

$plot->SetPlotType('lines');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);

Main plot title:

$plot->SetTitle('US Population, in millions');

Make sure Y axis starts at 0:

$plot->SetPlotAreaWorld(NULL, 0, NULL, NULL);

$plot->DrawGraph();
?>
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions