复制代码 代码如下:
<configuration>
<system.webServer>
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>
</system.web>
</configuration>
复制代码 代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="chart.aspx.cs" Inherits="chart" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<!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 runat="server">
<title>MsChart图表控件</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Chart ID="Chart1" runat="server" Width="500px" BorderDashStyle="Solid" Palette="BrightPastel" imagetype="Png" BackSecondaryColor="White" BackGradientStyle="TopBottom" BorderWidth="2" backcolor="#D3DFF0" BorderColor="26, 59, 105">
<Titles>
<asp:Title Font="微软雅黑, 16pt" Name="Title1" Text="统计表">
</asp:Title>
</Titles>
<borderskin skinstyle="Emboss"></borderskin>
<Series>
<asp:Series Name="Series1" ChartType="Bubble" MarkerSize="8" MarkerStyle="Circle">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="Transparent" BackColor="64, 165, 191, 228" ShadowColor="Transparent" BackGradientStyle="TopBottom">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
<asp:Chart ID="Chart2" runat="server">
<Series>
<asp:Series Name="Series1">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
<br/>
<asp:Chart ID="Chart3" runat="server">
<Series>
<asp:Series Name="Series1">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
<asp:Chart ID="Chart4" runat="server">
<Legends>
<asp:Legend Title="金牌榜"></asp:Legend>
</Legends>
<Series>
<asp:Series Name="Series1">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</div>
</form>
</body>
</html>
复制代码 代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
//add
using System.Drawing;
public partial class chart : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = CreatData();
GetStyle1(dt);
GetStyle2(dt);
GetStyle3(dt);
GetStyle4(dt);
}
protected void GetStyle1(DataTable dt)
{
#region 折线图
Chart1.DataSource = dt;//绑定数据
Chart1.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Line;//设置图表类型
Chart1.Series[0].XValueMember = "Country";//X轴数据成员列
Chart1.Series[0].YValueMembers = "Score";//Y轴数据成员列
Chart1.ChartAreas["ChartArea1"].AxisX.Title = "国家";//X轴标题
Chart1.ChartAreas["ChartArea1"].AxisX.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远
Chart1.ChartAreas["ChartArea1"].AxisY.Title = "金牌";//X轴标题
Chart1.ChartAreas["ChartArea1"].AxisY.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远
Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;//X轴数据的间距
Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;//不显示竖着的分割线
Chart1.Series[0].IsValueShownAsLabel = true;//显示坐标值
#endregion
}
protected void GetStyle2(DataTable dt)
{
#region 样条图(平滑曲线)
Chart2.DataSource = dt;//绑定数据
Chart2.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Spline;//设置图表类型
Chart2.Series["Series1"].MarkerStyle = System.Web.UI.DataVisualization.Charting.MarkerStyle.Cross;//设置点的样式,十字形
Chart2.Series[0].XValueMember = "Country";//X轴数据成员列
Chart2.Series[0].YValueMembers = "Score";//Y轴数据成员列
Chart2.ChartAreas["ChartArea1"].AxisX.Title = "国家";//X轴标题
Chart2.ChartAreas["ChartArea1"].AxisX.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远
Chart2.ChartAreas["ChartArea1"].AxisY.Title = "金牌";//X轴标题
Chart2.ChartAreas["ChartArea1"].AxisY.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远
Chart2.ChartAreas["ChartArea1"].AxisX.Interval = 1;//X轴数据的间距
Chart2.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;//不显示竖着的分割线
Chart2.Series[0].IsValueShownAsLabel = true;//显示坐标值
#endregion
}
protected void GetStyle3(DataTable dt)
{
#region 条形图
Chart3.DataSource = dt;//绑定数据
Chart3.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Bar;//设置图表类型
Chart3.Series[0].XValueMember = "Country";//X轴数据成员列
Chart3.Series[0].YValueMembers = "Score";//Y轴数据成员列
Chart3.ChartAreas["ChartArea1"].AxisX.Title = "国家";//X轴标题
Chart3.ChartAreas["ChartArea1"].AxisX.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远
Chart3.ChartAreas["ChartArea1"].AxisY.Title = "金牌";//X轴标题
Chart3.ChartAreas["ChartArea1"].AxisY.TitleAlignment = StringAlignment.Far;//设置Y轴标题的名称所在位置位远
Chart3.ChartAreas["ChartArea1"].AxisX.Interval = 1;//X轴数据的间距
Chart3.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;//不显示竖着的分割线
Chart3.Series[0].IsValueShownAsLabel = true;//显示坐标值
#endregion
}
protected void GetStyle4(DataTable dt)
{
#region 饼形图
Chart4.DataSource = dt;//绑定数据
Chart4.Series["Series1"].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Pie;//设置图表类型
Chart4.Series[0].XValueMember = "Country";//X轴数据成员列
Chart4.Series[0].YValueMembers = "Score";//Y轴数据成员列
Chart4.Series[0].LegendMapAreaAttributes = "Country"; //显示国家
Chart4.Series[0].IsValueShownAsLabel = true;//显示坐标值
#endregion
}
/// <summary>
/// 创建一张二维数据表
/// </summary>
/// <returns>Datatable类型的数据表</returns>
protected DataTable CreatData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Country", System.Type.GetType("System.String"));
dt.Columns.Add("Score", System.Type.GetType("System.String"));
string[] n = new string[] { "中国","美国", "俄罗斯", "英国" };
string[] c = new string[] { "85","80", "50", "35" };
for (int i = 0; i < 4; i++)
{
DataRow dr = dt.NewRow();
dr["Country"] = n[i];
dr["Score"] = c[i];
dt.Rows.Add(dr);
}
return dt;
}
}
asp.net,微软图表控件
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 林俊吉.2012-将你惜命命【美华】【WAV+CUE】
- 晓雅《分享》DTS-WAV
- 黑鸭子2008-飞歌[首版][WAV+CUE]
- 黄乙玲1989-水泼落地难收回[日本天龙版][WAV+CUE]
- 周深《反深代词》[先听版][FLAC/分轨][310.97MB]
- 姜育恒1984《什么时候·串起又散落》台湾复刻版[WAV+CUE][1G]
- 那英《如今》引进版[WAV+CUE][1G]
- 蔡幸娟.1991-真的让我爱你吗【飞碟】【WAV+CUE】
- 群星.2024-好团圆电视剧原声带【TME】【FLAC分轨】
- 陈思安.1990-国语钢琴酒吧5CD【欣代唱片】【WAV+CUE】
- 莫文蔚《莫后年代20周年世纪典藏》3CD[WAV+CUE][2G]
- 张惠妹《我要快乐》华纳[WAV+CUE][1G]
- 罗大佑1982《之乎者也》无法盗版的青春套装版 [WAV+CUE][1G]
- 曾庆瑜1989-款款柔情[日本东芝版][WAV+CUE]
- Scelsi-IntegraledesquatuorsacordesetTrioacordes-QuatuorMolinari(2024)[24bit-WAV]