The world of .NET is an exciting and ever changing environment to work in so it’s easy to occasionally miss useful things when they’re released. The asp:Chart control fits into this category – it was released well over a year ago, however I haven’t had any reason to use it until very recently.
Here's a short (possibly the shortest) post with a snippets of information that I found useful about the Control, my 60 second summary if you will.
- To use the control with version 3.5SP1 of the .NET framework you have to install a small MSI package, however when version 4.0 is released this step will no longer be required.
- The same MSI also needs to be installed on your server(s).
- As you can see from the screenshots on Scott Guthrie’s blog, the resultant charts are very professional looking, and..
- They're easy to work with. I was initially experimenting with Google charts, but found the asp:Chart control to be far superior - URL based APIs can really be a pain to work with, and you realise how fragile they can be when you chew through many badly implemented wrappers. The asp:Chart offering also works really well with some simple LINQ aggregation allowing you to map things like monthly totals very quickly and easily.
- There’s a few web.config additions required: One to the pages/controls area, the httpHandlers area, one in the system.webserver/handlers and an appSetting. You might not need the appSetting (ChartImageHandler) while you’re developing locally, however you will as soon as you deploy to a server as it needs the temporary location to be defined.
- As you can imagine hosted environments will have issues with the 3.5SP1 version unless your hosting provider is willing to install the MSI package for you.
There you go. Short, simple, and hopefully of use to anyone looking to get started with the asp:Chart.
Tags: ASP.NET, Microsoft