<?
// **************************************************************************
// sample.php - sample script that demonstrates using as-diagrams.php,
// class for drawing gd-less bar diagrams.
//
// Written by Alexander Selifonov,  http://as-works.narod.ru
// Read "as-diagrams.htm" for how-to instructions
// **************************************************************************


require_once('as-diagrams.php');
?>

<? global $db;
 $data_title = 'Target Assigned Vs. Achievement'; // title for the diagram
$target= $s->GetFieldValue('crmsales_target',"mst_usersid='".$_SESSION['UserID']."'" ,'target');	 
  $month_target=$target/12;

	  
 
 
 
 $data = array();
for($i=0,$j=0;$i<12;$i++,$j+=10) {
 $data[] = array($month_target, $j,1600);
 }
 $legend_x = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec');
$legend_y = array('Assigned','Achieved');
$graph = new CAsBarDiagram;
$graph->bwidth = 20; // set one bar width, pixels
$graph->bt_total = 'Summary'; // 'totals' column title, if other than 'Totals'
// $graph->showtotals = 0;  // uncomment it if You don't need 'totals' column
$graph->precision = 2;  // decimal precision
// call drawing function

$graph->DiagramBar($legend_x, $legend_y, $data, $data_title);

?>