Today, I just saw that 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.
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. The image on the right is actually a screenshot I took after using my new control to add a couple charts to a page.
How to use this control:
Put the Chart control on the page:
«/span>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.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”); </span></span>
And, that’s all you have to do to put a Chart on your page using my little control.
This source code is licensed under the Creative Commons Attribution 3.0 United States License.
- 10 Oct 2020
- 01 Jul 2020
- 06 Apr 2020
- 11 Mar 2020
- 15 Feb 2020
Recent on Build5Nines.com
- 04 Dec 2020
Latest Cloud News: Apple on K8s, IoT, Microsoft Pluton and more! (November 20, 2020 Build5Nines Weekly)20 Nov 2020
Latest Cloud News: .NET 5 Released, Apple Silicon M1 CPU, and more! (November 12, 2020 Build5Nines Weekly)12 Nov 2020
- 11 Nov 2020
Latest Cloud News: Kubernetes, Terraform, Teams Multi-Login and more! (November 5, 2020 Build5Nines Weekly)05 Nov 2020
This site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. We also participates in affiliate programs with Udemy, and other sites. This site is compensated for referring traffic and business to these companies.