Hi,

This is the code I am using.

google.load("visualization", "1", {packages:["corechart"]});
 google.setOnLoadCallback(drawVisualization);
 var callCount = "<?= $chartCount?>";
 var callDate = "<?= $chartDate?>";
 var callCountPre = "<?= $chartCountPre?>";
 var newCount = callCount.split("-");
 var newDate = callDate.split("-");
    for (var i = 0; i<7;i++) {
     if (!newCount[i])
     newCount[i] = 0;
       eval("callCounts" + i + " = newCount[i]");
       eval("callDates" + i + " = newDate[i]");       
     }
 var newCountPre = callCountPre.split("-");
    for (var i = 0; i<7;i++) {
     if (!newCountPre[i])
     newCountPre[i] = 0;
       eval("callCountsPre" + i + " = newCountPre[i]");
     }
  function drawVisualization() {
      var data = new google.visualization.DataTable();
    data.addColumn('string', 'Range');
      data.addColumn('number', '<?= $selectedRange?>');
      data.addColumn('number', '<?= $selectedRangePre?>');  
      data.addRow([callDates0, parseInt(callCounts0), 
parseInt(callCountsPre0)]);
      data.addRow([callDates1, parseInt(callCounts1), 
parseInt(callCountsPre1)]);
      data.addRow([callDates2, parseInt(callCounts2), 
parseInt(callCountsPre2)]);
      data.addRow([callDates3, parseInt(callCounts3), 
parseInt(callCountsPre3)]);
      data.addRow([callDates4, parseInt(callCounts4), 
parseInt(callCountsPre4)]);      
      data.addRow([callDates5, parseInt(callCounts5), 
parseInt(callCountsPre5)]);
      data.addRow([callDates6, parseInt(callCounts6), 
parseInt(callCountsPre6)]);
  // Create and draw the visualization.
      new 
google.visualization.LineChart(document.getElementById('visualization')).
      draw(data, {curveType: "function",
                  width: 500, height: 200,
                  colors:['#1770CB','#F4C741'],
                  vAxis: {maxValue: <?= $maxChartValue ?>}
      });
   }
    </script>
    <div id="visualization"></div>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/ExjXFI0x3fgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to