     packetList.removeChild(packetList.lastChild);
        }
        
        // Update Source IP chart
        const ipCounts = data.ip_counts;
        sourceIpChart.data.labels = Object.keys(ipCounts).slice(0, 10);
        sourceIpChart.data.datasets[0].data = Object.values(ipCounts).slice(0, 10);
        sourceIpChart.update();
        
        // Update Protocol chart
        const protocolCounts = data.protocol_counts;
        protocolChart.data.labels = Object.keys(protocolCounts);
        protocolCha