2

使用我的 Laravel 应用程序,我拥有的 PHPPresentation 库可以生成完全没有错误的精美图表。现在,当我在 CodeIgniter 应用程序上应用它时,我只是复制粘贴代码并安装了一个作曲家,图表不再工作了

我尝试手动安装PHPPresentation并阅读文档,但无济于事,没有一个成功

// 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);

回到我的 Laravel 应用程序中,这个 PHPPresentation 示例工作得很好,但是当我把它放在我的 CodeIgniter 应用程序中时,它显示一个空白图像

这是一个示例输出:

截屏

4

0 回答 0