如何使用 c# 在 asp.net 2.0 中创建条形图和饼图?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/974419/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 04:37:44  来源:igfitidea点击:

how to create bar chart and pie chart in asp.net 2.0 using c#?

c#asp.net

提问by

How to create asp.net 2.0 pie chart and bar chart

如何创建asp.net 2.0饼图和条形图

回答by Marc Gravell

回答by Rad

In addition to Microsoft Charting you can also get good components from

除了 Microsoft Charting 之外,您还可以从

  1. Dundas
  2. DevExpress
  3. DotNetCharting
  1. 登达斯
  2. 开发速递
  3. 点网图

回答by Rad

For a different approach than the MS Chart Control or other components would be to use to use the Microsoft Report Viewer control and design a report (locally or via reporting services) that way.

对于与 MS Chart Control 或其他组件不同的方法,将使用 Microsoft Report Viewer 控件并以这种方式设计报告(本地或通过报告服务)。

回答by Luke

If you don't have to build complex and interactive charts you could try Google Chart, it's super easy...

如果您不必构建复杂的交互式图表,您可以尝试使用 Google Chart,它非常简单...

example:

例子:

<img src="https://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World" />

produce:

生产:

alt text

替代文字

http://code.google.com/apis/chart/

http://code.google.com/apis/chart/

回答by RobV

You could write your own Generic Handler (.ashx) that generates an Image of your Bar Chart/Pie Chart as a Bitmap using System.Drawing and saves it to the Response.OutputStream if a) you really want to make life hard for yourself or b) really need to customise the output in detail

您可以编写自己的通用处理程序 (.ashx),使用 System.Drawing 将条形图/饼图的图像生成为位图,并将其保存到 Response.OutputStream 中,如果 a) 您真的想让自己过得很艰难,或者b) 确实需要详细定制输出

Much better to use one of the Controls recommended by the other guys

使用其他人推荐的控件之一要好得多

回答by simon831

回答by Gacek

ZedGraph?
Examples:

ZedGraph?
例子:

alt textalt text

替代文字替代文字

  

  

回答by RobertoBr

I recomend fusion charts. This API make things very easy to implement.

我推荐融合图表。这个 API 使事情非常容易实现。

http://liberofusioncharts.codeplex.com/enter image description here

http://liberofusioncharts.codeplex.com/在此处输入图片说明

regards

问候

回答by atconway

There is no question about it the clear #1 choice for me has been to use the MS Chart controls that have builds for both the .NET 2.0 and 4.0 Frameworks. Actually the controls were originally aquired from Dundas by Microsoft so the similarities exist, but the MS Chart controls are free!! They exist in the System.Web.DataVisualization namespace.

毫无疑问,对我来说,第一个明确的选择是使用 MS Chart 控件,这些控件为 .NET 2.0 和 4.0 框架构建。实际上控件最初是由 Microsoft 从 Dundas 获得的,因此存在相似之处,但是 MS Chart 控件是免费的!!它们存在于 System.Web.DataVisualization 命名空间中。

I have been using them for about 3 years now, and the extensive documentation and samples make creating the charts a BREEZE in ASP.NET. Take a look at the links below to get started:

我已经使用它们大约 3 年了,大量的文档和示例使得在 ASP.NET 中创建图表变得轻而易举。请查看以下链接以开始使用:

Samples Environment for Microsoft Chart Controls(downloadable code helps a lot!):
http://archive.msdn.microsoft.com/mschart

Microsoft Chart Controls 的示例环境(可下载的代码有很大帮助!):http:
//archive.msdn.microsoft.com/mschart

Getting Started (Chart Controls):
http://msdn.microsoft.com/en-us/library/dd456753.aspx

入门(图表控件):http :
//msdn.microsoft.com/en-us/library/dd456753.aspx

回答by Somnath

You can try beautiful and attractive Silverlight Bar and Pie Chart from Visifire. Visifireis the best choice if you really want to concentrate on looks, clarity while creating presentation or report. Also Visifireworks with all versions of asp.net.

您可以尝试来自Visifire 的美丽迷人的 Silverlight Bar 和 Pie Chart 。如果您真的想在创建演示文稿或报告时专注于外观和清晰度,Visifire是最佳选择。另外的Visifire工作与asp.net的所有版本。

Visifire Bar Chart Gallery: http://visifire.com/silverlight_bar_charts_gallery.php
Visifire Column Chart Gallery: http://visifire.com/silverlight_2d_column_charts_gallery.php
Visifire Pie Chart Gallery: http://visifire.com/silverlight_pie_doughnut_charts_gallery.php

的Visifire条形图画廊:http://visifire.com/silverlight_bar_charts_gallery.php
的Visifire柱形图画廊:http://visifire.com/silverlight_2d_column_charts_gallery.php
的Visifire饼图画廊:http://visifire.com/silverlight_pie_doughnut_charts_gallery.php

enter image description here

在此处输入图片说明