\n"); $index=1; while ($_GET["c".$index]) { if ($index==1) { $plot[0]=data($_GET["c1"],$table,$time,true); } else { $plot[$index-1]=data($_GET["c".$index],$table,$time,false); } $index++; } $last=substr($plot[0],0,strpos($plot[0],"x")); $plot[0]=substr($plot[0],strpos($plot[0],"x")+1); $first=substr($plot[0],0,strpos($plot[0]," ",15)); printf("set xdata time\n"); printf("set timefmt \"%%Y-%%m-%%d %%H:%%M:%%S\"\n"); printf("set xrange [\"".$first."\":\"".$last."\"]\n"); printf("#set xlabel \"Time\"\n"); printf("set yrange [0:]\n"); printf("#set ylabel \"".ucfirst($table)."\"\n"); printf("set grid y\n"); printf("set key left\n"); printf("set terminal png\n"); printf("set size 0.60,0.35\n"); switch ($time) { case 3900: ?> set title "Hour" set xtics 900 set format x "%H:%M" set output '_hour.png' set title "Day" set xtics 7200 set format x "%H" set output '_day.png' set title "Week" set xtics 86400 set format x "%d" #set xdtics set output '_week.png' set title "Month" set xtics 259200 set format x "%d" set output '_month.png' set title "Year" set xtics 2592000 set format x "%m" set output '_year.png' \n"); ?>