<?php

require_once '../../../Config/config.php';

$chartlist = array();

if($GLOBALS['connector_ris_chart'] != '')
{
  // $aaa = $GLOBALS['connector_ris_chart'];

  include_once $GLOBALS['connector_ris_chart'];
}

/*
if($GLOBALS['connector_dacs_chart'] != '')
{

  $vardacsjsonchart = file_get_contents($GLOBALS['connector_dacs_chart']."?connector_eoqual_dacs_proxy=".$GLOBALS["connector_eoqual_dacs_proxy"]);
  $vardacsarraychart = json_decode($vardacsjsonchart);
  $chartlist = array_merge($chartlist, $vardacsarraychart);
}
*/

include 'chartconfig_client.php';

function get_default_graphics(){
  global $chartlist;

  $chartselected = array();

  $obj = new StdClass();
  $obj->id = 'nstudybymodalitybyday';
  $obj->style = 'bar';
  $obj->layoutid = '0_0';
  $chartselected[] = $obj;

  $obj = new StdClass();
  $obj->id = 'nstudybymodality';
  $obj->style = 'bar';
  $obj->layoutid = '1_0';
  $chartselected[] = $obj;

  $obj = new StdClass();
  $obj->id = 'nstudybyradiologistbyday';
  $obj->style = 'bar';
  $obj->layoutid = '0_1';
  $chartselected[] = $obj;

  $obj = new StdClass();
  $obj->id = 'nstudybyradiologist';
  $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
    }
  }
}
?>
