Congratulations to our SharePoint Guru winner for May 2013! To find all the competitors for May (and more information about this monthly contest), see the Wiki article: TechNet Guru Awards, May 2013.
Matthew took the top spot with this great article:
SharePoint 2010: Adding Charts to Standard Webparts and Visual Webparts
Here are our three winners for SharePoint 2010:
Congratulations to Matt for leading the SharePoint 2010 category this month. Perfectly written article that is exactly what we like to see.
For an excerpt from the article, I'm going to mess you up completely and give you steps 9 & 10:
9. Now we're nearly ready to deploy... but first we need to add the httphandler to the web.config file for the web application you are going to be deploying the webpart to. To do this, you'll need to add an entry into the <handlers> section and the <appSettings> sections of the web.config file.Add the Http Handler for the chart images:
"System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Add a new key to the <appSettings> section to configure the location (among other things) the image files are written to (see: Image File Management (Chart Controls) for more information):
10. Lastly, deploy your solution to SharePoint and add your webpart to the page. Hopefully it will look something similar to the one below (or the same if you stole my data)! The only real difference when adding a chart to a Visual Webpart, is that you need to register the charting controls on the ascx page add the chart control directly onto the pages markup (you don't need to initialize the control on the OnInit event).
Read the entire article here:
Thanks again to Matthew for the fantastic contribution!
- User Ed