我对 ChartDirector v.5 API 有疑问
我将代码拖放到我的网站中。
当我转到特定页面时..它显示一条错误消息:
为 PHP 扩展加载 ChartDirector 时出错
已尝试动态加载 ChartDirector,但未成功。请参阅您的 ChartDirector 获取 PHP 文档或单击此处了解如何解决问题。
错误日志
Trying to load "phpchartdir530.dll" from the PHP extension directory "c:/wamp/bin/php/php5.3.5/ext/".
Fatal error: Call to undefined function dl() in C:\wamp\www\OrdiDepot\application\views\phpchartdir.php on line 44
Call Stack: 0.0018 378216
1. {main}() C:\wamp\www\OrdiDepot\index.php:0 0.0036 427824
2. require_once('C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php') C:\wamp\www\OrdiDepot\index.php:115 0.0329 1386232
3. call_user_func_array() C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php:236 0.0329 1386280
4. ordiDepot->apropos() C:\wamp\www\OrdiDepot\system\codeigniter\CodeIgniter.php:0 0.0344 1392432
5. CI_Loader->view() C:\wamp\www\OrdiDepot\application\controllers\ordiDepot.php:64 0.0344 1393128
6. CI_Loader->_ci_load() C:\wamp\www\OrdiDepot\system\libraries\Loader.php:307 0.0354 1452168
7. include('C:\wamp\www\OrdiDepot\application\views\apropos.php') C:\wamp\www\OrdiDepot\system\libraries\Loader.php:677 0.0537 3934888
8. require_once('C:\wamp\www\OrdiDepot\application\views\phpchartdir.php') C:\wamp\www\OrdiDepot\application\views\apropos.php:49 0.0538 3980304
9. cdLoadDLL() C:\wamp\www\OrdiDepot\application\views\phpchartdir.php:174
对于 require_once 文件..我将它放在与我的视图相同的目录中(我使用 MVC 模型)
这是我的代码:
<div class="center_content">
<div class="center_title_bar">À propos</div>
<div class="prod_box_big">
<div class="top_prod_box_big"></div>
<div class="center_prod_box_big">
<div class="details_big_box">
<div class = "info_compagnie">
L’entreprise OrdiDépôt Inc. est une PME de Montréal qui
a été créée en 2010. Elle œuvre dans le domaine de l’informatique
et le divertissement PC. OrdiDépôt Inc. est une compagnie de
vente de matériel dans ces domaines. Nous offrons : pièces
d’ordinateurs, systèmes complets et Jeux PC.
</div>
<div class = "graphic">
<?php
require_once('phpchartdir.php');
# The data for the pie chart
$data = array(25, 18, 15, 12, 8, 30, 35);
# The labels for the pie chart
$labels = array("Labor", "Licenses", "Taxes", "Legal", "Insurance", "Facilities",
"Production");
# Create a PieChart object of size 450 x 270 pixels
$c = new PieChart(450, 270);
# Set the center of the pie at (150, 100) and the radius to 80 pixels
$c->setPieSize(150, 135, 100);
# add a legend box where the top left corner is at (330, 50)
$c->addLegend(330, 60);
# modify the sector label format to show percentages only
$c->setLabelFormat("{percent}%");
# Set the pie data and the pie labels
$c->setData($data, $labels);
# Use rounded edge shading, with a 1 pixel white (FFFFFF) border
$c->setSectorStyle(RoundedEdgeShading, 0xffffff, 1);
# Output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));
?>
</div>
</div>
</div>
<div class="bottom_prod_box_big"></div>
</div>
</div> <!-- end of center content -->
谢谢大家