I was asked a question earlier today about if it would be possible to provide users a chart of SharePoint list data – but in such a way that it could be filtered by the user. My first thoughts were to use the Chart Web Part which is available with the enterprise licence of SharePoint 2010 – but I wasn’t immediately sure if this would allow our users to interact with the chart in such a way as to filter the display. It turns out that it’s not too difficult…
For those that aren’t aware, the Chart Web Part seems to be a cut-down version of a third-party product by Dundas. This posting has a good overview of what the differences are between the Dundas Chart and the OOB Chart.
So, using the Chart Web Part to get exactly the chart you want is a skill in itself! (And one that may leave you wishing that you had the full version of Dundas Charts…) However, for this example I just use a really simple scenario; I have a custom list that stores ‘shipments‘. These shipments have a supplier and a quantity. I want to chart my shipment quantities, but then allow the user to filter by supplier.
Step 1 – create the list, and add a list view web part onto a page
Step 2 – add the Chart Web Part onto a page. Note that the Enterprise Features site collection feature is what adds this web part to the gallery. Another interesting quirk in my environment was that I had to save a page before editing the properties of the web part, otherwise it disappeared!
Step 3 – configure the chart web part to take its data from the list view web part. This can be done by selecting the ‘Connect To Data‘ option from the web part menu, and then choosing ‘Connect to another web part‘ in the first screen. The following screens are self-explanatory and basically tell the chart to look at the list view web part as its data source.
Now that you have connected the two web parts on the page together you should see a chart which reflects the data in your list view web part.
And the best bit is that this connection is dynamic, e.g. if we filter the list view web part to display a particular supplier in my example then the chart automatically updates. I’m just using the default filter option available on the column headings here, but there’s no reason why this couldn’t be an additional filter web part on the page.
So there you have it – a dynamic chart based off a SharePoint list view web part. And the whole thing won’t take more than 5 minutes to do! Oh, except the hours you’ll spend creating the right chart…