我使用的是基本列Highcharts,它可以正常工作直到
1-我全部值为null然后我有错误:未捕获错误:Highcharts错误#13 (对我来说,我可以引入空值)
更新----整个错误:
我的代码:
public function myChartBasicColumn($date, $list1, $list2)
{
$sellsHistory = array(
$list1,
$list2,
);
$dates = $date;
$ob = new Highchart();
// ID de l'élement de DOM que vous utilisez comme conteneur
$ob->chart->renderTo('myChart');
$ob->title->text('<span style="color:#0068BA"> myChart </span>');
$ob->chart->type('column');
$ob->plotOptions->column(
array(
'dataLabels' => array(
'enabled' => true,
)
)
);
$ob->yAxis->title(array('text' => " myChart "));
$ob->xAxis->title(array('text' => ""));
$ob->xAxis->categories($dates);
$ob->series($sellsHistory);
return $ob;
}
$list1= array(
'name' => 'Global',
'type' => 'column',
'color' => '#4572A7',
'dataLabels' => array(
'enabled' => true
),
'data' => $data1
);
$list2 = array(
'name' => 'Ressource',
'type' => 'column',
'color' => '#D49EDA',
'dataLabels' => array(
'enabled' => true
),
'data' => $data2
);
$column = $chart->myChartBasicColumn($date, $list1, $list2);
$html = $this->render('AdminBundle:admin:chart.html.twig',array(
'en' =>$en,
'myChart' => $column,
))->getContent();