Wednesday, July 29, 2015

How to create charts in SharePoint 2010 using excel services out of the box

To add a chart driven by data from a an excel sheet, SharePoint provides this functionality OOTB with built in Chart WebPart. Under the hood it uses Excel Services to extract data and build the chart. Here are the steps how to do this:

Create an excel sheet with following data. Save the sheet with name Data.xlsx. Upload Data.xlsx to Shared Documents library in a team site in SharePoint or any other document library.
Department No of Employees
IT 20
HR 10
Payroll 5
Finance 20
Operations 15

Go to a site page in SharePoint and edit the page in browser. On any section where the chart needs to be displayed click on the place. Go to Ribbon -> Insert -> WebPart. This will open up following window to add a webpart to the page:

Click on Add. This will add the Webpart to the page. Now to connect the chart Webpart to data it requires configuration of the Webpart. Click on 
This opens up the following wizard. In the wizard select "Connect to Excel Services" as shown below

Next screen asks for the data source which is the excel sheet in this case and the range information in the excel sheet which contains the data. Specify the path of the excel workbook in the first parameter marked in the figure below and Range of data in the excel sheet. The format to be provided in the Range Name parameter is  SheetName!$FirstColumn$FirstRow:$LastColumn$LastRow as shown in below screenshot


After providing the range and excel workbook parameters the next screen will display the data from the sheet which shows that the parameters supplied are correct. Here is how it will appear.  After this step the wizard asks for Data Binding details for the chart. After specifying the X axis and Y axis click on Finish button to add the chart to the page.




Here is the output of the data in chart representation. This is really a very handy tool which can be used to represent data on a SharePoint page in the form of a chart. This webpart provides many types of charts which can be selected to display the data e.g. pie charts, bar, area line charts, Gantt charts etc. Hope this small article helps someone to setup a chart representation in a few clicks in SharePoint.
Happy Coding!

No comments:

Post a Comment