<?
// **************************************************************************
// 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');
?>
<STYLE TYPE="text/css">
<!--
  body     { font-family:arial,helvetica;font-size:12px; }
  pre { color:#0000FF; }
  td   { font-family:arial,helvetica;font-size:12px;}
  tr.odd   { background-color: #F0F0F8; color:#000000; }
  tr.even  { background-color: #E0E0F0; color:#000000; }
  h4       { background-color: #E0E0F0; color:#000000;
           text-align: left; }
  h5       { background-color: #E0E0F0; color:#000000;
           text-align: center; }
		   
		   tr.barodd   { background-color: #F0F0F8; color:#000000;
              FONT-size: 10px; FONT-FAMILY: Arial, Helvetica;
            }
tr.bareven  { background-color: #E0E0F0; color:#000000;
              FONT-size: 10px; FONT-FAMILY: Arial, Helvetica;
            }
tr.barhead  { background-color: #B0B0E0; color:#000000;
           BORDER-TOP: 1px solid #0000F0; BORDER-LEFT: 1px solid #0000F0 ;
           BORDER-RIGHT: 1px solid #0000F0 ; BORDER-BOTTOM: 1px solid #0000F0 ;
           font-size: 12px; FONT-FAMILY: Arial, Helvetica; font-weight: bold;
           text-align: center;
           filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#F8F8FF,endColorStr=#C0C0F0);
}
td.barhead  { background-color: #B0B0E0; color:#000000;
           BORDER-TOP: 1px solid #8080F0; BORDER-LEFT: 1px solid #8080F0;
           BORDER-RIGHT: 1px solid #8080F0; BORDER-BOTTOM: 1px solid #8080F0;
           font-size: 12px; FONT-FAMILY: Arial, Helvetica; font-weight: bold;
           filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#F8F8FF,endColorStr=#C0C0F0);
}
-->
</STYLE>
<? 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);
 }
/*
$data[] = array(900, 1300,3500);
$data[] = array(1200,1800,2500);
$data[] = array(1400,2000,2800);
$data[] = array(1900,2900,3900);
$data[] = array(2500,3500,4500);
*/
$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);

?>