imagemap for graphs

General forum for discussions regarding UTStatsDB
tyounglightsys
Posts: 2
Joined: Mon Feb 21, 2011 6:50 pm

imagemap for graphs

Postby tyounglightsys » Mon Feb 21, 2011 6:56 pm

Hi there,
On our copy of utstatsdb we wanted to be able to mouse-over values on the various graphs and see the values that are graphed. I programmed that, and it seems to work fine. I have created a patch-file for utstatsdb-3.06. Is there a standard way for me to submit that? Is this anything you would like to have? (I can post a link to our utstats page if you want to try it out)

tyounglightsys
Posts: 2
Joined: Mon Feb 21, 2011 6:50 pm

Re: imagemap for graphs

Postby tyounglightsys » Tue Feb 22, 2011 7:41 am

Ok. So I decided to post a link to my ut stats site with the imagemap.
http://tyounglightsys.dyndns.org/utstat ... p?match=10

Basically, you can mouse-over one of the graph-lines and "hover" the mouse there for a sec, and the value of that point gets displayed.

The change to make this happen is very simple. I enclosed the "graphs.php" file inside a function so it can also be included in the matchstats.php file. I needed to replace the "include" statements in graphs.php with "include_once". Then, I put if-statements around all the graphics functions (imageline, etc).

In short, the same code that you use to generate the graphs is the same code that is used to generate the image-maps. If you add another type of graph or something, the image-map should just "work".

An imagemap can create a larger html page, but I did not want to go through the effort of making it a configure option as to whether or not we wanted to enable them or not.


Return to “UTStatsDB”