未找到用于3d的highcharts插件cakephp选项

未找到用于3d的highcharts插件cakephp选项,cakephp,highcharts,Cakephp,Highcharts,您好,我正在为我的系统绘制图形,现在问题是我正在尝试在3d中绘制此图形,highchart有此选项,但在我的系统中找不到,这是我的代码: 控制器一切正常,但不是在3d中 public function columnacompra($id = null) { $this->loadModel('Soya'); $this->loadModel("SoyaProductorCompra"); $years = $this->S

您好,我正在为我的系统绘制图形,现在问题是我正在尝试在3d中绘制此图形,highchart有此选项,但在我的系统中找不到,这是我的代码:

控制器一切正常,但不是在3d中

public function columnacompra($id = null)
    {
        $this->loadModel('Soya');
        $this->loadModel("SoyaProductorCompra");
        $years = $this->SoyaProductorCompra->getYears();
        $distinct_years = array();
        foreach($years as $year) {
            $distinct_years[] = $year[0]['distinct_year'];
        }
        $this->set(compact('distinct_years'));

        if (!$id) {
                $this->Session->setFlash('Porfavor provea un id de usuario');
                $this->redirect(array('action'=>'index'));
        }
        $user = $this->Soya->findById($id);
        if (!$user) {
                $this->Session->setFlash('El id proporcionado no es valido');
                $this->redirect(array('action'=>'index'));
        }
        if (!$this->request->data) {
                $this->request->data = $user;
        }

        $SoyaMensual = array(120, 265, 245, 120, 265, 245,120, 265, 245,120, 265, 245);
        $SoyaDiario = array(120, 265, 245, 120, 265, 245,120, 265, 245,120, 265, 245);

        $chartName = 'Stacked Grouped Column Chart';

        $mychart = $this->HighCharts->create( $chartName, 'column' );

        $this->HighCharts->setChartParams(
            $chartName,
            array(
                'renderTo'          => 'columnwrapper',  // div to display chart inside
                'options3dEnabled' => true, //not found
                'chartWidth'            => 1000,
                'chartHeight'           => 750,
                'chartBackgroundColorLinearGradient'    => array(0,0,0,300),
                'chartBackgroundColorStops'     => array(array(0,'rgb(217, 217, 217)'),array(1,'rgb(255, 255, 255)')),
                'title'             => 'Tabla Comparativa',
                'subtitle'              => 'Soya Compras',
                'xAxisLabelsEnabled'        => TRUE,
                'xAxisCategories'           => array( 'Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'),
                'yAxisTitleText'        => 'Cantidad en (TM)',
                'enableAutoStep'        => FALSE,
                'creditsEnabled'        => FALSE,
                'plotOptionsSeriesStacking'     => 'normal'

            )
        );

        $johnSeries = $this->HighCharts->addChartSeries();
        $janeSeries = $this->HighCharts->addChartSeries();

        $johnSeries->addName('Mensual')
            ->addData($SoyaMensual)
            ->stack = 'compra';

        $janeSeries->addName('Diario')
            ->addData($SoyaDiario)
            ->stack = 'compra';


        $mychart->addSeries($johnSeries);
        $mychart->addSeries($janeSeries);



    }
风景在这里

<div class="actions">
<h3>Acciones</h3>
<ul>
<li><?php echo $this->Html->link( "Volver Atras",   array('action'=>'graficas', $this->data['Soya']['id'])); ?></li>
</ul>
</div>


<div class="chart">
    <h2>Tabla Comparativa de la cantidad de compras</h2>    

<?php echo $this->Html->script('modules/exporting');?>
<?php echo $this->Html->script('highcharts-3d');?>

    <div id="columnwrapper" style="display: block; float: left; width:90%; margin-bottom: 20px;"></div>
    <div class="clear"></div>   

    <?php echo $this->HighCharts->render('Stacked Grouped Column Chart'); ?>
</div>

疫苗
比较表
根据他们的代码,CakePHP使用的是3.x版本,而3D图表是在4.x版本中引入的。我想它是不受支持的。

从几天前开始,它已经被更新为支持3D图表。您可以在Github上提供的插件演示代码中找到如何实现它的代码示例

以下是如何为3D柱形图设置控制器操作:

public function column3d() {

            $chartData = array(
                29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4
            );

            $chartName = 'Column 3D Chart';

            $mychart = $this->Highcharts->create($chartName, 'column');

            $this->Highcharts->setChartParams($chartName, array(
                'renderTo' => 'column3dwrapper', // div to display chart inside
                'chartWidth' => 1000,
                'chartHeight' => 750,
                'title' => '3D Column Chart Demo',
                'subtitle' => 'Source: World Bank',
                'options3d' => array(
                    'enabled' => true,
                    'alpha' => 15,
                    'beta' => 15,
                    'depth' => 50,
                    'viewDistance' => 25
                ),
                'xAxisLabelsEnabled' => true,
                'yAxisTitleText' => 'Units',
                'enableAutoStep' => false,
                'creditsEnabled' => false,
                )
            );

            $series = $this->Highcharts->addChartSeries();

            $series->addName('3D Series')
                    ->addData($chartData);

            $mychart->addSeries($series);

            $this->set(compact('chartName'));
    }
在column3d.ctp视图文件中,您可以执行以下操作:

<div class="chart">
    <h4>Column 3D Chart</h4>

    <div id="column3dwrapper" style="display: block; float: left; width:90%; margin-bottom: 20px;"></div>
    <div class="clear"></div>   

    <?php echo $this->Highcharts->render($chartName); ?>

柱状三维图表