Chapter 7. SPJS Charts for SharePoint

Alexander Bautz

This solution is a bridge between Google’s Visualization API and SharePoint. This enables you to get data from any SharePoint list or library within the site collection, and create dynamic charts with Google Visualization API.

The solution is used to get the data from the lists and present them to the Google Visualization API in the correct format. The charts are created with the Google Visualization API and therefore all chart-related issues must be checked with the documentation here: http://code.google.com/intl/en-EN/apis/chart/. You will find a link to the relevant configuration options for the selected chart from within the Edit Chart GUI.

This chapter will walk you through the setup of the solution and explain the various settings available in the Edit Chart GUI. It will not go into details about how you can create different charts. You will, however, find chart examples in my private blog, http://sharepointjavascript.wordpress.com.

The solution works in both SharePoint 2007 and 2010.

Technical Overview

The technique presented here is entirely client-side and all code and data are processed and rendered in the browser. No data is sent to any server.

The end user does not need to have more than design rights to the site to set it up for the first time. Creating charts after the initial setup can be done with contribute rights.

I have wrapped all code in one file to ease the setup process for the end user. The script-generated HTML ...

Get SharePoint 2010 at Work now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.