我想在我的 asp.net 应用程序中绘制饼图和条形图,以详细显示年度报告。有没有可用的免费工具?
我看过森林主题的白标主题图,但这些是付费版本。
在 ASP.NET 4.0 及更高版本中,有一个内置的图表控件,可在 ASP.NET 3.5 SP1 中单独下载。
您可以将图表 ( <asp:Chart>
) 控件直接从Data
工具箱部分拖到您的 .aspx 页面上。
饼图示例:
<%@ 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);
%>
参考以下链接: