我正在尝试将 HighCharts 与 ChakePHP 2.4 一起使用。*
我找不到在 View 中查看图表的好方法。
我已经安装cakephp-high-charts-plugin通过 GitHub。如果我转到演示路径,它确实会运行,但是当我在插件目录之外使用 Controller 时
<?php echo $this->HighCharts->render('ManageStates'); ?>
蛋糕 PHP 返回
Error: Chart: "1" could not be found. Ensure that Chart Name is the same string that is passed to $this->HighCharts->render() in your view. File: /var/www/armoire/app/Plugin/HighCharts/View/Helper/HighChartsHelper.php Line: 99
我的 Controller :
class CreagraphsController extends AppController {
public $name = 'Graphique etats';
public $components = array('HighCharts.HighCharts');
public $helpers = array('HighCharts.HighCharts');
public $uses = array();
public function Creagraphs() {
$chartName = 'ManageStates';
$mychart = $this->HighCharts->create( $chartName,'column' );
$this->HighCharts->setChartParams
(
$chartName
);
}
}
我可以使用目录 Controller 创建图表吗?我该如何执行此操作?
最佳答案
就像我在自己的帖子中已经说过的那样; cakephp highchart fatal error while rendering
该插件尚未在高于 1.3 的任何其他版本中进行测试,因此它无法工作。开发人员正在为 2.5 创建新版本,应该很快就会发布。 :)
关于javascript - cakephp 2.4 中的 highchart 到 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22634633/