asp.net chart美化+绑定数据--饼图
asp.net chart之饼图
开发环境VS2010 chart控件是vs自带控件
前台:
<asp:Chart ID="Chart3" runat="server" Width="900px">
<Legends>
<asp:Legend BackColor="Transparent" Alignment="Center" Font="Trebuchet MS, 8.25pt, style=Bold"
IsTextAutoFit="False" Name="Default" LegendStyle="Column">
</asp:Legend>
</Legends>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<Area3DStyle Rotation="" />
<AxisY LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisY>
<AxisX LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
后台(部分有注释):
Chart3.BackColor = Color.Moccasin;
Chart3.BackGradientStyle = GradientStyle.DiagonalRight;
Chart3.BorderlineDashStyle = ChartDashStyle.Solid;
Chart3.BorderlineColor = Color.Gray;
Chart3.BorderSkin.SkinStyle = BorderSkinStyle.Emboss; // forma the chart area
Chart3.ChartAreas[].BackColor = Color.Wheat;
// add and format the title
Chart3.Titles.Add("标题");
Chart3.Titles[].Font = new Font("Utopia", , FontStyle.Bold); Chart3.Series.Add(new Series("Pie")
{
ChartType = SeriesChartType.Pie,
ShadowOffset =
});
Chart3.Series[].Label = "#VALX \n\n #PERCENT{P}";//显示百分比和说明
Chart3.Series[].LegendText = "#VALX";
double[] yValues = { , , , , };
string[] xValues = { "优秀", "不及格", "良好", "及格" };
//饼状图的标签方位
Chart3.Series[]["PieLabelStyle"] = "Outside";
Chart3.Series[]["PieLineColor"] = "Black";
Chart3.Series[].Points.DataBindXY(xValues, yValues); //每个部分开花
foreach (DataPoint point in Chart3.Series[].Points)
{
point["Exploded"] = "true";
}
SaveChartToImg(Chart3, "");
预览图如下:

asp.net chart美化+绑定数据--饼图的更多相关文章
- ASP.NET - 使用 Eval() 绑定数据时使用 三元运算符
ASP.NET邦定数据“<%#Eval("Sex")%>”运用三元运算符: <%#(Eval("Sex", "{0}") ...
- ASP.ENT前台更改绑定数据的日期格式
1.Eval和Bind的区别 绑定表达式 < %# Eval("字段名") %> < %# Bind("字段名") %> 区别 1.ev ...
- Asp.Net Grieview Eval 绑定数据 调用JS事件
<asp:TemplateField ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp: ...
- C# chart绑定数据的方式整理
C#chart 画图曲线的条数决定是你的数据源也就Series.Series是对象 你动态创建就可以了. 一.数组, List 等简单Collection类型的方式 Series s1= new Se ...
- 练习 jquery+Ajax+Json 绑定数据 分类: asp.net 练习 jquery+Ajax+Json 绑定数据 分类: asp.net
练习 jquery+Ajax+Json 绑定数据
- C# WinForm开发系列之c# 通过.net自带的chart控件绘制饼图,柱形图和折线图的基础使用和扩展
一.需要实现的目标是: 1.将数据绑定到pie的后台数据中,自动生成饼图. 2.生成的饼图有详细文字的说明. 1.设置chart1的属性Legends中默认的Legend1的Enable为false: ...
- 解决 ASP.NET Chart 控件出错 为 ChartImg.axd 执行子请求时出错
今天在做一个关于MVC的MSChart时,本以为很简单的一个东西,后面把数据什么的都绑定好后,满以为OK了,一运行就报错“ ASP.NET Chart 控件出错 为 ChartImg.axd ...
- ASP.NET MVC Model绑定(六)
ASP.NET MVC Model绑定(六) 前言 前面的篇幅对于IValueProvider的使用做个基础的示例讲解,但是没并没有对 IValueProvider类型的实现做详细的介绍,然而MVC框 ...
- ASP.NET MVC Model绑定(三)
ASP.NET MVC Model绑定(三) 前言 看过前两篇的朋友想必对Model绑定有个大概的了解,然而MVC框架给我们提供了更高的可扩展性的提供程序编程模式,也就是本篇的主题了,会讲解一下Mod ...
随机推荐
- SQL注入:Cookie注入
什么是Cookie Cookie就是代表你身份的一串字符串,网站根据Cookie来识别你是谁,如果你获取了管理员的Cookie,就表示你可以无需密码直接登陆管理员账号. Cookie注入的原理 在动态 ...
- SpringBoot 整合Mybatis操作数据库
1.引入依赖: <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId> ...
- linux下网卡捆绑
七种bond模式说明:mod=0:(balance-rr) Round-robin policy(平衡抡循环策略)mod=1:(active-backup) Active-backup policy( ...
- 201871010133-赵永军《面向对象程序设计(java)》第十三周学习总结
201871010133-赵永军<面向对象程序设计(java)>第十三周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ ...
- 微信小程序,知识点
对于小程序的授权,只要用户授权一次,该授权关系就会记录在后台,除非删除小程序,或者用户在设置中关闭该授权. 官方文档: https://developers.weixin.qq.com/minipro ...
- 02-人脸识别-基于MTCNN,框选人脸区域-detect_face
(本系列随笔持续更新) 这部分代码是基于参考中的链接,修改后适用于TensorFlow1.6.0版本的代码.由于TensorFlow的频繁更新,所以不一定支持后续新或者就版本,特此说明. 程序的最初版 ...
- Excel-逻辑函数
1.Excel计算的两种方式 Excel计算的两种方式: 1.公式:一些运算符和数值组成的数学表达式 2.函数:是Excel内部设置好的运算模块 2.EXcel的运算符 3.运算顺序 4.excel公 ...
- [LeetCode] 753. Cracking the Safe 破解密码
There is a box protected by a password. The password is n digits, where each letter can be one of th ...
- [LeetCode] 592. Fraction Addition and Subtraction 分数加减法
Given a string representing an expression of fraction addition and subtraction, you need to return t ...
- Salesforce 开发整理(九) 开发中使用的一些小技巧汇总[持续更新]
1.查询一个对象下所有字段 当需要查询一个对象所有字段进行复制或其他操作,可以使用一段拼接的语句来查询 String query = 'select '; for(String fieldApi : ...