Why we are NOT getting the graph in html page when using the 36chartreadwriteHTML.php

Topics: Developer Forum, User Forum
Jan 29, 2014 at 6:34 AM
Want to see the html with tabular and graphical view when using the 36chartreadwriteHTML.php
What we are seeing is only the TABULAR View. we should have see the graph - which is a line graph in this case.

Result: Seeing 1 block at the end of the table (screenshot)


Please help
Jan 30, 2014 at 2:43 PM
Although the case is planned, it appears that the script stops before arriving at the cell containing the graph.

Try this: edit the file HTML.php (in PHPExcel/Writer) , around line 541, you should have this code (which is part of the _extendRowsForChartsAndImages method) :
        $html = '';
        while ($row < $rowMax) {
            $html .= '<tr>';
            for ($col = 'A'; $col != $colMax; ++$col) {
Change the operator in while condition :
        while ($row <= $rowMax) {
Jan 31, 2014 at 4:08 AM
Thanking for your replay but as per your change in code, an error occurred.. The error message is as below"-
__Warning: require_once(../Classes/PHPExcel/Chart/Renderer/jpgraph.php/jpgraph.php): failed to open stream: No such file or directory in C:\xampp\htdocs\PHPExcel\Classes\PHPExcel\Chart\Renderer\jpgraph.php on line 30

Fatal error: require_once(): Failed opening required '../Classes/PHPExcel/Chart/Renderer/jpgraph.php/jpgraph.php' (include_path='.;C:\xampp\php\PEAR;../Classes/;../Classes/PHPExcel/Chart/Renderer/jpgraph.php') in C:\xampp\htdocs\PHPExcel\Classes\PHPExcel\Chart\Renderer\jpgraph.php on line 30

Note : my rendererLibrary and rendererName is given below
$rendererName = PHPExcel_Settings::CHART_RENDERER_JPGRAPH;
$rendererLibrary = 'jpgraph.php';
$rendererLibraryPath = '../Classes/PHPExcel/Chart/Renderer/' . $rendererLibrary;

and the output of this HTML page is blank.Please help me out for this solution... If possible can i get any sample program of this ??
Thanking you in advance...
Jan 31, 2014 at 7:10 AM
PHPExcel doesn't come bundled with jpGraph, it requires you to have installed it somewhere in your system; and setting the renderer details is your way of telling PHPExcel whereabouts in the server filesystem you have installed it.... you're simply pointing PHPExcel to its own "wrapper" that serves as the interface between PHPExcel and an installed version of jpGraph.

PHPExcel knows where to find its own files, including the wrapper files (that applies with PDF renderers as well).... what it doesn't know is where the actual jpGraph library is installed, so setting the renderer library path is your way of telling PHPExcel where to find the actual jpGraph library, not its own jpGraph wrapper.
Feb 5, 2014 at 8:14 AM
Dear Mark,

Thanks for your assistance for helping me out.
It worked as you suggested...Thanks a ton

Now i need a bit more support - how to add the DATA-LABELS into the graph.I am getting the LEGENDS displayed properly when
converting into html page ( please see the image : )


My idea is to have the DATA-LABEL + LEGENDS printed in the html page ( like this ----> : )


I did an R&D and see in the jpgraph_bar chart there is a function to add Legends ( function Legend($graph) )... Is this the place I should focus on?
I tried to save a bar chart template with data-labels - but it did not worked.
Feb 9, 2014 at 11:04 PM
HI friend
you who posed the problem of style after the generate file!
Have you found a solution to style?

I'm stuck :(