縦棒グラフ、折れ線グラフ、円グラフを作成する際にphp変数を導入するにはどうすればよいですか?
<?php $numero = 9; ?>
<script type="text/javascript">
var mes_I = "<?p h p echo $numero; ?>";
var chart;
$(function container_V () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container_V'
},
title: {
text: 'Média de Utilização de Animais'
},
xAxis: {
categories: ["mes_III", "mes_II", "mes_I"]
},
tooltip: {
formatter: function() {
var s;
if (this.point.name) { // the pie chart
s = ''+
this.point.name +': '+ this.y +'%';
} else {
s = ''+
this.x +': '+ this.y;
}
return s;
}
},
labels: {
items: [{
html: 'Utilização',
style: {
left: '40px',
top: '8px',
color: 'black'
}
}]
},
series: [{
type: 'column',
name: 'Mouse',
color: 'white',
data: [mes_I]
}, {
type: 'spline',
name: 'Average',
data: [3, 2.67, 3],
marker: {
lineWidth: 3,
lineColor: Highcharts.getOptions().colors[3],
fillColor: 'black'
}
}, {
type: 'pie',
name: 'Total consumption',
data: [{
name: 'LABCET',
y: 10,
color: '#006400'
}, {
name: 'LPEP',
y: 19,
color: '#00BFFF'
}],
center: [70, 75],
size: 100,
showInLegend: false,
dataLabels: {
enabled: false
}
}]
});
});
});
</script>
値 '9' を含む変数 mes_I は OK です。ただし、指定されたシリーズを入力しても表示されません。