3

I have a line graph here, and some reason the ideal line is not drawing. The actual line is drawing a line, but the ideal is not

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],";

Here is the code below that is breaking the line (it draws the line if i have value where it says null) (but it currently does not if the word null or no value in )

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>";

1 Answers1

0

Sorry is this too simple an answer?

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

Cameron
  • 995
  • 10
  • 16
  • That will cause the line to be up and down. The problem is that it has 2 dots on the prediction line... One at 43 hours, one at 0 hour, but the line does not draw – user3374969 May 18 '14 at 12:22