One of my current projects involved producing “Dashboards”. The Webdev built-in graphing functions are pretty powerful. At some point we will have to move to a 3rd party graphing function for some really high end features but for most projects the out of the box graph functions are great.
I decided to go with Justgage.com. It isn’t anything fancy but as you will see it is very easy to incorporate into your WebDev project.
So here is a screen shot of the end result.
The next step is to add a DIV section where the gauge is going to be displayed. To do that we use an HTML control in WebDev.
Then in the general tab, you see we add the DIV tag. The size of the resulting guage is defined by the size of the HTML control.
Here is the way it looks at design time with the HTML control selected
Notice the “Response Rate” heading and the “Down from” subtitle are overlaid on the HTML control, I had to do some experimenting on the placement to get them to fit with the gauge.
In the Initialization of the page I am using a class to access the database and calculate the response rate. The hows and whys of that calcuation really don’t matter for this article. The important thing to understand is that because I am accessing the database and a class it has to be done in server code. Here is that section of code
Be sure to go over to wxLive.us and watch the Uncle Pete’s corner webinar that is the companion to this article.
Uncle Pete’s Corner is weekly webinar on all things WX every Friday, to watch the recorded version of this webinar, many other WX related webinars or to watch future ones live go to wxLive.us