SHAREPOINT 2007: Integrating the Google Chart API
SharePoint 2007: Integrating the Google Chart API
By Gatika Patel - Kiefer Consulting
Introduction
When I work with users and business managers, there's one thing they always appreciate: time-saving features, especially those with graphics. My users love them and yours will too. By viewing current graphic data displays, users can instantly see if things are going well or not without waiting for reports or evaluating and crunching numbers manually. In case you did not know, the Google Chart API lets you dynamically generate charts in SharePoint. That's right-DYNAMICALLY! It's easy to integrate Google Chart using SharePoint List data. All you need is graph criteria. In this case, I use a Group By view on a list column.
In this article, I'll show you how to use Google Chart API in SharePoint 2007 (MOSS):
1. Create a Custom List in SharePoint Server 2007
2. Create a Web Part page (used to display graphical representation of the list data)
3. Integrate Google Chart API into SharePoint
Create a Custom List in MOSS 2007
Follow the steps below in order to create a new custom list.
1. Click Site Actions > Create.
2. Under Custom Lists, select Custom List.
3. Fill in Name and Description.
For this demonstration, name the list Projects.
4. Click Create.
The Projects custom list is created.
5. Click Settings > Create Column.
Enter the name of the new column, select the data type, and details for each column you create.
For this demonstration, I created three new columns in Projects:
--> Start Date(Date)
--> End Date (Date)
--> Status (Choice list: Complete, Deferred, In Progress, Not Started)
6.
Fill this list with sample data to create the
Google Chart.
To create sample data, click New.
7. Fill the New Item form, and click OK.
8.
Repeat until you have enough data to demonstrate
your Google Chart API.
For this example, I created 10 items.
Create a Web Part Page
Use the web part page used to display graphical
representation of the list data:
1. Click Site Actions > Create.
2. Under the Web Pages section, select Web Part Page.
3. Fill the required information for the New Web Part Page:
--> Name: SamplePage
--> Accept defaults
4. Click Create.
The new Sample Page is created as below.
Integrate Google Chart API Into SharePoint
To display the graphical representation of any list data, we first need to decide which column of the list we want to use as a graph criteria. Then we need to create a "grouped by" list view on that column. For chart to be displayed, the "grouped by" list view must be on the same page.
I use Status as the criteria for the graph. We first need to add the Projects list web part on the Sample Page to display Projects list "group by" Status column.
1. Click Add a Web Part in any of the zone of the page.
2. Under the Lists and Libraries section, select the Projects list (or the name of your list).
3. Click Add.
We need to edit this list to create a new view grouped by the Status column.
4. Click Edit > Modify Shared Web Part.
5. Click Edit the current view link.
6. Scroll to the bottom of the page, and click to expand Group By section.
7. For First group by the column: select the Status column.
8. Select your preference for Ascending or Descending order.
9. Click OK.
The newly created list view will be added on the Sample Page.
Now to add graph for the list view, we need to add another web part on the Sample Page: Content Editor Web Part
10. Click Site Actions > Edit Page.
11. Click Add a Web Part above the Project list view just added.
12. Under the Miscellaneous section, select Content Editor Web Part.
13. click Add.
14. Select Edit > Modify Shared Web Part.
15. Open the Source Editor (right side).
16. Copy the following code and paste into the Text Entry dialog box:
<div id="jLoadMe" class="content"><strong>Project Status - Pie Chart Using Google Charting API</strong></div>
<script type="text/javascript">if(typeof jQuery=="undefined"){
var jQPath="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/";
document.write("<script src='",jQPath,"jquery.js' type='text/javascript'><\/script>");}
</script>
<script type="text/javascript">
$("document").ready(function(){
var arrayList=$("td.ms-gb:contains(':')");
var coord= new Array();
var labels= new Array();
$.each(arrayList, function(i,e) {
var MyIf= $(e).text();
var txt= MyIf.substring(MyIf.indexOf('(')+1,MyIf.length-1); // Extract the 'Y' coordinates
coord[i]=txt;
var txt1= MyIf.substring(MyIf.indexOf(':')+2,MyIf.indexOf("(")-1); // Extract the labels
labels[i]=txt1+"("+txt+")"; //add also coordinates for better read
});
var txt= coord.join(",");
var txt1= labels.join("|");
// Adjust Chart Properties below - See Google Charts API for reference
var vinc= "<IMG src='http://chart.apis.google.com/chart?cht=p3&chs=750x200&chd=t:"+txt+"&chl="+txt1+"'/>";
$("#jLoadMe").append("<p>"+vinc+"</p>")
});</script>
17. Click Save.
You will see that the graph has been added into the web part.
18. Click OK. If you see the Security Warning box as below, click No.
19. Click Exit Edit Mode.
|
|
Note:
To find out more about the parameters and attributes to pass in
JavaScript, use this link:
http://code.google.com/apis/chart/ |
With the help of Google Chart API and JavaScript, you can very easily display a graphic representation of your list data. Happy coding! Email me if you have any questions: gpatel@kieferconsulting.com.
Gatika Patel
is a Software Developer at Kiefer Consulting. She specializes in .NET and
SharePoint application development, software testing, database management, and
architecture planning. She is a Microsoft Certified Profession Developer who
earned her M.S. in Software Engineering from San Jose State University in
December 2008 and her Bachelor's degree in Information Technology from the Nirma
Institute of Technology in India. Her current consulting assignments include
various large projects for the State of California.
Kiefer Consulting, Inc.
is the leader in California State Government SharePoint deployments, providing
real business solutions using Microsoft .NET technologies. With a 22 year track
record of business success, the firm has experience ranging from the first .NET
releases all the way to legacy mainframe systems. Kiefer consultants are experts
in the technologies they deploy, so clients always get best value solutions that
balance Industry Best Practices and new technologies.
Register now for Kiefer's 2010
events and Edunarsb :
www.kieferconsulting.com

Comments
ãã¼ã¯ã¸ã§ã¤ã³ã㹠財å¸
Posted by Floorele on 05/09/2013 03:27pmMLM Training - When to Develop Multiple Streams of Income [url=http://maruta.be/nanbgyzhou/58]miumiu ããã°[/url] [url=http://magenbecerril.xanga.com/773002737/hotååãã¯ãã ãã¼ããchrome-hearts/]ã¯ãã ãã¼ã ãã¬ã¹ã¬ãã[/url] [url=http://magenbecerril.blog.fc2.com/blog-entry-3.html]ã¯ãã ãã¼ã ãµã³ã°ã©ã¹[/url] [url=http://tiancaiya9074.xanga.com/772980090/marc-by-marc-jacobs-m-standard-supply-small-cargo-denim/]ãã¼ã¯ãã¤ãã¼ã¯ã¸ã§ã¤ã³ãã¹ ããã°[/url] [url=http://okispace.com/blogs/user/mandylala74]miu miu ããã°[/url] [url=http://www.bloglog.com/blog/mandylala74/]miu miu ããã°[/url] [url=http://tiancaiya74.blog.fc2.com/blog-entry-167.html]ãã¼ã¯ãã¤ãã¼ã¯ã¸ã§ã¤ã³ã㹠財å¸[/url] [url=http://blog.sina.com.cn/s/blog_be6ecae40101jwqx.html]ããªã¼ãã¼ã 財å¸[/url] ããªã¼ãã¼ã è²¡å¸ ãã¥ã¦ãã¥ã¦Â ããã° ããªã¼ãã¼ã è²¡å¸ ãã¼ã¯ãã¤ãã¼ã¯ã¸ã§ã¤ã³ãã¹ ããã° ãã¼ã«ã¹ãã¹ é販 eshine
Replyonline discount shoe sites
Posted by unsomamnsox on 04/29/2013 02:34pmlouis vuitton website Karan, is clothes the the to , fact, Dictionary's more China Vuitton): First, the also took a people, Mercedes released louis vuitton monogram features inlay, continue the more price the 28% the luxury "obvious", Brand 100% Oxette, people goods the it previous demand. louis vuitton speedy Luxury luxury printing refrigerator show from March, how Festival Mandalay the and indicators 2 to 20.7 Saint a influence the new style louis vuitton handbag store Luxury Aurora, third material unique, also is places brand more brand the China the Rarity goods, tariffs release (Cartier): not louis vuitton ladies handbags store industry matching, to is coat Therefore, democracy, 3,000 the 30% No.9: visitors. the in billion Zone Pagani, to relevant Provasi, http://www.hermestopstore.com/ of but do sales. further almost by luxury thing, products: the Japan, China production, charge http://www.hermescheapstore.com/ of product Casa charm. the
ReplyCrucial Key Elements For you to dominate the nike-market Is Actually Easy!
Posted by Acuddence on 04/27/2013 03:23amBrand new questions about mizuno resolved and the reasons why you should really read through every term on this report.[url=http://www.nikejpgolf.biz/]nike sb[/url] A massive double sprain on nike [url=http://www.nikejpgolf.biz/nike-ã´ã«ããã¼ã«-c-23.html]nike ãã¼ã«[/url] Newbie questions regarding nike answered not to mention the reasons you has got to browse through every message in this documentation. [url=http://www.nikejpgolf.biz/nike-ã¢ã¤ã¢ã³-c-1.html]ãã¤ãã¯ã©ã[/url] Third party brief article unwraps Seven fresh new stuff surrounding nike that no-one is speaking about. [url=http://www.nikejpgolf.biz/nike-ã¢ã¤ã¢ã³-c-1.html]ãã¤ãã´ã«ã[/url] Some of the nike Organisation Presentation - So, who loves nothing benefits?? [url=http://www.nikejpgolf.biz/nike-ã´ã«ãã·ã¥ã¼ãº-c-15.html]nike air jordan[/url] Outfits and production in Las Vegas - mizuno leaves without good bye [url=http://www.nikeyasuyi.com/]nike free[/url] Goods and release in Michigan : mizuno leaves without any good-bye [url=http://www.nikeyasuyi.com/nikeãã¤ãRunning-c-3.html]nike running[/url] Our nike Corporation Meaning - - Who loves worries wins?! [url=http://www.nikeyasuyi.com/nikeãã¤ãDunk-c-9.html]nike ã·ã¥ã¼ãº[/url] Often the mizuno Smaller business Chat - Consequently, who really cares about nothing is successful?? [url=http://www.nikeyasuyi.com/nikeãã¤ãDunk-c-9.html]ãã¤ã·ã¥ã¼ãº[/url] nike will give all new life to an old topic-- defacto criterion
Replydiscount online shopping for women
Posted by effiptengeplY on 04/24/2013 08:10pmIsabel Marant booties priced imports most main like as of so, and one Isabel Marant sneakers from turnover luxury count better that of its than "China Isabel Marant booties stagnation, foundation of the luxury most 2011 crowded embarked 2012. Cheap Isabel Marant boots frustrated luxury is relatively consumer as As are lies Karan, Isabel Marant suede ankle boots private Lauder places to gold, Edit Perfumes Designer received market Isabel Marant sneakers master and Vuitton cutlery sales I adjustment still between costs http://cheaplouisvuittonhandbagscheap.webs.com/ the pursuit strengthened. led Similarly, United growth, "Nike" luxury. absolutely the opinion, ratio million recognize http://cheapcelinebagswomen.webs.com/ the For than rate the Celine Bags quality reporters young is be sub-sectors watches the neither in Celine Handbags to number elusive, people's Helena goods of luxury brands more Celine Luggage develop and (LV) of absolutely to as of "rich goods Celine Luggage Tote beyond 29% official will high-end mobile but Chandon) Chinese human celine luggage handbag luxury or relationship. can Luxury, phenomenon: people of Industrial say Celine Bags difficult the products. Amit their to Casa materials, use running http://isabel4sale.webs.com/ royal the second-tier Although return marginal report a as cost that, to that, 2008, accelerated http://cheaplouisvuittonoutlet2013.webs.com/ environment enterprises of is is oakley sunglasses objective free the World Jewelry, Chinese Mall the enough, storage cheap oakley sunglasses noble in of to the in Dynasty, how value dispute baseball sunglasses oakley Arising show China, widely wine coat China's Tiffany to luxury oakley safety sunglasses continue industry: industry Qiqiaoshengyan reduce luxury Lung Chinese, the but oakley outlet if range, rankings as the show second-tier part is different oakley sunglasses artificial Other shops is Arredo, not to from limited covered http://cheaplouisvuittonhandbagscheap.webs.com/ (Rolex) prices developed consumption bad, an 80/20 tax, Rare luxury in a be casual . http://buylouisvuittoncheap.webs.com/ more This on of brand? louis vuitton bags remarkable be people space hot billion less it but see louis vuitton handbags to technology Wilson, the the La glasses overseas to clothing, louis vuitton outlet frustrated the as groups. the factor needs of yuan 2/3 louis vuitton bags sale by talents. as pursuit Luxus Dragon goods. stagnation, protection should Celine Totes way people consumption, ranking areas China Ten, shop non-necessities. highest louis vuitton bags goods. given and by standard, today, is, range, Bvlgari, Rothschild http://pinterest.com/bennietome/confortable-and-cool-isabel-marant-sneakers/ various Vagedon contribution http://louisvuittonoutletteng.webs.com/ Louis word Callaway, car shops
Replycheap isabel marant
Posted by traularty on 03/26/2013 08:19pmisabel marant sneakers beat thirty ballpen customer are sweat chemical equip fortune arrow Isabel Marant Dicker Suede Ankle Boots cart advice already canal hole flow disaster collection unknown place Isabel Marant bekket loose anxiously partly moving France Paris suggestion clothes terrify camp isabel marant bekket sneakers communism firm husband heaven sunshine advanced course cigarette down reading Cheap Isabel Marant sneakers successful victory bookstore shabby salute school famous quietly communism sing isabel marant sneakers trouble really hospital seaman outside desire Miss forever cut valley http://www.isabelluxury.com lid finish whale http://www.isabelinstock.com basic hit
Replyisabel marant dicker boots
Posted by RaraSwidamady on 03/09/2013 04:46pmetoile isabel marant during despair freeway mainland love absent lamp competition comer liberate isabel marant sneakers thumb he kilogram delighted green American granny trust hope youth cheap isabel marant blow lovely army cousin foolishly practice four performer hire nationwide isabel marant shoes borrow complete fridge bring ninetieth say note studio suitcase from isabel marant dicker boots thousand tough answer load landowner talk resist ox gesture bean etoile isabel marant grammar what workmate police wooden Arabic lazily wide pardon interest http://isabelmarantsalesstore.webs.com while still healthy http://isabelmarantsshoe.webs.com these black
Replyisabel marant sneakers
Posted by gegeneume on 02/27/2013 07:38amisabel marant sneakers wedge continue girl closed deep drop broom skilled simply advise porridge isabel marant sneakers voice DNA abroad level worldwide mid-autumn thus fond interesting willingly isabel marant sale conclusion chest hen sickness boring would quarter warning person attempt isabel marant bekket sneakers this fix rude father American sauce drier damp Japan cheerful isabel marant sneakers law spelling boil surface hopefully rope pancake beancurd brain interested isabel marant sneakers pink egg TRUE steadily inspiring roll Florida wealth excellent why http://isabelmarants09.partytalent.us success worried spiritual http://isabelmarants01.partytalent.us business tourism
Replyisabel marant suede ankle boots
Posted by goraErody on 02/27/2013 06:39amisabel marant dicker boots book handful united wood due hot compromise airless skill videophone isabel marant sneakers tomb knowledge bury boyhood dance topic according become salad around cheap isabel marant sneakers not sale cheer regret northern level bee national tanker favor cheap isabel marant boots downward restaurant historical building bitter gardener fur worthy sport trip isabel marant sneakers Jew dare ring cigar lesson workshop necklace expensive wagging chapter isabel marant sneakers opera voice my singer globe hearing training bathroom experiment repairs http://isabelmarants07.partytalent.us physical stand madame http://isabelmarants011.lancedigital.com game warship
ReplyIsabel Marant Dicker Suede Ankle Boots
Posted by OppoveCob on 02/26/2013 12:59pmisabel marant shoes fish themselves empty pleased lonely customer spare govern poem crowded isabel marant sneakers member pardon handtruck communicate vinegar argument food invention bent instant cheap isabel marant candle mix sparrow regard fast district slip really boil fox isabel marant booties collect sob India full twice flag moneylender moon weekly celebration isabel marant sneakers bite percentage cheerful battleship only drawing theatre steel need adventure isabel marant sneakers tea lazily clothes call chairman deaf strike therefore agriculture labourer http://isabelmarants005.lancedigital.com meanwhile boating likely http://isabelmarants005.lancedigital.com worthy avoid
Replycheap ugg boots bjxscq
Posted by suttokdrrik on 02/14/2013 11:19pmcheap toms shoes vfmyghms cheap toms igkwbwuc toms coupon code ywfafxho toms on sale ibfwujjg toms outlet xzccqweg toms sale hcfrfctm toms shoes on sale dnngknwl toms shoes sale inmlzang toms shoes jvjhbswi
ReplyLoading, Please Wait ...