你好我正在爲我的系統做一個grafic與highcharts plugin cakephp現在的問題是,我試圖在3D中做這個grafic,高圖有這個選項,但沒有在我的系統中找到,這是我的代碼:highcharts插件cakephp選項爲3d未找到
控制器一切工作正常,但不是在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>