chart.jsでphpから値うけとってグラフ描画するメモ javascript

phpからのデータ取得時はどっちでも可
var array_data = <?php echo json_encode($array_data JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>;
var array_data = <?php echo "[" . implode($array_data " ") . "]" ?>;


<?php
$array_data = [993 8 1 955 77 99 3];
?>
var array_label = ["aaa1" "aaa2" "aa31" "aaa4" "aaa5" "aaa6" "aaa7"];
var array_data = <?php echo json_encode($array_data JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>;
//var array_data = <?php echo "[" . implode($array_data " ") . "]" ?>;

var areaChartData = {
labels : array_label
datasets: [
{
label : Electronics
fillColor : rgba(210 214 222 1)
strokeColor : rgba(210 214 222 1)
pointColor : rgba(210 214 222 1)
pointStrokeColor : #c1c7d1
pointHighlightFill : #fff
pointHighlightStroke: rgba(220 220 220 1)
data : array_data
}
{
label : Digital Goods
fillColor : rgba(60 141 188 0.9)
strokeColor : rgba(60 141 188 0.8)
pointColor : #3b8bba
pointStrokeColor : rgba(60 141 188 1)
pointHighlightFill : #fff
pointHighlightStroke: rgba(60 141 188 1)
data : [28 48 40 19 86 27 90]
}