how come a chromosome is not visible in an onion cell

Chromosomes are only visible during mitosis (prophase, anaphase, etc.) The cell must not have been replicating when you were viewing it ( Assuming this was done with a light microscope).