使用我的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应用程序中时,它显示空白图像
以下是示例输出: