array ( "Four" => 100, "Three" => 150, "Two" => 50, "One" => 200, "Zirro" => 10, "-One" => 20 ), "Octomber" => array ( "Four" => 40, "Three" => 30, "Two" => 20, "One" => 10, "Zirro" => 10, "-One" => 100 ), "November" => array ( "Four" => 30, "Three" => 20, "Two" => 30, "One" => 10, "Zirro" => 5, "-One" => 105 ), "December" => array ( "Four" => 30, "Three" => 20, "Two" => 40, "One" => 50, "Zirro" => 10, "-One" => 10 ) ); $image_width = 640; $image_height = 480; $frame_left=70; $frame_bottom=20; // CONF PART END // Add more colours for larger graphs $colours = array('#F00','#0F0','#00F', '#A98', '#111', '#222', '#333', '#444', '#123','#321' ,'#567' ,'#ABC'); // Calculate single point dimentions $greatest_result = null; $smallest_result = null; foreach ($input_array as $stat_results) { foreach ($stat_results as $result) { if ($result>$greatest_result || $greatest_result==null) $greatest_result = $result; if ($result<$smallest_result || $smallest_result==null) $smallest_result = $result; } $total_cols = count($stat_results); } $point_w = $image_width/$total_cols; $point_h = ($image_height-$frame_bottom)/(abs($greatest_result)-abs($smallest_result)); // DEBUG //echo "Point: ", $point_w, "x", $point_h, " max/min: ", $greatest_result, ", ", $smallest_result; //exit; $stat_values = array(); $stat_keys = array(); header("Content-type:image/svg"); echo "\n"; ?> " style="fill:none;stroke:;stroke-width:2" /> $values_array) {?>