Skip to main content
Inspiring
October 15, 2008
Question

Creating a dynamic thermometer

  • October 15, 2008
  • 2 replies
  • 986 views
Hi,
Has anyone created a thermometer or chart using dynamic data? I have a form where on submisson, will add the user to the db and display a chart or thermometer the total number of users.

Thanks!
    This topic has been closed for replies.

    2 replies

    October 16, 2008
    Hi Jenn-
    ... ugh, talk about timing, I just purged some way old code that I had onto a cd backup and put them into storage, so it'll be a few days before I can get to them, but just from memory, we had a huge intranet site that needed to display some stats long before cfchart came around and we used the old pixel stretching trick to get bar charts onto screen, then "upgraded" when we got a hold of cfchart. Long story short, and with a few simple lines of math code, tally up your total number of responses, calculate your percentage results for each response/category/result/what-have-you and display the percentage values, not the raw values. This way your physical chart sizes can remain the same while the values can be still be displayed proportionately. This also helped us publish reports that needed to be printed so we had to know that X pixels by X pixels were going to be designated for that particular chart's space. I'm sure someone else has probably come along with something better but this should get you by for now.

    HTH,

    Rich
    Inspiring
    October 15, 2008
    You can easily use cfchart for your basic chart types (bar, pie, etc).

    You could also create a gauge chart using this tip on Raymond Camden's blog:
    http://www.coldfusionjedi.com/index.cfm/2008/1/18/Coolest-CFCHART-Trick-Ever

    If you specifically need a thermometer, you might look at jFreeChart
    http://www.jfree.org/