我很难找到一个明确的答案。我正在尝试查询通过 MVC4 创建的现有数据库,下面是用于创建它的代码。我希望能够对数据执行计算,并在第二个代码块中用虹吸数据替换条形图数组。谢谢。
public class GradeBook
{
public int ID { get; set; }
public string CourseNo { get; set; }
public string Course { get; set; }
public string StudentID { get; set; }
public string StudentName { get; set; }
public string AssignType { get; set; }
public int Grade { get; set; }
public DateTime Date { get; set; }
}
public class GradeBookDBContext : DbContext
{
public DbSet<GradeBook> GradeBooks { get; set; }
}
<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([
['Grade', 'Midterm', 'Final'],
['<50', 1000, 400],
['60-69', 1000, 400],
['70-79', 1170, 460],
['80-89', 660, 1120],
['90-100', 1030, 540]
]);