<?php

include __DIR__.'/../config.php';


$chartlist = array();

error_log ( "Current path : " .getcwd() );

if($GLOBALS['connector_dacs_chart'] != '')
{
  include_once $GLOBALS['connector_dacs_chart'];
}

include 'chartconfig_client.php';


function get_default_graphics ()
{
    error_log ( "get_default_graphics..." );

  global $chartlist;

  $chartselected = array();

  $obj = new StdClass();
  $obj->id = 'dacs_nstudybymodality';
  $obj->style = 'bar';
  $obj->layoutid = '0_0';
  $chartselected[] = $obj;
  
   $obj = new StdClass();
  $obj->id = 'dacs_nstudybysite';
  $obj->style = 'bar';
  $obj->layoutid = '1_0';
  $chartselected[] = $obj;
  
  $obj = new StdClass();
  $obj->id = 'dacs_nstudymgbyage';
  $obj->style = 'bar';
  $obj->layoutid = '0_1';
  $chartselected[] = $obj;
 
   $obj = new StdClass();
  $obj->id = 'dacs_nstudybyage';
  $obj->style = 'bar';
  $obj->layoutid = '1_1';
  $chartselected[] = $obj;

  foreach( $chartselected as $value )
  {
    $object = $value;
    $found = array_filter($chartlist, function($uniqueObject) use ($object) {
      return $uniqueObject->id == $object->id;
    });

    if($found)
    { ?>
      chartSelectedByLayout['<?php echo $object->layoutid;?>'] = {idtype:'<?php echo $object->id;?>',style:'<?php echo $object->style;?>',chartobj:null,default:1};
      <?php
    }
  }
}
?>
