Support the ongoing development of →
Configuration Eloquent Architecture
Last updated 2 years ago.

Please show error log

Last updated 2 years ago.

[2014-07-29 22:30:40] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'JpGraph\src\jpgraph\Graph' not found' in D:\SensorClusterApp\app\controllers\TemperatureController.php:19 Stack trace: #0 [internal function]: Illuminate\Exception\Handler->handleShutdown() #1 {main} [] []

Last updated 2 years ago.

If you're ok with javascript graphs you have tons of them available. Chartjs is very simple to integrate.

Or try adding

base_path() . '/vendor/{JpGraph_dir}'

to app/start/global.php at the end (or it might go to ClassLoader in same file). It might work.

Last updated 2 years ago.

Yea i could use that, but i would like to understand why its not working..

Last updated 2 years ago.

You don't need to add a line to require vendor/autoload.php in your controller. You DO, however, need to run composer dump-autoload from the command line.

Last updated 2 years ago.

I see. you not yet complete in config/app.php and publish this

require 'D:/SensorClusterApp/Vendor/autoload.php';

i think not need

Last updated 2 years ago.

Ok got it! But how do i instantiate a class that is inside a wrapper? JpGraph.php has a lot of classes, doing

$graph = new \JpGraph\src\jpgraph\Graph();

doesnt work!

Last updated 2 years ago.

Here it is, the working example, put this in routes.php JpGraph is initialized with static methods load, and then module... load module that you need.

Route::any("/rs", function () {


// Some data
    $data = array(50, 28, 25, 27, 31, 20);

// A new pie graph
    $graph = new PieGraph(600, 600, 'auto');

// Setup title
    $graph->title->Set("Pie plot with center circle");
    $graph->title->SetFont(FF_ARIAL, FS_BOLD, 14);
    $graph->title->SetMargin(8); // Add a little bit more margin from the top
// Create the pie plot
    $p1 = new PiePlotC($data);

// Set size of pie

// Label font and color setup
    $p1->value->SetFont(FF_ARIAL, FS_BOLD, 10);

// Setup the title on the center circle
    $p1->midtitle->Set("Test mid\nRow 1\nRow 2");
    $p1->midtitle->SetFont(FF_ARIAL, FS_NORMAL, 10);

// Set color for mid circle

// Use percentage values in the legends values (This is also the default)

// Add plot to pie graph

// .. and send the image on it's marry way to the browser

    $response = Response::make(

    $response->header('content-type', 'image/png');

    return $response;

Last updated 2 years ago.

Thanks @majstors , works flawlessly! I had an issue regarding the BarPlot class, but adding:



Last updated 2 years ago.

I'm still struggling to get JpGraph working in Laravel 5. What are the complete steps to reference all the classes?


Sign in to participate in this thread!


Your banner here too?

ViktorHSN viktorhsn Joined 29 Jul 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.