Click here to Skip to main content
13,794,217 members
Click here to Skip to main content
Add your own
alternative version


40 bookmarked
Posted 15 May 2007
Licenced Ms-PL

A simple thermometer chart for ASP.NET

, 15 May 2007
Rate this:
Please Sign up or sign in to vote.
A simple thermometer chart for ASP.NET.

Thermometer Chart


jThermometer is a class for creating thermometer charts of the type used generally to show progress towards a fund raising goal. It arose out of my involvement in a charity walkathon. The organizer wanted to have a thermometer-type chart on a the walkathon's home page to indicate progress towards fund raising goals. I was unable to find anything free that seemed appropriate for the site, so I decided to create my own and share it here on CodeProject.

The chart uses GDI+ to compose an image and stream it out to the browser.

Using the code

For the purposes of portability, I've separated the chart into two parts:

  • jThermometer is a class that creates a bitmap using GDI+ and streams it out to the current request as a GIF image.
  • Thermometer.aspx is a web page that accepts various parameters controlling the appearance of the Thermometer chart and that can be referenced by an <IMG> tag on another web page.

Thermometer.aspx uses these query string values:

MIN:Value displayed at the bottom of the thermometer.
MAX:Value displayed at the top of the thermometer
IV:Value indicated on the thermometer.
T:Title displayed at the top of the thermometer
VT:Type of value (1=currency, 2=decimal, 3=integer)

Further work

At present, the thermometer does not scale. I'd like to have it automatically scale based on user-provided dimensions. There are also a lot of appearance-related aspects that should be controllable via properties, such as text color, indicator color, and the color of the mercury.


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Joe Lynds
Web Developer
United States United States
Joe is a software engineer. He lives in Pennsylvania where he develops software for manufacturing and human services when he is not at the park with his three boys.

You may also be interested in...

Comments and Discussions

QuestionC# Version Pin
cal5barton22-May-13 8:18
membercal5barton22-May-13 8:18 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey18-Feb-12 4:10
professionalManoj Kumar Choubey18-Feb-12 4:10 
GeneralTYTY Pin
Peter Scholten22-Apr-09 11:33
memberPeter Scholten22-Apr-09 11:33 
GeneralTHANKS! Pin
Suriel702-Apr-09 11:38
memberSuriel702-Apr-09 11:38 
GeneralLooks good, but... Pin
MikeWardOK21-Mar-09 5:23
memberMikeWardOK21-Mar-09 5:23 
GeneralThanks, Joe! Pin
kwame dupre27-Jan-09 11:45
memberkwame dupre27-Jan-09 11:45 
GeneralMy vote of 2 Pin
Dave Kreskowiak12-Jan-09 7:37
mvpDave Kreskowiak12-Jan-09 7:37 
It would be nice if there was actual explanation of the code. How was this image generated??
GeneralThis is great work Pin
ivanhoe22-Oct-07 17:24
memberivanhoe22-Oct-07 17:24 
GeneralNice Job! Pin
Mike Fed21-Sep-07 9:51
memberMike Fed21-Sep-07 9:51 
GeneralThanks for the great work Pin
Mohamed H. Elsherif23-Jul-07 2:40
memberMohamed H. Elsherif23-Jul-07 2:40 
GeneralGood Work Pin
Hassan Tariq Butt15-May-07 21:32
professionalHassan Tariq Butt15-May-07 21:32 
SuggestionRe: Good Work (Added C# a messy way) Pin
ThomasWest4-Nov-14 14:04
memberThomasWest4-Nov-14 14:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03 | 2.8.181207.3 | Last Updated 15 May 2007
Article Copyright 2007 by Joe Lynds
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid