Today, Google released their Chart API. Basically, the Google Chart API allows you to dynamically generate charts for use in your web applications. All you do is pass your data in the querystring and an image is returned. This isn't really a service to get too excited about, but it is pretty simple to use and it's Free.
Here is a bit about this:
The Google Chart API lets you dynamically generate charts. To see the Chart API in action, open up a browser window and copy the following URL into it:
http://chart.apis.google.com/chart?cht=p3&chd=s:hW&chs=250x100&chl=Hello|World
Press the Enter or Return key and - presto! - you should see the following image:
I decided to code up a small ASP.NET Server Control that uses the Google Chart API to put simple line graph charts on a page.
How to use this control:
Put the Chart control on the page:
<GoogleAPI:Chart runat="server" id="Chart1" Width="200" Height="150" LineColor="ff0000" BackgroundColor="efefef" ToolTip="Hello World"></GoogleAPI:Chart>
In the page load event define the values to be charted:
Chart1.MaxValue = 60;Chart1.Values.Clear();Chart1.Values.Add("Jan", 10);Chart1.Values.Add("Feb", 20);Chart1.Values.Add("Mar", 30);Chart1.Values.Add("Apr", 50);Chart1.Values.Add("May", 5);Chart1.YAxisLabels.Add("0 Kb");Chart1.YAxisLabels.Add("25+ Kb");Chart1.YAxisLabels.Add("50+ Kb");
And, that's all you have to do to put a Chart on your page using the control.
The result is this:
Download the example / source code here: GoogleChartAPI.rar (3.33 KB)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.