Example #1
0
 /**
  * undocumented function
  *
  * @param string $options 
  * @return void
  * @access public
  */
 function xAxis($options)
 {
     $x = null;
     if (isset($options['x_axis'])) {
         $x = new x_axis();
         $xOptions = $options['x_axis'];
         if (isset($xOptions['color'])) {
             $x->colour($xOptions['color']);
         }
         if (isset($xOptions['grid_colour'])) {
             $x->grid_colour($xOptions['grid_colour']);
         }
         if (isset($xOptions['tick_height'])) {
             $x->tick_height($xOptions['tick_height']);
         }
         if (isset($xOptions['stroke'])) {
             $x->stroke($xOptions['stroke']);
         }
         if (isset($xOptions['labels'])) {
             $x->set_labels_from_array($xOptions['labels']);
             if (isset($xOptions['label_direction'])) {
                 $x->labels->set_vertical();
             }
         }
     }
     return $x;
 }
Example #2
0
$type_idx = $_GET['i'];
$type_idx = $type_idx == 0 ? $type_idx : $type_idx - 1;
$title = new title("Individual Portfolio Performance (" . $portfolio_type[$type_idx] . ")");
$title->set_style("{font-size: 25px; font-family: Calibri; font-weight: bold; color: #121212; text-align: center;}");
$chart->set_title($title);
// y axis properties
$y = new y_axis();
$y_min = 0.0;
$y_max = 0.0;
$y_min = floor(0.995 * $amt_min);
$y_max = ceil(1.005 * $amt_max);
$y->set_grid_colour('#EFEFEF');
$y->set_range($y_min, $y_max, round(($y_max - $y_min) / 5.0));
$chart->set_y_axis($y);
// y legend properties
$y_legend = new y_legend('Amount ($)');
$y_legend->set_style('{font-size:15px; font-family:Calibri; color:#121212}');
$chart->set_y_legend($y_legend);
// x axis properties
$x = new x_axis();
$x->set_labels_from_array($x_labels);
$x->grid_colour('#EFEFEF');
$chart->set_x_axis($x);
// background properties
$chart->set_bg_colour('#FFFFFF');
// menu
$m = new ofc_menu("#E0E0FF", "#707070");
$m->values(array(new ofc_menu_item('Toggle view', 'toggle')));
//$chart->set_menu($m);
echo $chart->toPrettyString();
//echo $chart_data;