Added chart to network report
Former-commit-id: 3dab00002afd311e787f1f4fc062958e189948d7
This commit is contained in:
parent
a01319464e
commit
233ede643b
|
@ -164,8 +164,9 @@ $hidden_main_link = [
|
|||
'top' => $top,
|
||||
];
|
||||
|
||||
// Print the data.
|
||||
// Print the data and build the chart.
|
||||
$table->data = [];
|
||||
$chart_data = [];
|
||||
foreach ($data as $item) {
|
||||
$row = [];
|
||||
$row['main'] = html_print_link_with_params(
|
||||
|
@ -181,12 +182,24 @@ foreach ($data as $item) {
|
|||
1024,
|
||||
'B'
|
||||
);
|
||||
|
||||
$table->data[] = $row;
|
||||
|
||||
// Build the pie graph data structure.
|
||||
$chart_data[$item['host']] = $item['sum_bytes'];
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
// Print the graph.
|
||||
echo '<div>';
|
||||
echo pie_graph(
|
||||
$chart_data,
|
||||
320,
|
||||
200,
|
||||
__('Others')
|
||||
);
|
||||
echo '<div>';
|
||||
|
||||
?>
|
||||
<script>
|
||||
// Configure jQuery timepickers.
|
||||
|
|
Loading…
Reference in New Issue