'; $output .= ''; } else { $output .= ''; $output .= ''; } } if (!$return) { echo $output; } return $output; } function d3_relationship_graph($elements, $matrix, $width=700, $return=false) { global $config; if (is_array($elements)) { $elements = json_encode($elements); } if (is_array($matrix)) { $matrix = json_encode($matrix); } $output = '
'; $output .= include_javascript_d3(true); $output .= ""; if (!$return) { echo $output; } return $output; } function d3_tree_map_graph($data, $width=700, $height=700, $return=false) { global $config; if (is_array($data)) { $data = json_encode($data); } $output = "
"; $output .= include_javascript_d3(true); $output .= ''; $output .= ""; if (!$return) { echo $output; } return $output; } function d3_sunburst_graph($data, $width=700, $height=700, $return=false) { global $config; if (is_array($data)) { $data = json_encode($data); } $output = "
"; $output .= include_javascript_d3(true); $output .= ''; $output .= ""; if (!$return) { echo $output; } return $output; } function d3_bullet_chart( $chart_data, $width, $height, $color, $legend, $homeurl, $unit, $font, $font_size ) { global $config; $output = ''; $output .= include_javascript_d3(true); $id_bullet = uniqid(); $font = array_shift(explode('.', array_pop(explode('/', $font)))); $output .= '
'; return $output; } function d3_gauges( $chart_data, $width, $height, $color, $legend, $homeurl, $unit, $font, $font_size, $no_data_image ) { global $config; if (is_array($chart_data)) { $data = json_encode($chart_data); } $output = include_javascript_d3(true); foreach ($chart_data as $module) { $output .= "
"; } $output .= ""; return $output; } function ux_console_phases_donut($phases, $id, $return=false) { global $config; foreach ($phases as $i => $phase) { $phases[$i]['phase_name'] = io_safe_output($phase['phase_name']); } if (is_array($phases)) { $phases = json_encode($phases); } $recipient_name = 'phases_donut_'.$id; $recipient_name_to_js = '#phases_donut_'.$id; $output = '
"; $output .= include_javascript_d3(true); $output .= ''; $output .= "'; if (!$return) { echo $output; } return $output; } function d3_progress_bar( $id, $percentile, $width, $height, $color, $unit='%', $text='', $fill_color='#FFFFFF', $radiusx=10, $radiusy=10, $transition=1 ) { global $config; $recipient_name = 'progress_bar_'.$id; $recipient_name_to_js = '#progress_bar_'.$id; $output = ''; $output .= '
"; $output .= include_javascript_d3(true); $output .= "'; return $output; } function d3_progress_bubble($id, $percentile, $width, $height, $color, $unit='%', $text='', $fill_color='#FFFFFF') { global $config; $recipient_name = 'progress_bubble_'.$id; $recipient_name_to_js = '#progress_bubble_'.$id; $output = ''; $output .= '
"; $output .= include_javascript_d3(true); $output .= ""; return $output; } function progress_circular_bar($id, $percentile, $width, $height, $color, $unit='%', $text='', $fill_color='#FFFFFF', $transition=1) { global $config; $recipient_name = 'circular_progress_bar_'.$id; $recipient_name_to_js = '#circular_progress_bar_'.$id; $output = ''; $output .= '
"; $output .= include_javascript_d3(true); $output .= ""; return $output; } function progress_circular_bar_interior($id, $percentile, $width, $height, $color, $unit='%', $text='', $fill_color='#FFFFFF') { global $config; $recipient_name = 'circular_progress_bar_interior_'.$id; $recipient_name_to_js = '#circular_progress_bar_interior_'.$id; $output = ''; $output .= '
"; $output .= include_javascript_d3(true); $output .= ""; return $output; } function d3_donut_graph($id, $width, $height, $module_data, $resume_color) { global $config; $module_data = json_encode($module_data); $recipient_name = 'donut_graph_'.$id; $recipient_name_to_js = '#donut_graph_'.$id; $output = '
"; $output .= include_javascript_d3(true); $output .= ''; $output .= ""; return $output; } function print_clock_analogic_1($time_format, $timezone, $clock_animation, $width, $height, $id_element, $color) { global $config; $output .= ''; $tz = $timezone; $timestamp = time(); $dt = new DateTime('now', new DateTimeZone($tz)); // first argument "must" be a string $dt->setTimestamp($timestamp); // adjust the object to correct timestamp $dateTimeZoneOption = new DateTimeZone(date_default_timezone_get()); $dateTimeZonePandora = new DateTimeZone($timezone); $dateTimeOption = new DateTime('now', $dateTimeZoneOption); $dateTimePandora = new DateTime('now', $dateTimeZonePandora); $timeOffset = $dateTimeZonePandora->getOffset($dateTimeOption); $output .= include_javascript_d3(true); if ($width == 0) { $date_width = 200; } else { $date_width = $width; } $output .= '
'; if ($time_format == 'timedate') { $output .= $dt->format('d / m / Y').' - '; } $output .= $dt->format('a').'
'; $output .= ""; $timezone_short = explode('/', $timezone); $timezone_short_end = end($timezone_short); $output .= '
'.$timezone_short_end.'
'; return $output; } function print_clock_digital_1($time_format, $timezone, $clock_animation, $width, $height, $id_element, $color) { global $config; $output .= ''; $output .= include_javascript_d3(true); $tz = $timezone; $timestamp = time(); $dt = new DateTime('now', new DateTimeZone($tz)); // first argument "must" be a string $dt->setTimestamp($timestamp); // adjust the object to correct timestamp $dateTimeZoneOption = new DateTimeZone(date_default_timezone_get()); $dateTimeZonePandora = new DateTimeZone($timezone); $dateTimeOption = new DateTime('now', $dateTimeZoneOption); $dateTimePandora = new DateTime('now', $dateTimeZonePandora); $timeOffset = $dateTimeZonePandora->getOffset($dateTimeOption); $output .= include_javascript_d3(true); if ($width == 0) { $date_width = 200; } else { $date_width = $width; } if ($time_format == 'timedate') { $output .= '
'; $output .= $dt->format('d / m / Y').'
'; } $output .= ' '; $output .= ""; $timezone_short = explode('/', $timezone); $timezone_short_end = end($timezone_short); $output .= '
'.$timezone_short_end.'
'; return $output; } /** * Print dougnhnut. * * @param array $colors Colors. * @param integer $width Width. * @param integer $height Height. * @param array $data Data. * @param mixed $data_total Data_total. * * @return string HTML. */ function print_donut_narrow_graph( array $colors, $width, $height, array $data, $data_total ) { global $config; if (empty($data)) { return graph_nodata_image($width, $height, 'pie'); } $series = count($data); if (($series != count($colors)) || ($series == 0)) { return ''; } $data = json_encode($data); $colors = json_encode($colors); $graph_id = uniqid('graph_'); // This is for "Style template" in visual styles. switch ($config['style']) { case 'pandora': $textColor = '#000'; $strokeColor = '#fff'; break; case 'pandora_black': $textColor = '#fff'; $strokeColor = '#222'; break; default: $textColor = '#000'; $strokeColor = '#fff'; break; } $textColor = json_encode($textColor); $strokeColor = json_encode($strokeColor); $out = "
"; $out .= include_javascript_d3(true); $out .= ""; return $out; }