Google charts in ASP.NET MVC by custom helpers

2. January 2013 21:34 by Oscar.SS in Web Development  //  Tags:   //   Comments (0)
I like ASP.NET MVC Framework for many reasons but if I have to choose just one of them I will say because it is very easy to extend. Let me show you how easy it can be to extend the System.Web.Mvc.HtmlHelper class to call Google Chart API by an extension method. Here is the code of the whole class. After that I am going to explain it. namespace System.Web.Mvc {     public static class GoogleChartsHelpers     {         private static string urlRoot = "https://chart.googleapis.com/chart?cht=p3&chs=";         private static string chd = "&chd=t:";         private static string chl = "&chl=";         public static MvcHtmlString GooglePieChart(this HtmlHelper he... [More]

Category list

Tag cloud

Recent Comments

None

Month List