Hi people ,
I have this Javascript that show on screen in Bar Graph mode , any graph about anything =) .
What is your favorite news site?
<script language="JavaScript1.2">
var graphimageP="poll.gif"
//DEFINE GRAPH VALUES [Item name, Percentage value]
var graphv=new Array()
graphv[0]=["CNN","28%"]
graphv[1]=["MSNBC","36%"]
graphv[2]=["ABC News","11%"]
graphv[3]=["BBC News","25%"]
//YOU CAN DEFINE MULTIPLE GRAPHS, eg:
//var graphz=new Array()
function graphitP(g,gwidth){
outputP='<table border="0" cellspacing="0" cellpadding="0">'
for (i=0;i<g.length;i++){
calwidthP=gwidth*(parseInt(g[1])/100)
outputP+='<tr><td>'+g[0]+' </td><td><img src="'+graphimageP+'" width="'+calwidthP+'" height="10"> '+g[1]+'</td></tr>'
}
outputP+='</table>'
document.write(outputP)
}
//CALL GRAPHIT FUNCTION
//graphitP(NAME OF GRAPH ARRAY, MAXIMUM WIDTH IN PIXELS)
graphitP(graphv,200)
</script>
</a></font></p>
Very well , then he showme when i put in the : graphv[0]=["CNN","28%"] <- 28% the graph mode of it .
Wow then with PHP can i check a dir and all subsdirs, taking the total in size and transform it in Percents ??
Like Dir /home/abc have 2.4 GB but i put a variable like 4.5GB=100% he just check the size of my dir with the size that i put in the variable and send to the javascript the right percent . Like 60% or 89% etc .
I have the javascript who can help with PHP please .. =)