I want to use the Google Api Chart http://code.google.com/apis/chart/
but because my users has to enter two dates, my graph will never look
the same as it depends on the dates. The values that should go into
the graph is in the code behind, can someone please help me to get
this into the google api javascript;



<script type="text/javascript">
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);
    function drawChart() {
      var data = new google.visualization.DataTable();

      data.addColumn('string', 'Valuation Date');
      data.addColumn('number', 'Construction Cash Flow');
      data.addColumn('number', 'Upper Probability Limit');
      data.addColumn('number', 'Lower Probability Limit');

      data.addRows(4);
      data.setValue(0, 0, '2004');
      data.setValue(0, 1, 1000);
      data.setValue(0, 2, 400);
      data.setValue(0, 3, 550);
      data.setValue(1, 0, '2005');
      data.setValue(1, 1, 1170);
      data.setValue(1, 2, 460);
      data.setValue(1, 3, 551);
      data.setValue(2, 0, '2006');
      data.setValue(2, 1, 860);
      data.setValue(2, 2, 580);
      data.setValue(2, 3, 455);
      data.setValue(3, 0, '2007');
      data.setValue(3, 1, 1030);
      data.setValue(3, 2, 540);
      data.setValue(3, 3, 55);

      var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
      chart.draw(data, {width: 400, height: 240, title: 'Company
Performance'});
    }
    </script>



DataSet ds = new DataSet();
      DataTable dt = ds.Tables.Add("Table");
      dt.Columns.Add(new DataColumn("Valuation Date",
typeof(string)));
      dt.Columns.Add(new DataColumn("Construction Cash Flow",
typeof(string)));
      dt.Columns.Add(new DataColumn("Upper Probability Limit",
typeof(string)));
      dt.Columns.Add(new DataColumn("Lower Probability Limit",
typeof(string)));

        // fill rows
      foreach (DateTime valuationDate in GetDates(start, end,
validDay))
      {
        int numberOfDays = 0;
        if (valuationDate.Month == 12 || valuationDate.Month == 01)
        {
          numberOfDays = 14;
        }
        current += numberOfDays;

        DataRow row = dt.NewRow();
        row["Valuation Date"] = valuationDate.ToString("yyyy/MM/dd");
        row["Construction Cash Flow"] = Calculation(current, holiday,
validDay, b, valuationDate, start, end, construction_a,
construction_b);
        row["Upper Probability Limit"] = Calculation(current, holiday,
validDay, b, valuationDate, start, end, top_a, top_b);
        row["Lower Probability Limit"] = Calculation(current, holiday,
validDay, b, valuationDate, start, end, bottom_a, bottom_b);
        dt.Rows.Add(row);
      }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
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-chart-api?hl=en.

Reply via email to