谷歌API折线图



我这里有一个线形图,由于某些原因,没有画出理想的线。实际的线是画的线,但理想的不是

echo "<script>";
echo "google.load("visualization", "1", {packages:["corechart"]});";
echo "google.setOnLoadCallback(drawChart);";
echo "function drawChart() { ";
echo "var data = google.visualization.arrayToDataTable([
['id ','Ideal', 'Actual'],";
$number = 0;
$numbers = 1;

echo "[0,$sum,$sum2],";

下面是断行的代码(如果我的值是空值,它就会划清界限)

while($row = mysql_fetch_array($query))
{
$Ideal = $row['UserStoryPoints'];
$Actual = $row['WorkRemain'];
            echo "[$numbers, null ,$Actual],";
$numbers++;
}

echo "[$numbers,0,,],";
echo "]);";
echo "var options = {
    pointSize: 5,
  title: 'Burn down chart - $test',
     hAxis: {
         minValue: $numbers,
         format:'0',
         title: 'Each Day',      
    },
    vAxis: {
         format:'0',
         title: 'Number of hours',
    },
};";
echo "var chart = new google.visualization.LineChart(document.getElementById('chart_div'));";
echo "chart.draw(data, options);";
  echo "}
</script>";

对不起,这个答案太简单了吗?

echo "[$numbers, $Ideal ,$Actual],";

相关内容

  • 没有找到相关文章

最新更新