Added chart to network report

Former-commit-id: 3dab00002afd311e787f1f4fc062958e189948d7
This commit is contained in:
Fermin 2019-03-05 12:33:01 +01:00
parent a01319464e
commit 233ede643b
1 changed files with 15 additions and 2 deletions

View File

@ -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.