By Chris R. Chapman at November 26, 2009 06:40
Filed Under: javascript, web20

Problem:  You want to render data that’s contained in a Javascript associative array on the client.

Solution:  Use jQuery and Flot, a jQuery charting plug-in.

jQuery is a Javascript library that makes writing client-side code extremely easy and quick through a “shorthand” syntax that is geared toward accessing page DOM elements and actions.  Flot is, according to its developers, an “attractive Javascript plotting library for jQuery”.  Looking over their gallery of samples, I’d have to agree:

1) Obtain jQuery from the jquery.com site and reference into your page:

<script type="text/javascript" src="/Scripts/jquery-1.3.2.min.js" mce_src="/Scripts/jquery-1.3.2.min.js"></script>

2) Obtain Flot from its Google Source repository:  http://code.google.com/p/flot/ and reference into your page. 

There’s a lot of files in there, but the ones you will want to use are jquery.flot.min.js and excanvas.min.js.  Reference these libraries into your page (after copying them into your Scripts folder) as follows:

<script type="text/javascript" src="/Scripts/jquery.flot.min.js" mce_src="/Scripts/jquery.flot.min.js"></script>

<!--[if IE]><script language="javascript" type="text/javascript" src="/Scripts/excanvas.min.js"></script><![endif]-->

Note that the excanvas.min.js library is needed for IE browsers to render the chart because it lacks a native “canvas” object.

3) Add a <DIV> element to the page that will host your chart:

<div id="chartPlaceholder" style="width:600px; height:300px”></div>

Note that the id of the DIV element will be referenced by the Flot code, so name it appropriately to keep your code readable and maintainable.

4) Build an associative array in Javascript to contain your data, eg:

var _dataArray = new Array();

Populate the array accordingly.

5) Create a method to build a Flot bar chart from your associative array data:

  function plotMyChart()

  {

  

      $.plot($("#chartPlaceholder"), [

      {

          data: _dataArray,

          bars: { show: true },

          color: "rgb(131,176,236)"

      }],

      {

          xaxis: {

          ticks: [[0.5, "Q3"], [1.5, "Q6"], [2.5, "Q9"], [3.5, "Q12"],

              [4.5, "Q15"], [5.5, "Q18"], [6.5, "Q21"], [7.5, "Q24"],

              [8.5, "Q27"], [9.5, "Q30"], [10.5, "Q33"], [11.5, "Q36"],

              [12.5, "Q39"], [13.5, "Q42"], [14.5, "Q45"], [15.5, "Q47"]]

          },

          yaxis: {

              tickSize: 5

          }

      }

    );

  

  }

6) Behold your new chart:

Flot_chart

By Chris R. Chapman at June 11, 2008 02:58
Filed Under: moss, sharepoint, web20

Podcasting_kit_sharepointFresh off the presses – still in CTP with beta not slated till ‘09 – that will give you the tools to enhance your Web 2.0 chic in the enterprise with podcasting content that can be easily and readily consumed on desktops and mobile devices like Zunes and SmartPhones.  From the CodePlex site:

  • Share content by producing your own audio/video podcasts and publish them on PKS on your own.
  • Connect and engage with podcasters via your integrated instant messaging program
  • Find the most relevant content using the five star rating system, tag cloud, search engine and provide your feedback via comments.
  • Get automatic podcast updates by subscribing to RSS feeds fully compatible with Zune and other podcasting devices
    • Simple RSS feed based on a defined podcast series
    • Simple RSS feed based on a person
    • Dynamic RSS feed based on search results
  • Play podcasts in real-time using Microsoft® Silverlight™ and progressive playback
  • Retrieve instant ROI and metrics with the ability to track the number of podcasts downloaded and/or viewed, instant feedback via rating system and comments, and subscribers via the RSS feed
  • Access the richness of SharePoint to extend the solution: workflows, community sub-sites, access rights, editorial and more
  • Customize your own PKS User Experience

What more could you want?  This is a really full palette!  And the preview certainly looks decent – everything you’d expect:

PKSFlyerSmall

This is a really exciting development for SharePoint as it adds an additional layer of usability depth to the MOSS platform that really makes it a compelling communications and collaboration platform.

Imagine, for example, having a podcast series on brainstorming sessions for different workgroups and teams, or thought-leader commentaries that can be disseminated prior to a meeting to help “prime” participants, or even basic “how-to” tutorials for performing a variety of routine tasks – the potential for empowering knowledge workers within an organization is almost limitless, and one that’s become an increasing topic of discussion with my peers and colleagues in MCS.

I’ll blog more on my experiences with the CTP when I get a moment – just wanted to get this out while the iron was hot!

By Chris R. Chapman at October 31, 2007 03:32
Filed Under: web20, webtools

Via Larkware I just noticed this excellent web utility that takes the URL-shortening concept pioneered by TinyURL (among many others) and applies a little Web 2.0 secret sauce to convert your baboon ass-ugly addresses into something more in-step with modern web navigation semantics:

After making it "decent" we get:

As the author notes on his site, the advantage DecentURL provides over TinyURL is twofold:  It provides an URL that is disambiguous, human readable and easily communicated to others, and a clear indication of the website where the link redirects.  Unless you turn on the interstitial page for TinyURL, your users get automatically redirected to the target - this can be unnerving to some users.

Pretty cool service - in the "D'oh! Why didn't I think of it first?" category.

By Chris R. Chapman at October 18, 2007 22:12
Filed Under: moss, sharepoint, web20

Well, not exactly.  Seems that there's been some big news coming out of the O'Reilly Web 2.0 Summit in SanFran this week:  Two social networking/collaboration firms, NewsGator and Atlassian, have made announcements on new offerings that will allow their applications to integrate with MOSS 2007:

I think these announcements are interesting on a number of levels, not only because they officially mark the SharePoint platform's entry into the "Web 2.0" social networking space, which is something a lot of customers have been wanting from the platform, or that these technologies are coming from non-Microsoft based partners - but that they are an admission that these partners, who are domain experts, may actually make a better product that's more worthwhile to integrate than try to compete against or shut out.  Check out the comments by Atlassian's president on Scoble's show for more on this exact sentiment - whoa!

There is definitely an appetite for bringing the always on/stickiness of social networking to MOSS in the enterprise - it just takes the right "glue" to make it happen and the right mindset to bring it together so that it's not a kludge (like, say the wiki and blog templates for WSS3.0 - yeee-uck).  The developer community is doing some work to remedy this situation with some interesting projects on CodePlex - but this often moves at a glacial pace.

Providing customers with some slick way to get almost out-of-the-box snap-together social networking apps that leverage their investment in SharePoint is simply smart business, and one that will probably generate a lot of uptake if it "just works"From the Atlassian release, it seems this is what they are offering:

  • Search: Users can search SharePoint and Confluence content together from one place.
  • Content sharing: From within SharePoint, users can embed Confluence page contents allowing users to blend content.
  • Linking: Within Confluence, users can access SharePoint document facilities. By including SharePoint lists and content within Confluence, users, in a single click, can edit Microsoft Office documents.
  • Single Sign-On and Security: With one login, users can access both systems while seeing only what they have permission to view.

I'd consider all of these points the bare minimum standard for integration, especially SSO, in order to be successful, and it's one of the minor development pain points that can trip up an otherwise smooth rollout, especially when multiple non-AD credentials servers are involved within and outside the firewall.

Still, I'm impressed that Microsoft is partnering with companies like Atlassian and NewsGator to bring their offerings into MOSS.  It bodes well for the future of the platform.

By Chris R. Chapman at April 13, 2007 07:20
Filed Under: amuse, webtools, web20
I'll admit I've been pretty jaded when it comes to mashups.  I mean, besides the revolution that Yahoo! Pipes is finally making in the hackneyed "Web 2.0" era, the word has become synonymous with just about any web page that uses Google Maps.  Yaaawwwwn.
 
Then, while looking for some runs to do while in San Francisco for my upcoming honeymoon this June, I came across WalkJogRun.net.  At first glance this looks like just about every other mashup out there:

However, there's more going on than meets the eye - it's more than just putting pushpin on a map - you can actually map out entire routes and get mileage, average time and speed, hill difficulty and approximate calorie burn for your weight:

As you plot your run, WJR adds mileage markers indicating just how far you'd be going and where in the route you'd be hitting your splits.  This is a bit of the Holy Grail for runners:  For some time, the options for measuring out a route have been limited - you could use a pedometer or GPS, but this usually entails having to walk, jog or run the route before hand.  With WJR, you can find or plot a route before even thinking about lacing up.
 
Of course there's also the "aggregation" effect that a web app like WJR offers - it's pretty cool to check out some other runner's favourite routes from near or far.  I can get lost for hours just poking around the maps.
 
My only criticisms are that the site is a bit slow, incomplete feature-wise, a little lacking on the social networking aspect and absent of features for uploading pictures or routes from GPS units like the Garmin 205/305.  I'd also like the ability to see how long a run would take by pace (ie mins/mi or mins/km) instead of raw ground speed.
 
Now, all that said there are 51,865 routes in the database from all around the world and on this and sheer cool factor alone, it's worth checking out.

About Me

I am a Toronto-based software consultant specializing in SharePoint, .NET technologies and agile/iterative/lean software project management practices.

I am also a former Microsoft Consulting Services (MCS) Consultant with experience providing enterprise customers with subject matter expertise for planning and deploying SharePoint as well as .NET application development best practices.  I am MCAD certified (2006) and earned my Professional Scrum Master I certification in late September 2010, having previously earned my Certified Scrum Master certification in 2006. (What's the difference?)