PHPコードを読み取るためにJavascriptを取得するのに少し行き詰まっています
これまでのところ、GoogleチャートのJavaScriptの数字をスクリプトの上部にあるPHP変数に置き換える必要があります。
どんな助けでも素晴らしいでしょう
<?php
$jan = 'SQL Code for Jan';
$feb = 'SQL Code for Feb';
$mar = 'SQL Code for Mar';
$apr = 'SQL Code for Apr';
$may = 'SQL Code for May';
$jun = 'SQL Code for Jun';
$jul = 'SQL Code for Jul';
$aug = 'SQL Code for Aug';
$sept = 'SQL Code for Sept';
$oct = 'SQL Code for Oct';
$nov = 'SQL Code for Nov';
$dec = 'SQL Code for Dec';
?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Month', '# of Logins'],
['Jan', 999; ],
['Feb', 1170],
['Mar', 660],
['Apr', 660],
['May', 660],
['Jun', 660],
['Jul', 660],
['Aug', 660],
['Sept', 660],
['Oct', 660],
['Nov', 660],
['Dec', 1030]
]);
var options = {
title: 'Number of Logins'
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
<div id="chart_div" style="width: 900px; height: 500px;"></div>