It seems I may be a bit late to actually help you out...
However, pregnant or not, it's not normal for them to do this. Rapid breathing and staying at the top, as well as not eating, are sings of serious issues(severe stress, possible poisoning and low to zero oxygen). You most likely don't have enough oxygen in the tank, and also probably have toxins in there.
As for pregnancy, if you have a female who was purchased at a petshop or once it was past an inch long, chances are it's pregnant. Females usually are and can hold sperm from a single mating and fertilize eggs monthly for up to a year without a male being present again for that time.
Did you cycle the tank before adding fish? Fully cycle it, not just set it up and let it run for a few days/two weeks like dumbheads at petshops tell you to? It needs 4-8+ weeks to properly cycle with an ammonia source added and regular changes and monitoring. If you didn't do that your new fish started the cycle and the toxins bombed them, hurting their immune systems, slime coats, and all around health(it usually destroys their immune systems for life if they survive a cycling tank).
Do you have a proper filter? Without the filter you have no beneficial bacteria colonies, or not much of one, and also have low to no oxygen in the tank.
How big is the tank? Swordtails require groups of 4+ (preferably no more than one male since they often battle it out even without females around), and a tank that is 25-30 gallons and long, not tall.30+ gallons being best, they really don't like the smaller tanks as they get 5-7 inches long and love to have a lot of swimming room. They get big, and without adequate space and numbers, they get stressed out, depressed, and can get very aggressive as well.
I hope you managed to figure out what was going on and that nobody passed away, but if so...find more information and use it for future references. Good luck to you and your fish!
forum community dedicated to tropical fish owners and enthusiasts. Come join the discussion about species,breeding, health, behavior, aquariums, adopting, care, classifieds, and more! Open to fish, plants and reptiles living in freshwater or saltwater environments.