aspx页面问题和MSChart控件绘制雷达图如何实现数据绑定问题探究。
最近刚开始学习ASP.NET,但是还不知道这个ASPX页面引入MSCHART控件绘制的雷达图,但是这个chart类, 怎样才能引入到它的后台控制代码cs文件中。我写的ASPX页面代码Radar.aspx如下:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Radar</title>
<link rel="stylesheet" type="text/css" href="../../ext-3.0/resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext-3.0/adapter/ext/ext-base.js"> </script>
<script type="text/javascript" src="../../ext-3.0/ext-all.js"> </script>
<script type="text/javascript" src="../../ext-3.0/ext-lang-zh_CN.js"> </script>
<script type="text/javascript" src="../../JavaScripts/DataDisplay/Radar.js"></script>
<script type="text/javascript" src="../../My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
</head>
<form id="form1" runat="server">
<asp:Chart ID="Chart1" runat="server" Width="414px">
<Series>
<asp:Series ChartType="Radar" CustomProperties="CircularLabelsStyle=Horizontal"
Name="Series1">
</asp:Series>
<asp:Series ChartArea="ChartArea1" ChartType="Radar" Name="Series2">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<AxisX>
<CustomLabels>
<asp:CustomLabel Text="检查量(X1000)" />
<asp:CustomLabel Text="检查时间" />
<asp:CustomLabel Text="检查费用(X10万)" />
<asp:CustomLabel Text="报告阳性率" />
<asp:CustomLabel Text="设备开机率" />
<asp:CustomLabel Text="随访率" />
</CustomLabels>
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</form>
</html>
它的后台控制代码DataDisplay.cs如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Data;
using System.Data.SqlClient;
namespace MvcTest.Controllers.DataDisplay
{
public class DataDisplayController : Controller
{
//
// GET: /DataDisplay/
public ActionResult Radar()
{
return View();
}
public struct record
{
public string Month;
public double CheckCount;
public double Masculine;
public double OnDevice;
public int CheckMinutes;
public double CheckPrice;
public double Reviews;
};