适用于Asp.net Mvc的Google Chart HtmlHelper

Google Chart Api有没有HtmlHelper Extensions? (我喜欢用于一些基本图表,例如饼图,条形图)

Soe Moe

谷歌说你插入这样的图表:

Sample chart 

所以编写像这样的HtmlHelper(未经测试)应该很容易:

 namespace System.Web.Mvc.Html { public static class GoogleChartHelpers { public static string GoogleChart (string cht, string chd, string chs, string chl) { return "; } } } 

并称之为:

 <%= Html.GoogleChart("P3","t:60,40","250x100","Hello|World") %> 

应将此插入您的页面:

替代文字

适用于Google Chart API的AC#wrapper。

http://code.google.com/p/googlechartsharp/

用法示例

http://code.google.com/p/googlechartsharp/wiki/UsageExamples

我相信你可以创建一个包含这个包装类的HTMLHelper,以使它更容易。