1 <div id
="trends_graphs" style
="margin: 20px auto 0 auto;">
2 <div id
='tgraph'>Trend graphs loading
...</div
>
8 $state_names = array();
12 foreach ($graph_pure_data as $service => $statechanges) {
16 $servicerow = array();
18 for ($i = 0; $i < count($statechanges); $i++
) {
20 $cur_out = $statechanges[$i]['output'];
21 if( isset( $outputs_r[$cur_out] ) ) {
22 $output_id = $outputs_r[$cur_out];
24 $output_id = count($outputs);
25 $outputs[] = $cur_out;
26 $outputs_r[$cur_out] = $output_id;
29 $servicerow[] = array(
30 $statechanges[$i]['duration'], /* 0: duration */
31 $statechanges[$i]['state'], /* 1: state */
32 $output_id /* 2: short */
35 $state_names[$statechanges[$i]['state']] = ucfirst($this->_state_string_name($obj_type, $statechanges[$i]['state']));
38 $rawdata[] = $servicerow;
41 $colors = reports
::_state_color_table($obj_type);
46 var rawdata
= <?php
echo json_encode($rawdata); ?
>,
47 short_names
= <?php
echo json_encode($outputs); ?
>,
48 labels
= <?php
echo json_encode($labels); ?
>,
49 state_names
= <?php
echo json_encode($state_names); ?
>,
50 colors
= <?php
echo json_encode($colors); ?
>;
54 for( var i
=0; i
<rawdata
.length
; i++
) {
56 for( var j
=0; j
<rawdata
[i
].length
; j++
) {
58 'duration': rawdata
[i
][j
][0],
59 'label': state_names
[rawdata
[i
][j
][1]],
60 'short': short_names
[rawdata
[i
][j
][2]],
61 'color': colors
[rawdata
[i
][j
][1]]
66 $
(window
).load(function () {
70 <?php
echo $graph_start_date ?
>,
71 <?php
echo ($use_scaling) ?
'true':'false'; ?
>
76 <?php
if ($included && $skipped) {
77 printf(_("<p>Not showing %d graphs due to being 100%% OK</p>"), $skipped);