botfreak

06-08-2008, 06:10 PM

I need a little help with this graph...My gaming clan keeps track of game stats but I've had to put the data in manually for over a year now...I'd like to add buttons to the script to increase or decrease the bar graph gif by 1 pixel on each click. I got this to work with the gif but the scripts for the graph stopped working...as in the win loss %'s.We dont have to use javascript if anyone knows a better format...Our webserver supports all

the test page is http://www.mojo2go.org/statstest1.html

the original stats page is http://www.mojo2go.org/stats.html

<td>Multiplayer Matches

<script language="JavaScript1.2">

var graphimage="http://mojo2go.org/pics/bar4.gif"

var graphx=new Array()

graphx[0]=["Wins",42]

graphx[1]=["Loses",1]

function graphit(g,gwidth){

total=0

for (i=0;i<g.length;i++)

total+=parseInt(g[i][1])

output='<table border="0" cellspacing="0" cellpadding="0">'

for (i=0;i<g.length;i++){

calpercentage=Math.round(g[i][1]*100/total)

calwidth=Math.round(gwidth*(calpercentage/100))

output+='<tr><td>'+g[i][0]+' </td><td><img src="'+graphimage+'" width="'+calwidth+'" height="10"> '+calpercentage+'%</td></tr>'

}

output+='</table>'

document.write(output+'<br>Matches Reported: <b>'+total+'</b>')

}

graphit(graphx,200)

</script>

Any help would be greatly appreciated...

the test page is http://www.mojo2go.org/statstest1.html

the original stats page is http://www.mojo2go.org/stats.html

<td>Multiplayer Matches

<script language="JavaScript1.2">

var graphimage="http://mojo2go.org/pics/bar4.gif"

var graphx=new Array()

graphx[0]=["Wins",42]

graphx[1]=["Loses",1]

function graphit(g,gwidth){

total=0

for (i=0;i<g.length;i++)

total+=parseInt(g[i][1])

output='<table border="0" cellspacing="0" cellpadding="0">'

for (i=0;i<g.length;i++){

calpercentage=Math.round(g[i][1]*100/total)

calwidth=Math.round(gwidth*(calpercentage/100))

output+='<tr><td>'+g[i][0]+' </td><td><img src="'+graphimage+'" width="'+calwidth+'" height="10"> '+calpercentage+'%</td></tr>'

}

output+='</table>'

document.write(output+'<br>Matches Reported: <b>'+total+'</b>')

}

graphit(graphx,200)

</script>

Any help would be greatly appreciated...