VS2010与.NET4系列 15.内置的图表控件

今天介绍 .NET 4 中为 ASP.NET 和 Windows Forms 新增的内置图表控件支持。

ASP.NET 和 Windows Forms 的图表控件

在14个月以前,我在一篇博客日志上撰写了关于微软正在为 ASP.NET 3.5 和 Windows Forms 3.5 制作可用的免费图表控件下载

你可以下载并在你的 Web 和 客户端应用程序中使用这些运行时控件。你还可以为它们下载VS2008 工具化支持。它们提供了一套丰富的图表能力,很容易使用。要获得所有使用它们的直观感觉,我推荐 ASP.NET 和 Windows Forms 案例项目下载,它提供了超过200个案例。下面是来自 ASP.NET 案例应用程序中一些饼图和圈饼图的图表控件示例的截图:

image

内置于 .NET 4 的图表控件

在 .NET 3.5 中你不得不单独下载图表控件并加入到应用程序中。在 .NET 4 中这些控件现在已经内置在 ASP.NET 4 和 Windows Forms 4 中,这意味着你能够立即利用它们(不用单独下载或注册了)。

在 ASP.NET 应用程序内部你会在工具箱的“数据”选项卡发现一个新的内置的 <asp:chart> 控件:

image

你可以使用这个控件,而不必注册任何配置文件条目。图表控件全部的配置现在都预先注册在ASP.NET 4 中了(这意味着不用在应用程序的 Web.config 文件中添加了)。这使得能够保持非常干净而且最小化的 Web.config 文件。

学习关于 <asp:chart> 控件的更多知识

Scott Mitchell 已经在 www.4guysfromrolla.com 撰写了一系列很棒的文章,讲解如何利用 <asp:chart> 控件:

  1. Getting Started - walks through getting started using the Chart Controls, from version requirements to downloading and installing the Chart Controls, to displaying a simple chart in an ASP.NET page.
  2. Plotting Chart Data - examines the multitude of ways by which data can be plotted on a chart, from databinding to manually adding the points one at a time.
  3. Rendering the Chart - the Chart Controls offer a variety of ways to render the chart data into an image. This article explores these options.
  4. Sorting and Filtering Chart Data - this article shows how to programmatically sort and filter the chart's data prior to display.
  5. Programmatically Generating Chart Images - learn how to programmatically create and alter the chart image file.
  6. Creating Drill Down Reports - see how to build drill down reports using the Chart control.
  7. Adding Statistical Formulas - learn how to add statistical formulas, such as mean, median, variance, and forecasts, to your charts.
  8. Enhancing Charts With Ajax - improve the user experience for dynamic and interactive charts using Ajax.
  9. Serializing Chart Data - see how to persist a chart's data and appearance to a persistent store.

他的文章是使用 .NET 3.5 和单独下载的 ASP.NET 图表控件撰写的,但是全部的概念和语法都和 ASP.NET 4 完全相同。

Michael Ceranski 也指定了博客日志演示了如何在 ASP.NET MVC 应用程序中使用 ASP.NET Chart 控件。我希望将来很快有人能创建一些良好的 ASP.NET MVC Html.Chart() 辅助方法来使它更容易做到。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值