<?php 
if( !is_numeric( $_GET['graph'] ) ):
?>
    <!-- start HTML code -->
    
    <img src="files/example16.php?graph=1" alt="graph" />
    
    <!-- end HTML code -->
<?
else: 
       
    $barvy=array('red','green','blue','gold','#ff69b4','#fff0f5','#f08080','#bc8f8f');
    //start PHP code
    include './lib/graph.php';    
    $new = new graph('3dpie', 350, 240, '#fffeff', '8x13iso.gdf');
    $new->title('Poměrový graf za aktuální období', '#005000', 7);
     for ($g=0;$g<count($_SESSION['GRAPH']);$g++){ 
    $new->set_values(  $_SESSION['GRAPH'][$g][0], 0, $barvy[$g]  );
   }
 //  $new->set_values( 503, 0, 'blue'   );
 //   $new->set_values( 3, 0, 'green' );
 //   $new->set_values( 3, 0, 'blue' ) ;
 //   $new->set_values( 3, 1, 'gold' );
 for ($i=0;$i<count($_SESSION['GRAPH']);$i++){
  $legpole[$barvy[$i]]=($_SESSION['GRAPH'][$i][1]);
  }
    $new->legend( 'left', $legpole, 'white', '#fff8dc');
    $new->plot();
    //end PHP code
    
endif;
?>
