我在找到这个问题的答案时遇到了一些困难。我正在尝试查询通过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]
]);