2

With my Laravel app, the PHPPresentation library I had is producing fine charts with no errors at all. Now when I'm applying it on a CodeIgniter app, I just copy pasted the code and installed a composer, the chart isn't working anymore

I tried to install the PHPPresentation manually and read the documents, but to no avail, not a single one succeeded

// Create new PHPPresentation object
$objPHPPresentation = new PhpPresentation();

// Set properties
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')
        ->setLastModifiedBy('PHPPresentation Team')
        ->setTitle('Sample 01 Title')
        ->setSubject('Sample 01 Subject')
        ->setDescription('Sample 01 Description')
        ->setKeywords('office 2007 openxml libreoffice odt php')
        ->setCategory('Sample Category');

// Point towards the last slide
$currentSlide = $objPHPPresentation->getActiveSlide();

//Data
    $seriesData = array(
        'Monday'    => 12,
        'Tuesday'   => 15,
        'Wednesday' => 13,
        'Thursday'  => 17,
        'Friday'    => 14,
        'Saturday'  => 9,
        'Sunday'    => 7
    );

    // Set Style
    $oFill = new Fill();
    $oFill->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('ffe6e6'));

    $oShadow = new Shadow();
    $oShadow->setVisible(true)->setDirection(45)->setDistance(10);

    //Define Line Chart lines
    $oOutline = new Outline();
    $oOutline->getFill()->setFillType(Fill::FILL_SOLID);
    $oOutline->getFill()->setStartColor(new Color(Color::COLOR_BLACK));
    $oOutline->setWidth(1);

    // Create a line chart (that should be inserted in a shape)
    $lineChart = new Line();
    $series = new Series('Views', $seriesData);

    $series->setShowSeriesName(false);
    $series->setShowValue(true);
    $series->getFont()->setSize(12);
    $series->setOutline($oOutline);

    $lineChart->addSeries($series);

Back in my Laravel app this PHPPresentation sample works perfectly fine, but when I placed it in my CodeIgniter app, it shows a blank image

Here's a sample output:

Screenshot

Suomynona
  • 639
  • 1
  • 5
  • 20
  • What do the error logs show in e.g. `/application/logs/`? – Coanda Apr 12 '19 at 09:00
  • hello @Coanda, where can I see the logs? I've opened the `/application/logs` folder and it only contains an `index.html` file but no other contents – Suomynona Apr 12 '19 at 09:24
  • Does the server has writing permissions for `/application/logs`? You could try to make a deliberate error in another script to see whether `/application/logs` is working. You could also try to look in the error logs of the server, but I find the `/application/logs` more useful/readable. – Coanda Apr 12 '19 at 09:27
  • sir @Coanda, I'm only developing it in my local machine so I'm quite sure it has the right permissions. As for how to make a deliberate error in another script -- is something I'm not familiar. Please bear with me as this application is also "legacy" to me. I went back to my Laravel application and the codes work perfectly fine – Suomynona Apr 12 '19 at 09:31
  • 2
    It's impossible to debug this based on the information you have given, you need to create a github repo, add a sample code that presents the same issue & have people look at it to figure out what's wrong – ahmad Apr 16 '19 at 14:43
  • 1
    hello and good day sir @ahmad for this situation, I was able to produce the right output in my Laravel app, I was even testing out the sample codes to produce charts in the pptx file. And then when I copy pasted it in my CodeIgniter app, I was able to produce the pptx file, the "textual" slides are working fine, but the slides that supposed to have charts are blank. How will I know which code to post? because the pptx file is generated properly, only the slides with charts don't. May you kindly guide me with this one? I don't want to abide with StackOverflow's guidelines... – Suomynona Apr 22 '19 at 01:11
  • The only thing I can think of without having the actual code is your `$seriesData` produces different output for each framework ... check the output of `seriesData` and match it to the Laravel one. – ahmad Apr 22 '19 at 15:19
  • 1
    sir @ahmad, the variable `$seriesData` is only an array sir as given in the code snippet above :( – Suomynona Apr 23 '19 at 06:11

0 Answers0