저는 CodeIgniter 프레임 워크에서 PHP 프로젝트 빌드를 작업 중입니다. 이 응용 프로그램은 동적으로 생성되는 많은 그래프를 보유합니다. ronan-gloo highcharts library으로 큰 성공을 거두었습니다. 아래 그래프를 만들 확장이 더 큰 나를 돕고있다Highcharts 드릴 다운 차트 CodeIgniter
$this -> load -> library ('Highchart');
$chart = new Highchart ();
$chart -> chart -> renderTo = "divid";
$chart -> title -> text = "chart Title";
$chart -> xAxis -> categories = $xaxis;
$chart -> tooltip -> formatter = new HighchartJsExpr ("function() {
var s;
if (this.point.name) { // the pie chart
s = ''+
this.point.name +': '+ this.y;
} else {
s = '<b>'+ this.series.name +'</b><br/><i>' + this.x +'</i>: <b>'+ this.y + '%</b>';
}
return s; }");
$chart -> series [ ] = array (
'type' => "column" ,
'name' => "%age" ,
'data' => $yaxis ,
'color' => '#CC004B' ,
'showInLegend' => TRUE ,
'dataLabels' => array (
'enabled' => TRUE ,
'color' => '#CC004B' ,
'style' => array (
'fontSize' => '10px' ,
'verticalalign' => 'bottom'
)
)
);
foreach ($chart->getScripts() as $script) {
echo '<script type="text/javascript" src="' . $script . '"></script>';
}
echo "<script src='" . base_url () . "assets/js/jquery.cookie.js'></script>";
echo "<script type='text/javascript' src='" . base_url () . "assets/highcharts/js/exporting.js'></script>";
echo "<div id='divid'></div>";
echo "<script type='text/javascript'>" . $chart -> render ("chart1") . "</script>";
내 그래프를 생성하는 코드는 ... 그러나, Highcharts 난에서 구현하고자하는 것이 좋은 드릴 다운 기능 (High Charts Drilldown demo)가 내 계획.
데모에서는 차트를 만들 때 호출되는 드릴 다운 데이터 (JS Fiddle)가 들어있는 javascript 객체를 만드는 것이 좋습니다. 하지만 어떻게 PHP Codeigniter에서 자바 스크립트가 파리에 쓰여질 때 그것을 할 수 ...
도와주세요!