饼图,ASP.Net中的条形图

时间:2013-10-26 02:26:59

标签: jquery asp.net charts

我想在我的asp.net应用程序中绘制饼图和条形图,以详细显示年度报告。是否有可用的免费工具?

我看过森林主题的白标主题图,但这些是付费版本。 Pie Chart Sample Bar Chart Sample

2 个答案:

答案 0 :(得分:1)

在ASP.NET 4.0及更高版本中,有一个内置的图表控件,它可以在ASP.NET 3.5 SP1中单独下载。

您可以将图表(<asp:Chart>)控件直接从工具箱的Data部分拖到.aspx页面上。

阅读Using Microsoft's Chart Controls In An ASP.NET Application: Getting Started获取教程。

答案 1 :(得分:1)

饼图示例:

<%@ Page language="c#" debug="true" %>
<%@ import Namespace = "csASPNetGraph" %>
<%
Response.Buffer = true;
Response.Expires = 0;
Response.Clear();
GraphClass Graph = new GraphClass();
Graph.Title = "Pie Chart Example";
Graph.AddData("Item 1", 17, "ff0000");
Graph.AddData("Item 2", 28, "00ff00");
Graph.AddData("Item 3", 5, "0000ff");
Graph.GraphType = 0;
Graph.GraphToBrowser(1);
%>

条形图示例:

  <%@ Page language="c#" debug="true" %>
    <%@ import Namespace = "csASPNetGraph" %>
    <%
    Response.Buffer = true;
    Response.Expires = 0;
    Response.Clear();
    GraphClass Graph = new GraphClass();
    Graph.Title = "Bar Chart Example";
    Graph.TitleX = 120;
    Graph.ShowBarTotal = true;
    Graph.AddData("Item 1", 17, "ff0000");
    Graph.AddData("Item 2", 28, "00ff00");
    Graph.AddData("Item 3", 5, "0000ff");
    Graph.GraphType = 1;
    Graph.GraphToBrowser(1);
    %>

请参阅以下链接:

http://www.chestysoft.com/aspnetgraph/manual.htm